protected function _prepareLayout() { $this->setChild('tabs', $this->getLayout()->createBlock('adminhtml/catalog_category_tabs', 'tabs')); $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Save Category'), 'onclick' => "categorySubmit('" . $this->getSaveUrl() . "',true)", 'class' => 'save'))); $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Delete Category'), 'onclick' => "categoryDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "',true)", 'class' => 'delete'))); $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Reset'), 'onclick' => "categoryReset('" . $this->getUrl('*/*/edit', array('_current' => true)) . "',true)"))); return parent::_prepareLayout(); }
protected function _prepareLayout() { $addUrl = $this->getUrl("*/*/add", array('_current' => true, 'id' => null, '_query' => false)); $this->setChild('add_sub_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Subcategory'), 'onclick' => "addNew('" . $addUrl . "', false)", 'class' => 'add'))); $this->setChild('add_root_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Root Category'), 'onclick' => "addNew('" . $addUrl . "', true)", 'class' => 'add', 'id' => 'add_root_category_button'))); $this->setChild('store_switcher', $this->getLayout()->createBlock('adminhtml/store_switcher')->setSwitchUrl($this->getUrl('*/*/*', array('_current' => true, '_query' => false, 'store' => null)))->setTemplate('store/switcher/enhanced.phtml')); return parent::_prepareLayout(); }
protected function _prepareLayout() { $addMenuUrl = $this->getUrl("*/*/add", array('_current' => true, 'menu_id' => null, '_query' => false)); $this->setChild('add_menu_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('menu')->__('Add Menu'), 'onclick' => "addNew('" . $addMenuUrl . "', false)", 'class' => 'add', 'id' => 'add_menu_button'))); $addItemUrl = $this->getUrl("*/adminhtml_item/add", array('_current' => true, 'id' => null, '_query' => false)); $this->setChild('add_item_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('menu')->__('Add Item'), 'onclick' => "addNew('" . $addItemUrl . "', false)", 'class' => 'add', 'id' => 'add_item_button'))); $this->setChild('menu_switcher', $this->getLayout()->createBlock('menu/adminhtml_menu_switcher')->setSwitchUrl($this->getUrl('*/*/*', array('_current' => true, '_query' => false, 'store' => null)))->setTemplate('glace/menu/switcher.phtml')); return parent::_prepareLayout(); }
protected function _prepareLayout() { $addUrl = $this->getUrl("*/*/add", array('_current' => true, 'id' => null, '_query' => false)); $this->addChild('add_sub_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Subcategory'), 'onclick' => "addNew('" . $addUrl . "', false)", 'class' => 'add', 'id' => 'add_subcategory_button', 'style' => $this->canAddSubCategory() ? '' : 'display: none;')); if ($this->canAddRootCategory()) { $this->addChild('add_root_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Root Category'), 'onclick' => "addNew('" . $addUrl . "', true)", 'class' => 'add', 'id' => 'add_root_category_button')); } $this->setChild('store_switcher', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Store_Switcher')->setSwitchUrl($this->getUrl('*/*/*', array('_current' => true, '_query' => false, 'store' => null)))->setTemplate('store/switcher/enhanced.phtml')); return parent::_prepareLayout(); }
protected function _prepareLayout() { $this->setChild('tabs', $this->getLayout()->createBlock('adminhtml/catalog_category_tabs', 'tabs')); if (!$this->getCategory()->isReadonly()) { $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Save Category'), 'onclick' => "categorySubmit('" . $this->getSaveUrl() . "',true)", 'class' => 'save'))); } if (!in_array($this->getCategory()->getId(), $this->getRootIds()) && $this->getCategory()->isDeleteable()) { $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Delete Category'), 'onclick' => "categoryDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "',true)", 'class' => 'delete'))); } if (!$this->getCategory()->isReadonly()) { $resetPath = $this->getCategory()->getId() ? '*/*/edit' : '*/*/add'; $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Reset'), 'onclick' => "categoryReset('" . $this->getUrl($resetPath, array('_current' => true)) . "',true)"))); } return parent::_prepareLayout(); }
protected function _prepareLayout() { $category = $this->getCategory(); $categoryId = (int) $category->getId(); // 0 when we create category, otherwise some value for editing category $this->setChild('tabs', $this->getLayout()->createBlock('adminhtml/catalog_category_tabs', 'tabs')); // Save button if (!$category->isReadonly()) { $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Save Category'), 'onclick' => "categorySubmit('" . $this->getSaveUrl() . "', true)", 'class' => 'save'))); } // Delete button if (!in_array($categoryId, $this->getRootIds()) && $category->isDeleteable()) { $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Delete Category'), 'onclick' => "categoryDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "', true, {$categoryId})", 'class' => 'delete'))); } // Reset button if (!$category->isReadonly()) { $resetPath = $categoryId ? '*/*/edit' : '*/*/add'; $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Reset'), 'onclick' => "categoryReset('" . $this->getUrl($resetPath, array('_current' => true)) . "',true)"))); } return parent::_prepareLayout(); }
/** * Prepare layout * * @return Enterprise_CatalogPermissions_Block_Adminhtml_Catalog_Category_Tab_Permissions */ protected function _prepareLayout() { $this->setChild('row', $this->getLayout()->createBlock('enterprise_catalogpermissions/adminhtml_catalog_category_tab_permissions_row')); $this->setChild('add_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('label' => $this->helper('enterprise_catalogpermissions')->__('New Permission'), 'class' => 'add' . ($this->isReadonly() ? ' disabled' : ''), 'type' => 'button', 'disabled' => $this->isReadonly()))); return parent::_prepareLayout(); }
protected function _prepareLayout() { $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('class' => 'delete' . ($this->isReadonly() ? ' disabled' : ''), 'disabled' => $this->isReadonly(), 'type' => 'button', 'id' => '{{html_id}}_delete_button'))); return parent::_prepareLayout(); }