/** * Before to HTML. * * @return Mage_Core_Block_Abstract */ protected function _beforeToHtml() { /** @var Mage_Webapi_Block_Adminhtml_User_Edit_Tab_Main $mainTab */ $mainTab = $this->getLayout()->getBlock('webapi.user.edit.tab.main'); $mainTab->setApiUser($this->getApiUser()); $this->addTab('main_section', array('label' => $this->__('User Info'), 'title' => $this->__('User Info'), 'content' => $mainTab->toHtml(), 'active' => true)); $rolesGrid = $this->getLayout()->getBlock('webapi.user.edit.tab.roles.grid'); $this->addTab('roles_section', array('label' => $this->__('User Role'), 'title' => $this->__('User Role'), 'content' => $rolesGrid->toHtml())); return parent::_beforeToHtml(); }
/** * Prepare child blocks. * * @return Mage_Core_Block_Abstract */ protected function _beforeToHtml() { /** @var Mage_Webapi_Block_Adminhtml_Role_Edit_Tab_Main $mainBlock */ $mainBlock = $this->getLayout()->getBlock('webapi.role.edit.tab.main'); $mainBlock->setApiRole($this->getApiRole()); $this->addTab('main_section', array('label' => $this->__('Role Info'), 'title' => $this->__('Role Info'), 'content' => $mainBlock->toHtml(), 'active' => true)); /** @var Mage_Webapi_Block_Adminhtml_Role_Edit_Tab_Resource $resourceBlock */ $resourceBlock = $this->getLayout()->getBlock('webapi.role.edit.tab.resource'); $resourceBlock->setApiRole($this->getApiRole()); $this->addTab('resource_section', array('label' => $this->__('Resources'), 'title' => $this->__('Resources'), 'content' => $resourceBlock->toHtml())); if ($this->getApiRole() && $this->getApiRole()->getRoleId() > 0) { $usersGrid = $this->getLayout()->getBlock('webapi.role.edit.tab.users.grid'); $this->addTab('user_section', array('label' => $this->__('Users'), 'title' => $this->__('Users'), 'content' => $usersGrid->toHtml())); } return parent::_beforeToHtml(); }
protected function _beforeToHtml() { $this->addTab('main_section', array('label' => Mage::helper('Mage_User_Helper_Data')->__('User Info'), 'title' => Mage::helper('Mage_User_Helper_Data')->__('User Info'), 'content' => $this->getLayout()->createBlock('Mage_User_Block_User_Edit_Tab_Main')->toHtml(), 'active' => true)); $this->addTab('roles_section', array('label' => Mage::helper('Mage_User_Helper_Data')->__('User Role'), 'title' => Mage::helper('Mage_User_Helper_Data')->__('User Role'), 'content' => $this->getLayout()->createBlock('Mage_User_Block_User_Edit_Tab_Roles', 'user.roles.grid')->toHtml())); return parent::_beforeToHtml(); }