Mage_Adminhtml_Block_Widget_Container Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Container:

Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_Adminhtml_Block_Catalog_Product Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Wizard Mage_Adminhtml_Block_Urlrewrite_Edit Mage_Adminhtml_Block_Widget_Form_Container Mage_Adminhtml_Block_Widget_Grid_Container Mage_Adminhtml_Block_Widget_View_Container Mage_Adminhtml_Block_Api_User_Edit Mage_Adminhtml_Block_Catalog_Category_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_Create 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 Mage_GoogleBase_Block_Adminhtml_Types_Edit Mage_Adminhtml_Block_Api_Role Mage_Adminhtml_Block_Api_User Mage_Adminhtml_Block_Catalog_Product_Attribute Mage_Adminhtml_Block_Catalog_Search Mage_Adminhtml_Block_Checkout_Agreement Mage_Adminhtml_Block_Cms_Block Mage_Adminhtml_Block_Cms_Page Mage_Adminhtml_Block_Customer Mage_Adminhtml_Block_Extensions_Local Mage_Adminhtml_Block_Extensions_Remote Mage_Adminhtml_Block_Notification_Inbox Mage_Adminhtml_Block_Permissions_Role Mage_Adminhtml_Block_Permissions_User Mage_Adminhtml_Block_Poll_Poll Mage_Adminhtml_Block_Promo_Catalog Mage_Adminhtml_Block_Promo_Quote Mage_Adminhtml_Block_Rating_Rating Mage_Adminhtml_Block_Report_Customer_Accounts Mage_Adminhtml_Block_Report_Customer_Orders Mage_Adminhtml_Block_Report_Customer_Totals Mage_Adminhtml_Block_Report_Product Mage_Adminhtml_Block_Report_Product_Downloads Mage_Adminhtml_Block_Report_Product_Lowstock Mage_Adminhtml_Block_Report_Product_Ordered Mage_Adminhtml_Block_Report_Product_Sold Mage_Adminhtml_Block_Report_Product_Viewed Mage_Adminhtml_Block_Report_Review_Customer Mage_Adminhtml_Block_Report_Review_Detail Mage_Adminhtml_Block_Report_Review_Product Mage_Adminhtml_Block_Report_Sales_Coupons Mage_Adminhtml_Block_Report_Sales_Invoiced Mage_Adminhtml_Block_Report_Sales_Refunded Mage_Adminhtml_Block_Report_Sales_Sales Mage_Adminhtml_Block_Report_Sales_Shipping Mage_Adminhtml_Block_Report_Sales_Tax Mage_Adminhtml_Block_Report_Search Mage_Adminhtml_Block_Report_Shopcart_Abandoned Mage_Adminhtml_Block_Report_Shopcart_Customer Mage_Adminhtml_Block_Report_Shopcart_Product Mage_Adminhtml_Block_Report_Tag_Customer Mage_Adminhtml_Block_Report_Tag_Customer_Detail Mage_Adminhtml_Block_Report_Tag_Popular Mage_Adminhtml_Block_Report_Tag_Popular_Detail Mage_Adminhtml_Block_Report_Tag_Product Mage_Adminhtml_Block_Report_Tag_Product_Detail Mage_Adminhtml_Block_Review_Main Mage_Adminhtml_Block_Sales_Creditmemo Mage_Adminhtml_Block_Sales_Invoice Mage_Adminhtml_Block_Sales_Order Mage_Adminhtml_Block_Sales_Shipment Mage_Adminhtml_Block_Sitemap Mage_Adminhtml_Block_System_Convert_Gui Mage_Adminhtml_Block_System_Convert_Profile Mage_Adminhtml_Block_System_Store_Store Mage_Adminhtml_Block_Tag_Customer Mage_Adminhtml_Block_Tag_Product Mage_Adminhtml_Block_Tag_Tag Mage_Adminhtml_Block_Tax_Class Mage_Adminhtml_Block_Tax_Rule Mage_Adminhtml_Block_Urlrewrite Mage_GoogleBase_Block_Adminhtml_Items Mage_GoogleBase_Block_Adminhtml_Types

List of all members.

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'


Detailed Description

Definition at line 34 of file Container.php.


Member Function Documentation

_addButton ( id,
data,
level = 0,
sortOrder = 100,
area = 'header' 
) [protected]

Add a button

Parameters:
string $id
array $data
integer $level
string|null $placement area, that button should be displayed in ('header', 'footer', null)
Returns:
Mage_Adminhtml_Block_Widget_Container

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]

_removeButton ( id  )  [protected]

Remove existing button

Parameters:
string $id
Returns:
Mage_Adminhtml_Block_Widget_Container

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

Returns:
string

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

Parameters:
string $id
string|null $key
mixed $data
Returns:
Mage_Adminhtml_Block_Widget_Container

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

Parameters:
string $area
Returns:
string

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

Returns:
string

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.

00186     {
00187         return 'head-' . strtr($this->_controller, '_', '-');
00188     }

getHeaderHtml (  ) 

Get header HTML

Returns:
string

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

Returns:
string

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.

00176     {
00177         return $this->_headerText;
00178     }

hasFooterButtons (  ) 

Check if there's anything to display in footer

Returns:
boolean

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

Parameters:
string $id
Returns:
Mage_Adminhtml_Block_Widget_Container

Definition at line 104 of file Container.php.

00105     {
00106         return $this->_removeButton($id);
00107     }


Member Data Documentation

$_buttons [protected]

Initial value:

 array(
        -1  => array(),
        0   => array(),
        1   => array(),
    )

Definition at line 50 of file Container.php.

$_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.


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

Generated on Sat Jul 4 17:23:06 2009 for Magento by  doxygen 1.5.8