1 //<script type="text/javascript">
4 Pman.on('beforeload', function()
6 // this is always shown if Clipping module is enabled!!
7 //if (!Pman.hasPerm('Admin.Campaigns', 'E')) {
11 modKey : '016-pman-tab-ftpfiles',
12 module : Pman.Tab.FtpFiles,
14 parent : Pman.Tab.FtpTab,
26 add : function(parentLayout, region) {
30 parentLayout.getRegion(region).showPanel(this.panel);
36 this.layout = new Ext.BorderLayout(
37 parentLayout.getEl().createChild({tag:'div'}),
61 this.tab = parentLayout.add(region, new Ext.NestedLayoutPanel(
62 this.layout, {title: "Files", background: true}));
64 this.tab.on('activate', function() {
65 _this.delayedCreate();
69 delayedCreate : function()
75 this.layout.beginUpdate();
78 var frm = this.layout.getEl().createChild({tag:'div'});
79 //this.grid = new Ext.grid.EditorGrid(frm, {
80 this.grid = new Ext.grid.Grid(frm, {
82 ds: new Ext.data.Store({
84 proxy: new Ext.data.HttpProxy({
85 url: baseURL + '/Ftp/List.php',
91 totalProperty : 'total',
103 beforeload: function(t, o) {
104 var sn = Pman.Tab.FtpTree.tree.getSelectionModel().getSelectedNode();
109 o.params.name = sn.attributes.id;
110 o.params.type = 'files';
111 //console.log(o.params);
113 // need to show month here..
114 //o.params = o.params ? o.params : {};
115 // o.params['query[project_search]'] = _this.searchBox.getValue();
116 // o.params['query[project_filter]'] = _this.filter;
124 loadexception : Pman.loadException
128 field: 'name', direction: 'DESC'
131 cm: new Ext.grid.ColumnModel(
134 id : 'ftpfiles-name',
155 autoExpandColumn: 'ftpfiles-name' , // fixme!!!!
161 // sel. changed-> show detail breakdown @ bottom.
163 //rowclick : function(g, ri, e) {
165 // var x = g.getDataSource().getAt(ri);
166 // x.data.languagelist = x.json.languagelist;
167 // x.data.countrylist= x.json.countrylist;
168 // _dialog.show(x.data, refreshPager);
174 xtype : 'RowSelectionModel',
177 afterselectionchange : function(sm) {
178 var s = sm.getSelections();
179 if (!s || s.length != 1) {
182 // if it's not a text file.. download it..
184 _this.viewLayout.load(baseURL+ '/Ftp/View' + s[0].data.id + '?html=1');
189 this.grid.getSelectionModel().singleSelect = true;
190 this.grid.getSelectionModel().on('selectionchange' , function (s) {
196 this.panel = this.layout.add('center', new Ext.GridPanel(this.grid ,
197 { fitToframe: true,fitContainer: true })
200 /*var gridFoot = this.grid.getView().getFooterPanel(true);
201 this.paging = new Ext.PagingToolbar(gridFoot, this.grid.getDataSource(), {
208 var pagerFirst = function()
213 var grid = this.grid;
215 var gridHead = this.grid.getView().getHeaderPanel(true);
216 var tb = new Ext.Toolbar(gridHead);
218 var td = Date.parseDate((new Date()).format('Y-m-01'), 'Y-m-d');
231 // add stuff to toolbar?
234 // _this.paging.onClick('refresh');
236 var frame = this.layout.getRegion('south').el.createChild({tag:'div', style: 'margin:0px;'});
237 this.viewLayout = this.layout.add('south',
238 new Ext.ContentPanel(frame, {
247 this.layout.endUpdate();
248 //this.viewLayout.resizeEl= this.viewLayout.getEl();
249 //this.viewLayout.el.setStyle('overflow', 'auto');
255 this.grid.getDataSource().load({