00001 <?php 00002 /** 00003 * Magento 00004 * 00005 * NOTICE OF LICENSE 00006 * 00007 * This source file is subject to the Open Software License (OSL 3.0) 00008 * that is bundled with this package in the file LICENSE.txt. 00009 * It is also available through the world-wide-web at this URL: 00010 * http://opensource.org/licenses/osl-3.0.php 00011 * If you did not receive a copy of the license and are unable to 00012 * obtain it through the world-wide-web, please send an email 00013 * to license@magentocommerce.com so we can send you a copy immediately. 00014 * 00015 * DISCLAIMER 00016 * 00017 * Do not edit or add to this file if you wish to upgrade Magento to newer 00018 * versions in the future. If you wish to customize Magento for your 00019 * needs please refer to http://www.magentocommerce.com for more information. 00020 * 00021 * @category Mage 00022 * @package Mage_Adminhtml 00023 * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) 00024 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 00025 */ 00026 00027 include_once "ProfileController.php"; 00028 00029 /** 00030 * Convert GUI admin controller 00031 * 00032 * @category Mage 00033 * @package Mage_Adminhtml 00034 * @author Magento Core Team <core@magentocommerce.com> 00035 */ 00036 class Mage_Adminhtml_System_Convert_GuiController extends Mage_Adminhtml_System_Convert_ProfileController 00037 { 00038 /** 00039 * Profiles list action 00040 */ 00041 public function indexAction() 00042 { 00043 if ($this->getRequest()->getQuery('ajax')) { 00044 $this->_forward('grid'); 00045 return; 00046 } 00047 $this->loadLayout(); 00048 00049 /** 00050 * Set active menu item 00051 */ 00052 $this->_setActiveMenu('system/convert'); 00053 00054 /** 00055 * Append profiles block to content 00056 */ 00057 $this->_addContent( 00058 $this->getLayout()->createBlock('adminhtml/system_convert_gui', 'convert_profile') 00059 ); 00060 00061 /** 00062 * Add breadcrumb item 00063 */ 00064 $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Import/Export'), Mage::helper('adminhtml')->__('Import/Export')); 00065 $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Profiles'), Mage::helper('adminhtml')->__('Profiles')); 00066 00067 $this->renderLayout(); 00068 } 00069 00070 public function gridAction() 00071 { 00072 $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/system_convert_gui_grid')->toHtml()); 00073 } 00074 00075 /** 00076 * Profile edit action 00077 */ 00078 public function editAction() 00079 { 00080 $this->_initProfile(); 00081 $this->loadLayout(); 00082 00083 $profile = Mage::registry('current_convert_profile'); 00084 00085 // set entered data if was error when we do save 00086 $data = Mage::getSingleton('adminhtml/session')->getConvertProfileData(true); 00087 00088 if (!empty($data)) { 00089 $profile->addData($data); 00090 } 00091 00092 $this->_setActiveMenu('system/convert'); 00093 00094 00095 $this->_addContent( 00096 $this->getLayout()->createBlock('adminhtml/system_convert_gui_edit') 00097 ); 00098 00099 /** 00100 * Append edit tabs to left block 00101 */ 00102 $this->_addLeft($this->getLayout()->createBlock('adminhtml/system_convert_gui_edit_tabs')); 00103 00104 $this->renderLayout(); 00105 } 00106 00107 public function uploadAction() 00108 { 00109 $this->_initProfile(); 00110 $profile = Mage::registry('current_convert_profile'); 00111 } 00112 00113 public function uploadPostAction() 00114 { 00115 $this->_initProfile(); 00116 $profile = Mage::registry('current_convert_profile'); 00117 } 00118 00119 public function downloadAction() 00120 { 00121 $filename = $this->getRequest()->getParam('filename'); 00122 if (!$filename || strpos($filename, '..')!==false || $filename[0]==='.') { 00123 return; 00124 } 00125 $this->_initProfile(); 00126 $profile = Mage::registry('current_convert_profile'); 00127 00128 } 00129 00130 protected function _isAllowed() 00131 { 00132 // switch ($this->getRequest()->getActionName()) { 00133 // case 'index': 00134 // $aclResource = 'admin/system/convert/gui'; 00135 // break; 00136 // case 'grid': 00137 // $aclResource = 'admin/system/convert/gui'; 00138 // break; 00139 // case 'run': 00140 // $aclResource = 'admin/system/convert/gui/run'; 00141 // break; 00142 // default: 00143 // $aclResource = 'admin/system/convert/gui/edit'; 00144 // break; 00145 // } 00146 00147 return Mage::getSingleton('admin/session')->isAllowed('admin/system/convert/gui'); 00148 } 00149 }