1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.BuilderDatabase = new Roo.XComponent({
6 part : ["Builder","Database"],
7 order : '999-Pman.Tab.BuilderDatabase',
9 parent : 'Pman.Tab.Builder',
10 name : "Pman.Tab.BuilderDatabase",
18 xtype: 'NestedLayoutPanel',
21 activate : function (_self)
23 _this.treepanel.tree.root.reload();
28 title : "Manage Database",
30 xtype: 'BorderLayout',
37 render : function (_self)
39 _this.treepanel = _self;
51 click : function (_self, e)
53 _this.treepanel.tree.root.reload();
56 text : "Refresh/Manage Tables",
64 text : "Add Table/Container"
74 click : function (_self, e)
78 url: baseURL + '/Roo/Builder_tables.php',
96 click : function (_self, e)
98 var node = _this.treepanel.tree.getSelectionModel().getSelectedNode();
101 Roo.MessageBox.alert('Error', 'Please select a table');
105 Roo.log(node.attributes.name);
121 beforeload : function (node)
123 if (!_this.panel.active) {
127 contextmenu : function (node, e)
129 if (!node.expanded || node.leaf) {
133 _this.treepanel.menu = Roo.factory(_this.treepanel.menu);
134 _this.treepanel.menu.show(node.ui.anchor,'tr');
137 beforenodedrop : function (dropEvent)
140 var node = dropEvent.dropNode;
141 var targ = dropEvent.target;
142 var parent = dropEvent.target;
143 switch(dropEvent.point) {
146 parent = dropEvent.target.parentNode;
151 // technically you should not be able to drag tables into other modules..
152 if (parent.attributes.id < 1) {
153 dropEvent.cancel = 1;
156 url : baseURL + '/Roo/Builder_tables',
158 id : node.attributes.id,
159 parent_id : parent.attributes.id
166 containerScroll : true,
174 create : function (_self, attr)
178 attr.text = attr.name.length ? attr.name : attr.descrip;
180 attr.leaf = attr.name.length ? true : false;
181 attr.html = String.format('<B>{0}</B><i>{1}</i>',
192 queryParam : 'parent_id',
193 requestMethod : 'GET',
195 baseParams : { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 },
196 dataUrl : baseURL + '/Roo/Builder_tables.php'
199 xtype: 'MultiSelectionModel',
203 xtype: 'AsyncTreeNode',
211 beforenodeedit : function (_self,node)
213 Roo.log('before start edit');
214 Roo.log(this.editNode);
215 if (node.attributes.name.length) {
221 complete : function (_self, value, startValue)
223 Roo.log(this.editNode);
225 var attr = this.editNode.attributes;
227 var pa = this.editNode.parentNode.attributes;
242 url : baseURL + '/Roo/Builder_tables',
261 click : function (_self, e)
263 _this.nIndex = _this.nIndex || 0;
265 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
266 var tree = _this.treepanel.tree;
268 var n = tree.loader.createNode({
270 descrip :'New Group ' + (++_this.nIndex),
274 var node = _this.cxnode[m]( n , _this.cxnode.firstChild);
275 setTimeout(function(){
276 tree.editor.editNode = node;
277 tree.editor.startEdit(node.ui.textNode);
291 click : function (_self, e)
293 _this.nIndex = _this.nIndex || 0;
296 // try and delete it..
298 url : baseURL + '/Roo/Builder_tables',
300 _delete : _this.cxnode.attributes.id
302 success : function() {
303 _this.cxnode.parentNode.removeChild(_this.cxnode);
304 _this.cxnode = false;
311 text : "Remove Group"
320 activate : function() {
323 _this.grid.footer.onClick('first');
331 tableName : 'Tables',
340 //_this.dialog = Pman.Dialog.FILL_IN
341 if (_this.panel.active) {
342 this.footer.onClick('first');
345 rowdblclick : function (_self, rowIndex, e)
347 if (!_this.dialog) return;
348 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
349 _this.grid.footer.onClick('first');
353 autoExpandColumn : 'table',
359 sortInfo : { field : 'filename', direction: 'ASC' },
364 url : baseURL + '/Builder/ERM.php'
369 totalProperty : 'total',
406 'name': 'displayorder',
414 'name': 'parent_image_id',
420 'dateFormat': 'Y-m-d'
447 'name': 'parent_image_id_id',
451 'name': 'parent_image_id_filename',
455 'name': 'parent_image_id_ontable',
459 'name': 'parent_image_id_onid',
463 'name': 'parent_image_id_mimetype',
467 'name': 'parent_image_id_width',
471 'name': 'parent_image_id_height',
475 'name': 'parent_image_id_filesize',
479 'name': 'parent_image_id_displayorder',
483 'name': 'parent_image_id_language',
487 'name': 'parent_image_id_parent_image_id',
491 'name': 'parent_image_id_created',
495 'name': 'parent_image_id_imgtype',
499 'name': 'parent_image_id_linkurl',
503 'name': 'parent_image_id_descript',
507 'name': 'parent_image_id_title',
511 'name': 'parent_image_id_credit',
515 'name': 'parent_image_id_source',
522 xtype: 'PagingToolbar',
526 displayMsg : "Displaying Images{0} - {1} of {2}",
527 emptyMsg : "No Images found"
539 Roo.MessageBox.alert("Updating", "Updating the cache");
541 url : baseURL + '/Core/RefreshDatabaseCache',
543 success : function() {
544 Roo.MessageBox.hide();
549 cls : 'x-btn-text-icon',
550 text : "Refresh Schema",
551 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
557 xtype: 'ColumnModel',
562 renderer : function(v) { return String.format('{0}', v); }
569 xtype: 'LayoutRegion',
575 xtype: 'LayoutRegion',