1 //<script type="text/javascript">
3 Pman.on('beforeload', function()
6 // always loaded by clipping tree
10 modKey : '001-pman-tab-ftptree',
11 module : Pman.Tab.FtpTree,
13 parent : Pman.Tab.FtpTab,
23 add : function(parentLayout, region)
26 // there is no way this should be called twice!!?!?
28 // parentLayout.getRegion(region).showPanel(this.panel);
33 this.innerLayout = new Ext.BorderLayout(
34 parentLayout.getEl().createChild({tag:'div'}),
46 this.tab = parentLayout.add(region, new Ext.NestedLayoutPanel(
47 this.innerLayout, {title: "Ftp Folders", background : true}));
50 this.tab.on('activate', function() {
51 _this.delayedCreate();
52 //_this.paging.onClick('refresh');
55 delayedCreate : function()
60 this.innerLayout.beginUpdate();
65 var treePanelEl = this.innerLayout.getEl().createChild({tag:'div'});
66 var tb = new Roo.Toolbar(treePanelEl.createChild({tag:'div'}), [
71 var treeEl = treePanelEl.createChild({tag:'div'});
73 this.panel = this.innerLayout.add('center', new Roo.ContentPanel(treePanelEl, {
82 resize : function (cp, w, h) {
83 _this.tree.innerCt.setWidth(w);
84 _this.tree.innerCt.setHeight(h);
85 _this.tree.innerCt.setStyle('overflow-y', 'auto');
93 this.tree = new Roo.tree.TreePanel(treeEl ,
95 loader: new Roo.tree.TreeLoader({
96 dataUrl: baseURL + '/Ftp/List.php',
103 person_id : Pman.Login.authUser.id
106 beforeload : function(tl, n) {
107 //tl.baseParams.is_search = n.attributes.is_search;
113 // default: Roo.tree.ColumnNodeUI
117 renderer : function (ats) {
118 return String.format('{0}', ats.name);
122 rendererTip : function (ats) {
123 return String.format('{0}', ats.description || ats.name);
127 //dataUrl:'get-nodes.php',
130 // loadexception : Pman.loadException
134 containerScroll: true,
147 rowdblclick : function(g, ri, e) {
148 //var s = g.getDataSource().getAt(ri).data;
150 // _dialog.show(s, refreshPager);
159 this.tree.getSelectionModel().on('selectionchange', function(sm, n) {
161 Pman.Tab.FtpFiles.reload();
166 // let's make some standard top level ones..
167 var root = new Roo.tree.AsyncTreeNode({
168 //text: 'Saved Searches',
174 this.tree.setRootNode(root);
181 var _dialog = Pman.Dialog.ClippingTree;
187 text: "Manage Folders",
188 cls: 'x-btn-text-icon',
189 icon: Ext.rootURL + 'images/default/tree/leaf.gif',
195 cls: 'x-btn-text-icon',
196 icon: Ext.rootURL + 'images/default/dd/drop-add.gif',
197 handler : function(){
202 text: "Rename Folder",
203 cls: 'x-btn-text-icon',
204 icon: Ext.rootURL + 'images/default/tree/leaf.gif',
206 handler : function(){
211 text: "Delete Folder" ,
212 cls: 'x-btn-text-icon',
213 icon: rootURL + '/Pman/templates/images/trash.gif',
214 handler : function(){
221 text: "Reload Tree" ,
222 cls: 'x-btn-text-icon',
223 icon: rootURL + '/Pman/templates/images/view-refresh.gif',
224 handler : function(){
236 // add stuff to toolbar?
237 this.innerLayout.endUpdate();
242 deleteNode : function(node)
246 url: baseURL + '/Roo/ClippingTree',
252 success : function(data) {
253 node.parentNode.removeChild(node);
256 failure : function ()
264 reloadTree: function()
266 /*this.tree.root.eachChild(function(n) {
267 n.collapse(false,false);
270 n.removeChild(n.firstChild);
272 n.childrenRendered = false;
275 n.ui.updateExpandIcon();