Public Member Functions | |
indexAction () | |
gridAction () | |
newAction () | |
editAction () | |
saveAction () | |
deleteAction () | |
Protected Member Functions | |
_isAllowed () |
Definition at line 28 of file DesignController.php.
_isAllowed | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Controller_Action.
Definition at line 121 of file DesignController.php.
00122 { 00123 return Mage::getSingleton('admin/session')->isAllowed('system/design'); 00124 }
deleteAction | ( | ) |
Definition at line 99 of file DesignController.php.
00100 { 00101 if ($id = $this->getRequest()->getParam('id')) { 00102 $design = Mage::getModel('core/design') 00103 ->setId($id); 00104 00105 try { 00106 $design->delete(); 00107 00108 Mage::getSingleton('adminhtml/session') 00109 ->addSuccess($this->__('Design change deleted')); 00110 } catch (Mage_Exception $e) { 00111 Mage::getSingleton('adminhtml/session') 00112 ->addError($e->getMessage()); 00113 } catch (Exception $e) { 00114 Mage::getSingleton('adminhtml/session') 00115 ->addException($e, $this->__("Can't delete design change")); 00116 } 00117 } 00118 $this->getResponse()->setRedirect($this->getUrl('*/*/')); 00119 }
editAction | ( | ) |
Definition at line 48 of file DesignController.php.
00049 { 00050 $this->loadLayout(); 00051 $this->_setActiveMenu('system'); 00052 $this->getLayout()->getBlock('head')->setCanLoadExtJs(true); 00053 00054 $id = (int) $this->getRequest()->getParam('id'); 00055 $design = Mage::getModel('core/design'); 00056 00057 if ($id) { 00058 $design->load($id); 00059 } 00060 00061 Mage::register('design', $design); 00062 00063 $this->_addContent($this->getLayout()->createBlock('adminhtml/system_design_edit')); 00064 $this->_addLeft($this->getLayout()->createBlock('adminhtml/system_design_edit_tabs', 'design_tabs')); 00065 00066 $this->renderLayout(); 00067 }
gridAction | ( | ) |
Definition at line 38 of file DesignController.php.
00039 { 00040 $this->getResponse()->setBody($this->getLayout()->createBlock('adminhtml/system_design_grid')->toHtml()); 00041 }
indexAction | ( | ) |
Definition at line 30 of file DesignController.php.
00031 { 00032 $this->loadLayout(); 00033 $this->_setActiveMenu('system'); 00034 $this->_addContent($this->getLayout()->createBlock('adminhtml/system_design')); 00035 $this->renderLayout(); 00036 }
newAction | ( | ) |
saveAction | ( | ) |
Definition at line 69 of file DesignController.php.
00070 { 00071 if ($data = $this->getRequest()->getPost()) { 00072 $id = (int) $this->getRequest()->getParam('id'); 00073 00074 $design = Mage::getModel('core/design'); 00075 if ($id) { 00076 $design->load($id); 00077 } 00078 00079 $design->setData($data['design']); 00080 if ($id) { 00081 $design->setId($id); 00082 } 00083 try { 00084 $design->save(); 00085 00086 Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Design change saved')); 00087 } catch (Exception $e){ 00088 Mage::getSingleton('adminhtml/session') 00089 ->addError($e->getMessage()) 00090 ->setDesignData($data); 00091 $this->_redirect('*/*/edit', array('id'=>$design->getId())); 00092 return; 00093 } 00094 } 00095 00096 $this->_redirect('*/*/'); 00097 }