本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Form_Container::addButton方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Form_Container::addButton方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Form_Container::addButton怎么用?PHP Mage_Adminhtml_Block_Widget_Form_Container::addButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Widget_Form_Container
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Widget_Form_Container::addButton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->_objectId = 'stickers_id';
$this->_blockGroup = 'stickers';
$this->_controller = 'adminhtml_stickers';
parent::__construct();
$url = 'stickers';
parent::addButton('back', array('label' => Mage::helper('adminhtml')->__('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl("*/*/" . $url . "/") . '\')', 'class' => 'back'), -1);
if ($this->_isAllowedAction('save')) {
$this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Save'));
$this->_addButton('saveandcontinue', array('label' => Mage::helper('adminhtml')->__('Save And Continue Edit'), 'onclick' => 'saveAndContinueEdit()', 'class' => 'save'), -100);
} else {
$this->_removeButton('save');
}
if ($this->_isAllowedAction('delete')) {
$this->_updateButton('delete', 'label', Mage::helper('adminhtml')->__('Delete'));
} else {
$this->_removeButton('delete');
}
$this->_formScripts[] = "\n function toggleEditor() {\n if (tinyMCE.getInstanceById('content') == null) {\n tinyMCE.execCommand('mceAddControl', false, 'content');\n } else {\n tinyMCE.execCommand('mceRemoveControl', false, 'content');\n }\n }\n\n function saveAndContinueEdit(){\n editForm.submit(\$('edit_form').action+'back/edit/');\n }\n ";
}