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