init
[Pman.Admin] / 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     });
23         
24 });
25
26
27 Pman.Tab.ContactsMgr = {
28     grid : false,
29     panel : false,
30     title : false, 
31     add : function(parentLayout, region) {
32         
33
34         if (this.panel) {
35             parentLayout.getRegion(region).showPanel(this.panel);
36             return;
37         }
38      
39         
40         this.layout = new Ext.BorderLayout(
41             parentLayout.getEl().createChild({tag:'div'}),
42             {
43                
44                 west : {
45                     autoScroll:true,
46                     hideTabs: true,
47                     titlebar: true,
48                     split:true,
49                     initialSize: 250
50                 },
51                 center: {
52                     autoScroll:true,
53                     hideTabs: false,
54                      tabPosition: 'top'
55                    
56                 }
57             }
58         );
59         
60         
61        
62         this.tab = parentLayout.add(region,  new Ext.NestedLayoutPanel(
63             this.layout, {title: this.title || "Contacts Manager", background : true}));
64         var _this = this;
65         this.tab.on('activate', function() {
66             if (_this.layout.getRegion('west').panels.length) {
67                 _this.layout.getRegion('west').showPanel(0);
68                 Pman.Tab.ContactGrps.refresh();
69             } else {
70                 Pman.Tab.Contacts.loadFirst();
71             }
72             _this.layout.getRegion('center').showPanel(0);
73             
74             
75             
76              
77             
78         });
79     },
80     donelayout : false //,
81     
82     //show: function (parentLayout, region)
83    // {
84      //   this.add(parentLayout, region);
85    //     
86
87     //} 
88 };