Public Member Functions | |
getConfig () | |
getJsObjectName () | |
Protected Member Functions | |
_beforeToHtml () | |
_toHtml () | |
Protected Attributes | |
$_config = null |
Definition at line 34 of file Create.php.
_beforeToHtml | ( | ) | [protected] |
Before rendering html, but after trying to load cache
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 57 of file Create.php.
00058 { 00059 $this->setId('create_attribute_' . $this->getConfig()->getGroupId()) 00060 ->setOnClick($this->getJsObjectName() . '.create();') 00061 ->setType('button') 00062 ->setClass('add') 00063 ->setLabel(Mage::helper('adminhtml')->__('Create New Attribute')); 00064 00065 $this->getConfig() 00066 ->setUrl($this->getUrl( 00067 '*/catalog_product_attribute/new', 00068 array( 00069 'group' => $this->getConfig()->getGroupId(), 00070 'tab' => $this->getConfig()->getTabId(), 00071 'store' => $this->getConfig()->getStoreId(), 00072 'product' => $this->getConfig()->getProductId(), 00073 'set' => $this->getConfig()->getAttributeSetId(), 00074 'type' => $this->getConfig()->getTypeId(), 00075 'popup' => 1 00076 ) 00077 )); 00078 00079 return parent::_beforeToHtml(); 00080 }
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Button.
Definition at line 82 of file Create.php.
00083 { 00084 $html = parent::_toHtml(); 00085 $html .= Mage::helper('adminhtml/js')->getScript( 00086 "var {$this->getJsObjectName()} = new Product.Attributes('{$this->getId()}');\n" 00087 . "{$this->getJsObjectName()}.setConfig(" . Zend_Json::encode($this->getConfig()->getData()) . ");\n" 00088 ); 00089 00090 return $html; 00091 }
getConfig | ( | ) |
Retrive config of new attribute creation
Definition at line 48 of file Create.php.
00049 { 00050 if (is_null($this->_config)) { 00051 $this->_config = new Varien_Object(); 00052 } 00053 00054 return $this->_config; 00055 }
getJsObjectName | ( | ) |
$_config = null [protected] |
Definition at line 41 of file Create.php.