Mage_Adminhtml_Block_Widget_Form_Container Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Form_Container:

Mage_Adminhtml_Block_Widget_Container Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object 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

List of all members.

Public Member Functions

 __construct ()
 getBackUrl ()
 getDeleteUrl ()
 getSaveUrl ()
 getFormActionUrl ()
 getFormHtml ()
 getFormInitScripts ()
 getFormScripts ()
 getHeaderWidth ()
 getHeaderCssClass ()
 getHeaderHtml ()
 setDataObject ($object)

Protected Member Functions

 _prepareLayout ()

Protected Attributes

 $_objectId = 'id'
 $_formScripts = array()
 $_formInitScripts = array()
 $_mode = 'edit'
 $_blockGroup = 'adminhtml'


Detailed Description

Definition at line 35 of file Container.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Reimplemented in 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, and Mage_GoogleBase_Block_Adminhtml_Types_Edit.

Definition at line 43 of file Container.php.

00044     {
00045         parent::__construct();
00046 
00047         if (!$this->hasData('template')) {
00048             $this->setTemplate('widget/form/container.phtml');
00049         }
00050 
00051         $this->_addButton('back', array(
00052             'label'     => Mage::helper('adminhtml')->__('Back'),
00053             'onclick'   => 'setLocation(\'' . $this->getBackUrl() . '\')',
00054             'class'     => 'back',
00055         ), -1);
00056         $this->_addButton('reset', array(
00057             'label'     => Mage::helper('adminhtml')->__('Reset'),
00058             'onclick'   => 'setLocation(window.location.href)',
00059         ), -1);
00060 
00061         $objId = $this->getRequest()->getParam($this->_objectId);
00062 
00063         if (! empty($objId)) {
00064             $this->_addButton('delete', array(
00065                 'label'     => Mage::helper('adminhtml')->__('Delete'),
00066                 'class'     => 'delete',
00067                 'onclick'   => 'deleteConfirm(\''. Mage::helper('adminhtml')->__('Are you sure you want to do this?')
00068                     .'\', \'' . $this->getDeleteUrl() . '\')',
00069             ));
00070         }
00071 
00072         $this->_addButton('save', array(
00073             'label'     => Mage::helper('adminhtml')->__('Save'),
00074             'onclick'   => 'editForm.submit();',
00075             'class'     => 'save',
00076         ), 1);
00077     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Edit, and Mage_Adminhtml_Block_Customer_Edit.

Definition at line 79 of file Container.php.

00080     {
00081         if ($this->_blockGroup && $this->_controller && $this->_mode) {
00082             $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup . '/' . $this->_controller . '_' . $this->_mode . '_form'));
00083         }
00084         return parent::_prepareLayout();
00085     }

getBackUrl (  ) 

getDeleteUrl (  ) 

Definition at line 97 of file Container.php.

00098     {
00099         return $this->getUrl('*/*/delete', array($this->_objectId => $this->getRequest()->getParam($this->_objectId)));
00100     }

getFormActionUrl (  ) 

Get form action URL

Returns:
string

Definition at line 119 of file Container.php.

00120     {
00121         if ($this->hasFormActionUrl()) {
00122             return $this->getData('form_action_url');
00123         }
00124         return $this->getUrl('*/' . $this->_controller . '/save');
00125     }

getFormHtml (  ) 

Definition at line 127 of file Container.php.

00128     {
00129         $this->getChild('form')->setData('action', $this->getSaveUrl());
00130         return $this->getChildHtml('form');
00131     }

getFormInitScripts (  ) 

Definition at line 133 of file Container.php.

00134     {
00135         if ( !empty($this->_formInitScripts) && is_array($this->_formInitScripts) ) {
00136             return '<script type="text/javascript">' . implode("\n", $this->_formInitScripts) . '</script>';
00137         }
00138         return '';
00139     }

getFormScripts (  ) 

Definition at line 141 of file Container.php.

00142     {
00143         if ( !empty($this->_formScripts) && is_array($this->_formScripts) ) {
00144             return '<script type="text/javascript">' . implode("\n", $this->_formScripts) . '</script>';
00145         }
00146         return '';
00147     }

getHeaderCssClass (  ) 

Get header CSS class

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Reimplemented in Mage_Adminhtml_Block_Customer_Group_Edit, and Mage_GoogleBase_Block_Adminhtml_Types_Edit.

Definition at line 154 of file Container.php.

00155     {
00156         return 'icon-head head-' . strtr($this->_controller, '_', '-');
00157     }

getHeaderHtml (  ) 

Get header HTML

Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Container.

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create.

Definition at line 159 of file Container.php.

00160     {
00161         return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->getHeaderText() . '</h3>';
00162     }

getHeaderWidth (  ) 

Reimplemented in Mage_Adminhtml_Block_Sales_Order_Create.

Definition at line 149 of file Container.php.

00150     {
00151         return '';
00152     }

getSaveUrl (  ) 

Get form save URL

Deprecated:
See also:
getFormActionUrl()
Returns:
string

Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit.

Definition at line 109 of file Container.php.

00110     {
00111         return $this->getFormActionUrl();
00112     }

setDataObject ( object  ) 

Set data object and pass it to form

Parameters:
Varien_Object $object
Returns:
Mage_Adminhtml_Block_Widget_Form_Container

Definition at line 170 of file Container.php.

00171     {
00172         $this->getChild('form')->setDataObject($object);
00173         return $this->setData('data_object', $object);
00174     }


Member Data Documentation

$_blockGroup = 'adminhtml' [protected]

Definition at line 41 of file Container.php.

$_formInitScripts = array() [protected]

Definition at line 39 of file Container.php.

$_formScripts = array() [protected]

Definition at line 38 of file Container.php.

$_mode = 'edit' [protected]

Definition at line 40 of file Container.php.

$_objectId = 'id' [protected]

Definition at line 37 of file Container.php.


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

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