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' |
Definition at line 35 of file Container.php.
__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 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
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 | ( | ) |
Get URL for back (reset) button
Reimplemented in 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, and Mage_Adminhtml_Block_Sales_Order_Shipment_View.
Definition at line 92 of file Container.php.
00093 { 00094 return $this->getUrl('*/*/'); 00095 }
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
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
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.
getHeaderHtml | ( | ) |
Get header HTML
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.
getSaveUrl | ( | ) |
Get form save URL
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
Varien_Object | $object |
Definition at line 170 of file Container.php.
00171 { 00172 $this->getChild('form')->setDataObject($object); 00173 return $this->setData('data_object', $object); 00174 }
$_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.