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         finalize : function() {
24             
25             var _this = Pman.Tab.FtpTab;
26             if (!_this.layout) {
27                 return;
28             }
29             
30             _this.layout.endUpdate(); 
31             //_p.refreshPager.defer(1000, _p);
32             
33         }
34     });
35     
36     
37      
38     
39 });
40  
41 Pman.Tab.FtpTab = {
42     
43     tab : false,
44     layout : false,
45     disabled : false,
46     add : function(parentLayout, region)
47     {
48         
49         if (!Pman.hasPerm('Ftp.Ftp', 'S')  || this.disabled) {
50             return;
51         }
52             
53         var _this = this;
54       
55         
56         this.layout = new Ext.BorderLayout(
57             parentLayout.getEl().createChild({tag:'div'}),
58             {
59                 west: {
60                     title: "Directories",
61                     split:true,
62                     initialSize: 220,
63                     titlebar: true,
64                     collapsible: true,
65                     autoScroll:false
66                 },
67                 
68                 center: {
69                     titlebar: false,
70                     autoScroll:false,
71                     closeOnTab: true,
72                     tabPosition: 'top',
73                     
74                     //resizeTabs: true,
75                     alwaysShowTabs: false,
76                     minTabWidth: 140
77                 }
78             }
79         );
80         
81             
82         
83         //throw 'done';
84         
85         this.tab = parentLayout.add(region,  new Ext.NestedLayoutPanel(
86             this.layout, { title: "Ftp"
87                 //, toolbar: mainTb 
88         }));
89         
90         this.tab.on('activate', function() {
91             _this.layout.getRegion('west').showPanel(0);
92             _this.layout.getRegion('center').showPanel(0);
93         });
94         this.layout.beginUpdate(); 
95       
96         //this.adminLayout.beginUpdate();
97     }
98      
99 };
100         
101