示例#1
0
 /**
  * Set Web API user to child form block.
  *
  * @return Mage_Webapi_Block_Adminhtml_User_Edit
  */
 protected function _beforeToHtml()
 {
     /** @var $formBlock Mage_Webapi_Block_Adminhtml_User_Edit_Form */
     $formBlock = $this->getChildBlock('form');
     $formBlock->setApiUser($this->getApiUser());
     return parent::_beforeToHtml();
 }
示例#2
0
文件: Edit.php 项目: nemphys/magento2
 /**
  * Internal constructor
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_objectId = 'export_id';
     $this->_blockGroup = 'Mage_ImportExport';
     $this->_controller = 'adminhtml_export';
 }
示例#3
0
 /**
  * Prepare layout
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _prepareLayout()
 {
     $this->_blockGroup = 'Mage_Theme';
     $this->_controller = 'Adminhtml_System_Design_Theme';
     $this->setId('theme_edit');
     /** @var $theme Mage_Core_Model_Theme */
     $theme = Mage::registry('current_theme');
     if ($theme) {
         if ($theme->isEditable()) {
             $this->_addButton('save_and_continue', array('label' => $this->__('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 1);
         } else {
             $this->_removeButton('save');
             $this->_removeButton('reset');
         }
         if ($theme->isDeletable()) {
             if ($theme->hasChildThemes()) {
                 $message = join(' ', array($this->__('Theme contains child themes. Their parent will be modified.'), $this->__('Are you sure you want to do this?')));
                 $onClick = sprintf("deleteConfirm('%s', '%s')", $message, $this->getUrl('*/*/delete', array('id' => $theme->getId())));
                 $this->_updateButton('delete', 'onclick', $onClick);
             }
         } else {
             $this->_removeButton('delete');
         }
     }
     return parent::_prepareLayout();
 }
示例#4
0
 /**
  * Internal Constructor.
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_formScripts[] = "function saveAndContinueEdit(url)" . "{var tagForm = new varienForm('edit_form'); tagForm.submit(url);}";
     $this->_addButton('save_and_continue', array('label' => $this->__('Save and Continue Edit'), 'onclick' => "saveAndContinueEdit('" . $this->getSaveAndContinueUrl() . "')", 'class' => 'save'), 100);
     $this->_updateButton('save', 'label', $this->__('Save API Role'));
     $this->_updateButton('delete', 'label', $this->__('Delete API Role'));
 }
示例#5
0
 /**
  * Internal constructor
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->removeButton('back')->removeButton('reset')->removeButton('save');
     $this->_objectId = 'export_id';
     $this->_blockGroup = 'Mage_ImportExport';
     $this->_controller = 'adminhtml_export';
 }
示例#6
0
文件: Edit.php 项目: nemphys/magento2
 public function __construct()
 {
     $this->_objectId = 'user_id';
     $this->_controller = 'user';
     $this->_blockGroup = 'Mage_User';
     parent::__construct();
     $this->_updateButton('save', 'label', Mage::helper('Mage_User_Helper_Data')->__('Save User'));
     $this->_updateButton('delete', 'label', Mage::helper('Mage_User_Helper_Data')->__('Delete User'));
 }
示例#7
0
 /**
  * Prepare layout
  *
  * @return Mage_Core_Block_Abstract
  */
 protected function _prepareLayout()
 {
     $this->_blockGroup = 'Mage_Theme';
     $this->_controller = 'Adminhtml_System_Design_Theme';
     $this->setId('theme_edit');
     /** @var $theme Mage_Core_Model_Theme */
     $theme = Mage::registry('current_theme');
     if ($theme && !$theme->isVirtual()) {
         $this->_removeButton('delete');
         $this->_removeButton('save');
         $this->_removeButton('reset');
     } else {
         $this->_addButton('save_and_continue', array('label' => $this->__('Save and Continue Edit'), 'data_attr' => array('widget-button' => array('event' => 'saveAndContinueEdit', 'related' => '#edit_form')), 'class' => 'save'), 1);
         if ($theme->hasChildThemes()) {
             $onClick = 'deleteConfirm(\'' . $this->__('Theme contains child themes. Their parent will be modified.') . ' ' . $this->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array('id' => $theme->getId())) . '\')';
             $this->_updateButton('delete', 'onclick', $onClick);
         }
     }
     return parent::_prepareLayout();
 }