Public Member Functions | |
__construct () | |
getCategory () | |
_prepareLayout () | |
Protected Member Functions | |
_getAdditionalElementTypes () | |
_getParentCategoryOptions ($node=null, &$options=array()) | |
Protected Attributes | |
$_category |
Definition at line 34 of file General.php.
__construct | ( | ) |
Class constructor
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 39 of file General.php.
00040 { 00041 parent::__construct(); 00042 $this->setShowGlobalIcon(true); 00043 }
_getAdditionalElementTypes | ( | ) | [protected] |
Retrieve predefined additional element types
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 114 of file General.php.
00115 { 00116 return array( 00117 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_category_helper_image') 00118 ); 00119 }
_getParentCategoryOptions | ( | $ | node = null , |
|
&$ | options = array() | |||
) | [protected] |
Definition at line 121 of file General.php.
00122 { 00123 if (is_null($node)) { 00124 $node = $this->getRoot(); 00125 } 00126 00127 if ($node) { 00128 $options[] = array( 00129 'value' => $node->getPathId(), 00130 'label' => str_repeat(' ', max(0, 3*($node->getLevel()))) . $this->htmlEscape($node->getName()), 00131 ); 00132 00133 foreach ($node->getChildren() as $child) { 00134 $this->_getParentCategoryOptions($child, $options); 00135 } 00136 } 00137 return $options; 00138 }
_prepareLayout | ( | ) |
Prepare block children and data
Reimplemented from Mage_Adminhtml_Block_Catalog_Form.
Definition at line 53 of file General.php.
00054 { 00055 parent::_prepareLayout(); 00056 $form = new Varien_Data_Form(); 00057 $form->setHtmlIdPrefix('_general'); 00058 $form->setDataObject($this->getCategory()); 00059 00060 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('catalog')->__('General Information'))); 00061 00062 if (!$this->getCategory()->getId()) { 00063 // $fieldset->addField('path', 'select', array( 00064 // 'name' => 'path', 00065 // 'label' => Mage::helper('catalog')->__('Parent Category'), 00066 // 'value' => base64_decode($this->getRequest()->getParam('parent')), 00067 // 'values'=> $this->_getParentCategoryOptions(), 00068 // //'required' => true, 00069 // //'class' => 'required-entry' 00070 // ), 00071 // 'name' 00072 // ); 00073 if ($this->getRequest()->getParam('parent')) { 00074 $fieldset->addField('path', 'hidden', array( 00075 'name' => 'path', 00076 'value' => $this->getRequest()->getParam('parent') 00077 )); 00078 } else { 00079 $storeId = (int) $this->getRequest()->getParam('store'); 00080 $fieldset->addField('path', 'hidden', array( 00081 'name' => 'path', 00082 'value' => 1 00083 )); 00084 } 00085 } else { 00086 $fieldset->addField('id', 'hidden', array( 00087 'name' => 'id', 00088 'value' => $this->getCategory()->getId() 00089 )); 00090 $fieldset->addField('path', 'hidden', array( 00091 'name' => 'path', 00092 'value' => $this->getCategory()->getPath() 00093 )); 00094 } 00095 00096 $this->_setFieldset($this->getCategory()->getAttributes(true), $fieldset); 00097 00098 if ($this->getCategory()->getId()) { 00099 if ($this->getCategory()->getLevel() == 1) { 00100 $fieldset->removeField('url_key'); 00101 $fieldset->addField('url_key', 'hidden', array( 00102 'name' => 'url_key', 00103 'value' => $this->getCategory()->getUrlKey() 00104 )); 00105 } 00106 } 00107 00108 $form->addValues($this->getCategory()->getData()); 00109 00110 $form->setFieldNameSuffix('general'); 00111 $this->setForm($form); 00112 }
getCategory | ( | ) |
Definition at line 45 of file General.php.
00046 { 00047 if (!$this->_category) { 00048 $this->_category = Mage::registry('category'); 00049 } 00050 return $this->_category; 00051 }
$_category [protected] |
Definition at line 37 of file General.php.