View.php
[Pman.Ftp] / Pman.Tab.FtpTab.js
1 //<script type="text/javascript">
2
3
4 /**
5 * Tab for clipping stuff - top lvl..
6 */
7
8  
9
10 Pman.on('beforeload', function()
11 {
12     if (!Pman.hasPerm('Ftp.Ftp', 'S') || Pman.Tab.FtpTab.disabled) {
13         return;
14     }
15     
16     
17     Pman.register({
18         modKey : '017-pman-tab-ftptab',
19         module : Pman.Tab.FtpTab,
20         region : 'center',
21         parent : Pman,
22         name : "Ftp Tab",
23         permname: 'Ftp.Ftp',
24         finalize : function() {
25             
26             var _this = Pman.Tab.FtpTab;
27             if (!_this.layout) {
28                 return;
29             }
30             
31             _this.layout.endUpdate(); 
32             //_p.refreshPager.defer(1000, _p);
33             
34         }
35     });
36     
37     
38      
39     
40 });
41  
42 Pman.Tab.FtpTab = {
43     
44     tab : false,
45     layout : false,
46     disabled : false,
47     add : function(parentLayout, region)
48     {
49         
50         if (!Pman.hasPerm('Ftp.Ftp', 'S')  || this.disabled) {
51             return;
52         }
53             
54         var _this = this;
55       
56         
57         this.layout = new Ext.BorderLayout(
58             parentLayout.getEl().createChild({tag:'div'}),
59             {
60                 west: {
61                     title: "Directories",
62                     split:true,
63                     initialSize: 220,
64                     titlebar: true,
65                     collapsible: true,
66                     autoScroll:false
67                 },
68                 
69                 center: {
70                     titlebar: false,
71                     autoScroll:false,
72                     closeOnTab: true,
73                     tabPosition: 'top',
74                     
75                     //resizeTabs: true,
76                     alwaysShowTabs: false,
77                     minTabWidth: 140
78                 }
79             }
80         );
81         
82             
83         
84         //throw 'done';
85         
86         this.tab = parentLayout.add(region,  new Ext.NestedLayoutPanel(
87             this.layout, { title: "Ftp"
88                 //, toolbar: mainTb 
89         }));
90         
91         this.tab.on('activate', function() {
92             _this.layout.getRegion('west').showPanel(0);
93             _this.layout.getRegion('center').showPanel(0);
94         });
95         this.layout.beginUpdate(); 
96       
97         //this.adminLayout.beginUpdate();
98     }
99      
100 };
101         
102