Public Member Functions | |
__construct () | |
getRootIds () | |
getStoreConfigurationUrl () | |
getDeleteButtonHtml () | |
getSaveButtonHtml () | |
getResetButtonHtml () | |
getAdditionalButtonsHtml () | |
addAdditionalButton ($alias, $config) | |
removeAdditionalButton ($alias) | |
getTabsHtml () | |
getHeader () | |
getDeleteUrl (array $args=array()) | |
getProductsJson () | |
isAjax () | |
Protected Member Functions | |
_prepareLayout () | |
Protected Attributes | |
$_additionalButtons = array() |
Definition at line 34 of file Form.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Mage_Adminhtml_Block_Catalog_Category_Abstract.
Definition at line 43 of file Form.php.
00044 { 00045 parent::__construct(); 00046 $this->setTemplate('catalog/category/edit/form.phtml'); 00047 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 49 of file Form.php.
00050 { 00051 $this->setChild('tabs', 00052 $this->getLayout()->createBlock('adminhtml/catalog_category_tabs', 'tabs') 00053 ); 00054 00055 if (!$this->getCategory()->isReadonly()) { 00056 $this->setChild('save_button', 00057 $this->getLayout()->createBlock('adminhtml/widget_button') 00058 ->setData(array( 00059 'label' => Mage::helper('catalog')->__('Save Category'), 00060 'onclick' => "categorySubmit('".$this->getSaveUrl()."',true)", 00061 'class' => 'save' 00062 )) 00063 ); 00064 } 00065 if (!in_array($this->getCategory()->getId(), $this->getRootIds()) && 00066 $this->getCategory()->isDeleteable()) { 00067 $this->setChild('delete_button', 00068 $this->getLayout()->createBlock('adminhtml/widget_button') 00069 ->setData(array( 00070 'label' => Mage::helper('catalog')->__('Delete Category'), 00071 'onclick' => "categoryDelete('".$this->getUrl('*/*/delete', array('_current'=>true))."',true)", 00072 'class' => 'delete' 00073 )) 00074 ); 00075 } 00076 00077 if (!$this->getCategory()->isReadonly()) { 00078 $this->setChild('reset_button', 00079 $this->getLayout()->createBlock('adminhtml/widget_button') 00080 ->setData(array( 00081 'label' => Mage::helper('catalog')->__('Reset'), 00082 'onclick' => "categoryReset('".$this->getUrl('*/*/edit', array('_current'=>true))."',true)" 00083 )) 00084 ); 00085 } 00086 00087 return parent::_prepareLayout(); 00088 }
addAdditionalButton | ( | $ | alias, | |
$ | config | |||
) |
Add additional button
string | $alias | |
array | $config |
Definition at line 163 of file Form.php.
00164 { 00165 $this->setChild($alias . '_button', 00166 $this->getLayout()->createBlock('adminhtml/widget_button')->addData($config)); 00167 $this->_additionalButtons[$alias] = $alias . '_button'; 00168 return $this; 00169 }
getAdditionalButtonsHtml | ( | ) |
Retrieve additional buttons html
Definition at line 147 of file Form.php.
00148 { 00149 $html = ''; 00150 foreach ($this->_additionalButtons as $childName) { 00151 $html .= $this->getChildHtml($childName); 00152 } 00153 return $html; 00154 }
getDeleteButtonHtml | ( | ) |
Definition at line 121 of file Form.php.
00122 { 00123 return $this->getChildHtml('delete_button'); 00124 }
getHeader | ( | ) |
Definition at line 192 of file Form.php.
00193 { 00194 if ($this->hasStoreRootCategory()) { 00195 return $this->getCategoryId() ? $this->getCategoryName() : Mage::helper('catalog')->__('New Category'); 00196 } 00197 return Mage::helper('catalog')->__('Set Root Category For Store'); 00198 }
getProductsJson | ( | ) |
Definition at line 207 of file Form.php.
00208 { 00209 $products = $this->getCategory()->getProductsPosition(); 00210 if (!empty($products)) { 00211 return Zend_Json::encode($products); 00212 } 00213 return '{}'; 00214 }
getResetButtonHtml | ( | ) |
Definition at line 134 of file Form.php.
00135 { 00136 if ($this->hasStoreRootCategory()) { 00137 return $this->getChildHtml('reset_button'); 00138 } 00139 return ''; 00140 }
getRootIds | ( | ) |
Return array of root categories ids
Definition at line 95 of file Form.php.
00096 { 00097 $ids = $this->getData('root_ids'); 00098 if (is_null($ids)) { 00099 $ids = array(); 00100 foreach (Mage::app()->getStores() as $store) { 00101 $ids[] = $store->getRootCategoryId(); 00102 } 00103 $this->setData('root_ids', $ids); 00104 } 00105 return $ids; 00106 }
getSaveButtonHtml | ( | ) |
Definition at line 126 of file Form.php.
00127 { 00128 if ($this->hasStoreRootCategory()) { 00129 return $this->getChildHtml('save_button'); 00130 } 00131 return ''; 00132 }
getStoreConfigurationUrl | ( | ) |
Definition at line 108 of file Form.php.
00109 { 00110 $storeId = (int) $this->getRequest()->getParam('store'); 00111 $params = array(); 00112 // $params = array('section'=>'catalog'); 00113 if ($storeId) { 00114 $store = Mage::app()->getStore($storeId); 00115 $params['website'] = $store->getWebsite()->getCode(); 00116 $params['store'] = $store->getCode(); 00117 } 00118 return $this->getUrl('*/system_store', $params); 00119 }
getTabsHtml | ( | ) |
isAjax | ( | ) |
removeAdditionalButton | ( | $ | alias | ) |
Remove additional button
string | $alias |
Definition at line 177 of file Form.php.
00178 { 00179 if (isset($this->_additionalButtons[$alias])) { 00180 $this->unsetChild($this->_additionalButtons[$alias]); 00181 unset($this->_additionalButtons[$alias]); 00182 } 00183 00184 return $this; 00185 }