00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 class Mage_Adminhtml_Block_Api_Editroles extends Mage_Adminhtml_Block_Widget_Tabs {
00028 public function __construct()
00029 {
00030 parent::__construct();
00031 $this->setId('role_info_tabs');
00032 $this->setDestElementId('role_edit_form');
00033 $this->setTitle(Mage::helper('adminhtml')->__('Role Information'));
00034 }
00035
00036 protected function _beforeToHtml()
00037 {
00038 $roleId = $this->getRequest()->getParam('rid', false);
00039 $role = Mage::getModel("api/roles")
00040 ->load($roleId);
00041
00042 $this->addTab('info', array(
00043 'label' => Mage::helper('adminhtml')->__('Role Info'),
00044 'title' => Mage::helper('adminhtml')->__('Role Info'),
00045 'content' => $this->getLayout()->createBlock('adminhtml/api_tab_roleinfo')->setRole($role)->toHtml(),
00046 'active' => true
00047 ));
00048
00049 $this->addTab('account', array(
00050 'label' => Mage::helper('adminhtml')->__('Role Resources'),
00051 'title' => Mage::helper('adminhtml')->__('Role Resources'),
00052 'content' => $this->getLayout()->createBlock('adminhtml/api_tab_rolesedit')->toHtml(),
00053 ));
00054
00055 if( intval($roleId) > 0 ) {
00056 $this->addTab('roles', array(
00057 'label' => Mage::helper('adminhtml')->__('Role Users'),
00058 'title' => Mage::helper('adminhtml')->__('Role Users'),
00059 'content' => $this->getLayout()->createBlock('adminhtml/api_tab_rolesusers', 'role.users.grid')->toHtml(),
00060 ));
00061 }
00062 return parent::_beforeToHtml();
00063 }
00064 }