Public Member Functions | |
removeButton ($id) | |
getButtonsHtml ($area=null) | |
getHeaderText () | |
getHeaderCssClass () | |
getHeaderHtml () | |
hasFooterButtons () | |
Protected Member Functions | |
_addButton ($id, $data, $level=0, $sortOrder=100, $area= 'header') | |
_removeButton ($id) | |
_updateButton ($id, $key=null, $data) | |
_prepareLayout () | |
_toHtml () | |
Protected Attributes | |
$_controller = 'empty' | |
$_buttons | |
$_headerText = 'Container Widget Header' |
Definition at line 34 of file Container.php.
_addButton | ( | $ | id, | |
$ | data, | |||
$ | level = 0 , |
|||
$ | sortOrder = 100 , |
|||
$ | area = 'header' | |||
) | [protected] |
Add a button
string | $id | |
array | $data | |
integer | $level | |
string|null | $placement area, that button should be displayed in ('header', 'footer', null) |
Definition at line 72 of file Container.php.
00073 { 00074 if (!isset($this->_buttons[$level])) { 00075 $this->_buttons[$level] = array(); 00076 } 00077 $this->_buttons[$level][$id] = $data; 00078 $this->_buttons[$level][$id]['area'] = $area; 00079 return $this; 00080 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Edit, Mage_Adminhtml_Block_Catalog_Product, Mage_Adminhtml_Block_Customer_Edit, Mage_Adminhtml_Block_Notification_Inbox, Mage_Adminhtml_Block_Report_Product_Downloads, Mage_Adminhtml_Block_Report_Product_Lowstock, Mage_Adminhtml_Block_Report_Shopcart_Abandoned, Mage_Adminhtml_Block_Report_Tag_Popular, Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard, Mage_Adminhtml_Block_System_Store_Store, Mage_Adminhtml_Block_Urlrewrite_Edit, Mage_Adminhtml_Block_Widget_Form_Container, Mage_Adminhtml_Block_Widget_Grid_Container, Mage_Adminhtml_Block_Widget_View_Container, and Mage_GoogleBase_Block_Adminhtml_Items.
Definition at line 140 of file Container.php.
00141 { 00142 foreach ($this->_buttons as $level => $buttons) { 00143 foreach ($buttons as $id => $data) { 00144 $this->setChild($id . '_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data)); 00145 } 00146 } 00147 return parent::_prepareLayout(); 00148 }
_removeButton | ( | $ | id | ) | [protected] |
Remove existing button
string | $id |
Definition at line 88 of file Container.php.
00089 { 00090 foreach ($this->_buttons as $level => $buttons) { 00091 if (isset($buttons[$id])) { 00092 unset($this->_buttons[$level][$id]); 00093 } 00094 } 00095 return $this; 00096 }
_toHtml | ( | ) | [protected] |
Prepare html output
Reimplemented from Mage_Core_Block_Template.
Definition at line 222 of file Container.php.
00223 { 00224 Mage::dispatchEvent('adminhtml_widget_container_html_before', array('block' => $this)); 00225 return parent::_toHtml(); 00226 }
_updateButton | ( | $ | id, | |
$ | key = null , |
|||
$ | data | |||
) | [protected] |
Update specified button property
string | $id | |
string|null | $key | |
mixed | $data |
Definition at line 117 of file Container.php.
00118 { 00119 foreach ($this->_buttons as $level => $buttons) { 00120 if (isset($buttons[$id])) { 00121 if (!empty($key)) { 00122 if ($child = $this->getChild($id . '_button')) { 00123 $child->setData($key, $data); 00124 } 00125 if ('level' == $key) { 00126 $this->_buttons[$data][$id] = $this->_buttons[$level][$id]; 00127 unset($this->_buttons[$level][$id]); 00128 } else { 00129 $this->_buttons[$level][$id][$key] = $data; 00130 } 00131 } else { 00132 $this->_buttons[$level][$id] = $data; 00133 } 00134 break; 00135 } 00136 } 00137 return $this; 00138 }
getButtonsHtml | ( | $ | area = null |
) |
Produce buttons HTML
string | $area |
Reimplemented in Mage_Adminhtml_Block_Urlrewrite_Edit.
Definition at line 156 of file Container.php.
00157 { 00158 $out = ''; 00159 foreach ($this->_buttons as $level => $buttons) { 00160 foreach ($buttons as $id => $data) { 00161 if ($area && isset($data['area']) && ($area != $data['area'])) { 00162 continue; 00163 } 00164 $out .= $this->getChildHtml($id . '_button'); 00165 } 00166 } 00167 return $out; 00168 }
getHeaderCssClass | ( | ) |
Get header CSS class
Reimplemented in Mage_Adminhtml_Block_Customer_Group_Edit, Mage_Adminhtml_Block_Tag_Tag, Mage_Adminhtml_Block_Widget_Form_Container, Mage_Adminhtml_Block_Widget_Grid_Container, and Mage_GoogleBase_Block_Adminhtml_Types_Edit.
Definition at line 185 of file Container.php.
getHeaderHtml | ( | ) |
Get header HTML
Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create, and Mage_Adminhtml_Block_Widget_Form_Container.
Definition at line 195 of file Container.php.
00196 { 00197 return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>'; 00198 }
getHeaderText | ( | ) |
Get header text
Reimplemented in Mage_Adminhtml_Block_Api_User_Edit, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit, Mage_Adminhtml_Block_Catalog_Search_Edit, Mage_Adminhtml_Block_Checkout_Agreement_Edit, Mage_Adminhtml_Block_Cms_Block_Edit, Mage_Adminhtml_Block_Cms_Page_Edit, Mage_Adminhtml_Block_Customer_Edit, Mage_Adminhtml_Block_Customer_Group_Edit, Mage_Adminhtml_Block_Extensions_Console_Edit, Mage_Adminhtml_Block_Extensions_Custom_Edit, Mage_Adminhtml_Block_Extensions_Local_Edit, Mage_Adminhtml_Block_Extensions_Remote_Edit, Mage_Adminhtml_Block_Permissions_User_Edit, Mage_Adminhtml_Block_Poll_Answer_Edit, Mage_Adminhtml_Block_Poll_Edit, Mage_Adminhtml_Block_Promo_Catalog_Edit, Mage_Adminhtml_Block_Promo_Quote_Edit, Mage_Adminhtml_Block_Rating_Edit, Mage_Adminhtml_Block_Review_Add, Mage_Adminhtml_Block_Review_Edit, Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create, Mage_Adminhtml_Block_Sales_Order_Creditmemo_View, Mage_Adminhtml_Block_Sales_Order_Invoice_Create, Mage_Adminhtml_Block_Sales_Order_Invoice_View, Mage_Adminhtml_Block_Sales_Order_Shipment_Create, Mage_Adminhtml_Block_Sales_Order_Shipment_View, Mage_Adminhtml_Block_Sales_Order_View, Mage_Adminhtml_Block_Sitemap_Edit, Mage_Adminhtml_Block_System_Account_Edit, Mage_Adminhtml_Block_System_Convert_Gui_Edit, Mage_Adminhtml_Block_System_Convert_Profile_Edit, Mage_Adminhtml_Block_System_Store_Delete, Mage_Adminhtml_Block_System_Store_Edit, Mage_Adminhtml_Block_Tag_Edit, Mage_Adminhtml_Block_Tag_Tag_Edit, Mage_Adminhtml_Block_Tax_Class_Edit, Mage_Adminhtml_Block_Tax_Rule_Edit, and Mage_GoogleBase_Block_Adminhtml_Types_Edit.
Definition at line 175 of file Container.php.
hasFooterButtons | ( | ) |
Check if there's anything to display in footer
Definition at line 205 of file Container.php.
00206 { 00207 foreach ($this->_buttons as $level => $buttons) { 00208 foreach ($buttons as $id => $data) { 00209 if (isset($data['area']) && ('footer' == $data['area'])) { 00210 return true; 00211 } 00212 } 00213 } 00214 return false; 00215 }
removeButton | ( | $ | id | ) |
Public wrapper for the _removeButton() method
string | $id |
Definition at line 104 of file Container.php.
00105 { 00106 return $this->_removeButton($id); 00107 }
$_buttons [protected] |
$_controller = 'empty' [protected] |
Reimplemented in Mage_Adminhtml_Block_Urlrewrite_Edit, and Mage_Adminhtml_Block_Urlrewrite.
Definition at line 42 of file Container.php.
$_headerText = 'Container Widget Header' [protected] |
Definition at line 61 of file Container.php.