1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: class Mage_Adminhtml_Block_Permissions_Editroles extends Mage_Adminhtml_Block_Widget_Tabs
28: {
29: public function __construct()
30: {
31: parent::__construct();
32: $this->setId('role_info_tabs');
33: $this->setDestElementId('role_edit_form');
34: $this->setTitle(Mage::helper('adminhtml')->__('Role Information'));
35: }
36:
37: protected function _prepareLayout()
38: {
39: $role = Mage::registry('current_role');
40:
41: $this->addTab('info', $this->getLayout()->createBlock('adminhtml/permissions_tab_roleinfo')->setRole($role)->setActive(true));
42: $this->addTab('account', $this->getLayout()->createBlock('adminhtml/permissions_tab_rolesedit', 'adminhtml.permissions.tab.rolesedit'));
43:
44: if ($role->getId()) {
45: $this->addTab('roles', array(
46: 'label' => Mage::helper('adminhtml')->__('Role Users'),
47: 'title' => Mage::helper('adminhtml')->__('Role Users'),
48: 'content' => $this->getLayout()->createBlock('adminhtml/permissions_tab_rolesusers', 'role.users.grid')->toHtml(),
49: ));
50: }
51:
52: return parent::_prepareLayout();
53: }
54: }
55: