Esempio n. 1
0
 public function indexAction()
 {
     //echo "mbnsdfjkn";
     $model = Mage::getModel('importexport/export');
     $model->setData(array('entity' => 'catalog_product', 'file_format' => 'csv', 'frontend_label' => '', 'attribute_code' => '', 'export_filter' => array('abc' => '', 'attr_config_sort' => '', 'color' => '', 'cost' => array('0' => '', '1' => ''), 'country_of_manufacture' => '', 'created_at' => array('0' => '', '1' => ''), 'custom_design' => '', 'custom_design_from' => array('0' => '', '1' => ''), 'custom_design_to' => array('0' => '', '1' => ''), 'custom_layout_update' => '', 'description' => '', 'enable_googlecheckout' => '', 'gallery' => '', 'gift_message_available' => '', 'has_options' => '', 'image' => '', 'image_label' => '', 'media_gallery' => '', 'meta_description' => '', 'meta_keyword' => '', 'meta_title' => '', 'minimal_price' => array('0' => '', '1' => ''), 'msrp' => array('0' => '', '1' => ''), 'msrp_display_actual_price_type' => '', 'msrp_enabled' => '', 'name' => '', 'news_from_date' => '', array('0' => '', '1' => ''), 'news_to_date' => '', array('0' => '', '1' => ''), 'options_container' => '', 'page_layout' => '', 'price' => array('0' => '', '1' => ''), 'required_options' => '', 'short_description' => '', 'sku' => '', 'small_image' => '', 'small_image_label' => '', 'special_from_date' => array('0' => '', '1' => ''), 'special_price' => array('0' => '', '1' => ''), 'special_to_date' => array('0' => '', '1' => ''), 'status' => '', 'tax_class_id' => '', 'thumbnail' => '', 'thumbnail_label' => '', 'updated_at' => array('0' => '', '1' => ''), 'url_key' => '', 'url_path' => '', 'visibility' => '', 'weight' => array('0' => '', '1' => ''))));
     //$obj = Mage_Adminhtml_Controller_Action();
     return Mage_Core_Controller_Varien_Action::_prepareDownloadResponse($model->getFileName(), $model->export(), $model->getContentType());
 }
Esempio n. 2
0
 /**
  * Declare headers and content file in response for file download
  *
  * @param string $fileName
  * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in
  *                              that case
  * @param string $contentType
  * @param int $contentLength    explicit content length, if strlen($content) isn't applicable
  * @return Mage_Backend_Controller_ActionAbstract
  */
 protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
 {
     $session = Mage::getSingleton('Mage_Backend_Model_Auth_Session');
     if ($session->isFirstPageAfterLogin()) {
         $this->_redirect(Mage::getSingleton('Mage_Backend_Model_Url')->getStartupPageUrl());
         return $this;
     }
     return parent::_prepareDownloadResponse($fileName, $content, $contentType, $contentLength);
 }