sync
[Pman.Admin] / Pman.Tab.GroupMgr.js
1 //<script type="text/javascript">
2
3 // Groupmanager 
4 // left - list of groups.
5 // right - Permissions | Members..
6
7
8 Pman.on('beforeload', function()
9 {
10     
11   
12     if (!Pman.hasPerm('Core.Groups', 'E')) {
13         return;
14     }
15     Pman.register({
16         modKey : '060-pman-tab-groupmgr',
17         module : Pman.Tab.GroupMgr,
18         region : 'center',
19         parent : Pman.Tab.Admin,
20         name : "Groups and Permissions",
21         finalize : function() {
22             
23             var _this = Pman.Tab.GroupMgr;
24             if (!_this.layout) {
25                 return;
26             }
27             
28             _this.layout.endUpdate(); 
29             
30         }
31     });
32     
33         
34 });
35
36
37 Pman.Tab.GroupMgr = {
38     grid : false,
39     panel : false,
40     add : function(parentLayout, region) {
41         
42
43         if (this.panel) {
44             parentLayout.getRegion(region).showPanel(this.panel);
45             return;
46         }
47      
48         
49         this.layout = new Ext.BorderLayout(
50             parentLayout.getEl().createChild({tag:'div'}),
51             {
52                
53                 west : {
54                     autoScroll:true,
55                     hideTabs: true,
56                     titlebar: true,
57                     split:true,
58                     initialSize: 250
59                 },
60                 center: {
61                     autoScroll:true,
62                     hideTabs: false,
63                      tabPosition: 'top'
64                    
65                 }
66             }
67         );
68         
69         
70        
71         this.tab = parentLayout.add(region,  new Ext.NestedLayoutPanel(
72             this.layout, {title: "Permissions", background : true}));
73         var _this = this;
74         this.tab.on('activate', function() {
75             //console.log('groupmgr.activate');
76             //Pman.Tab.Group_Members.disableReload = true;
77             _this.layout.getRegion('center').showPanel(0);
78             Pman.Tab.Groups.refresh();
79             //Pman.Tab.Group_Members.disableReload = false;
80             
81             //Pman.Tab.Groups.grid.getDataSource().reload();
82             
83         });
84         this.layout.beginUpdate();
85     } 
86      
87 };