Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create:

Mage_Adminhtml_Block_Widget_Button Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getConfig ()
 getJsObjectName ()

Protected Member Functions

 _beforeToHtml ()
 _toHtml ()

Protected Attributes

 $_config = null


Detailed Description

Definition at line 34 of file Create.php.


Member Function Documentation

_beforeToHtml (  )  [protected]

Before rendering html, but after trying to load cache

Returns:
Mage_Core_Block_Abstract

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

Returns:
string

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

Returns:
Varien_Object

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 (  ) 

Definition at line 93 of file Create.php.

00094     {
00095         return $this->getId() . 'JsObject';
00096     }


Member Data Documentation

$_config = null [protected]

Definition at line 41 of file Create.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:44 2009 for Magento by  doxygen 1.5.8