1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 part : ["Builder","Database"],
12 modKey : '999-Pman.Tab.BuilderDatabase',
13 module : Pman.Tab.BuilderDatabase,
15 parent : Pman.Tab.Builder,
16 name : "Pman.Tab.BuilderDatabase",
22 Pman.Tab.BuilderDatabase = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
35 xtype: 'NestedLayoutPanel',
38 activate : function (_self)
40 _this.treepanel.tree.root.reload();
45 title : "Manage Database",
47 xtype: 'BorderLayout',
54 render : function (_self)
56 _this.treepanel = _self;
68 click : function (_self, e)
70 _this.treepanel.tree.root.reload();
73 text : "Refresh/Manage Tables",
81 text : "Add Table/Container"
91 click : function (_self, e)
95 url: baseURL + '/Roo/Builder_tables.php',
114 beforeload : function (node)
116 if (!_this.panel.active) {
120 contextmenu : function (node, e)
122 if (!node.expanded || node.leaf) {
126 _this.treepanel.menu = Roo.factory(_this.treepanel.menu);
127 _this.treepanel.menu.show(node.ui.anchor,'tr');
131 containerScroll : true,
139 create : function (_self, attr)
143 attr.text = attr.name.length ? attr.name : attr.descrip;
145 attr.leaf = attr.name.length ? true : false;
146 attr.html = String.format('<B>{0}</B><i>{1}</i>',
157 queryParam : 'parent_id',
158 requestMethod : 'GET',
160 baseParams : { _tree: 1, 'sort': 'name', dir: 'ASC', limit : 9999 },
161 dataUrl : baseURL + '/Roo/Builder_tables.php'
164 xtype: 'AsyncTreeNode',
169 xtype: 'DefaultSelectionModel',
176 beforenodeedit : function (_self,node)
178 Roo.log('before start edit');
179 Roo.log(this.editNode);
180 if (node.attributes.name.length) {
186 complete : function (_self, value, startValue)
188 Roo.log(this.editNode);
190 var attr = this.editNode.attributes;
192 var pa = this.editNode.parentNode.attributes;
197 descrip : this.editNode.text,
206 url : baseURL + '/Roo/Builder_tables',
225 click : function (_self, e)
227 _this.nIndex = _this.nIndex || 0;
229 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
230 var tree = _this.treepanel.tree;
232 var n = tree.loader.createNode({
234 descrip :'New Group ' + (++_this.nIndex),
238 var node = _this.cxnode[m]( n , _this.cxnode.firstChild);
239 setTimeout(function(){
240 tree.editor.editNode = node;
241 tree.editor.startEdit(node.ui.textNode);
254 activate : function() {
257 _this.grid.footer.onClick('first');
265 tableName : 'Tables',
274 //_this.dialog = Pman.Dialog.FILL_IN
275 if (_this.panel.active) {
276 this.footer.onClick('first');
279 rowdblclick : function (_self, rowIndex, e)
281 if (!_this.dialog) return;
282 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
283 _this.grid.footer.onClick('first');
287 autoExpandColumn : 'table',
293 sortInfo : { field : 'filename', direction: 'ASC' },
298 url : baseURL + '/Builder/ERM.php'
303 totalProperty : 'total',
340 'name': 'displayorder',
348 'name': 'parent_image_id',
354 'dateFormat': 'Y-m-d'
381 'name': 'parent_image_id_id',
385 'name': 'parent_image_id_filename',
389 'name': 'parent_image_id_ontable',
393 'name': 'parent_image_id_onid',
397 'name': 'parent_image_id_mimetype',
401 'name': 'parent_image_id_width',
405 'name': 'parent_image_id_height',
409 'name': 'parent_image_id_filesize',
413 'name': 'parent_image_id_displayorder',
417 'name': 'parent_image_id_language',
421 'name': 'parent_image_id_parent_image_id',
425 'name': 'parent_image_id_created',
429 'name': 'parent_image_id_imgtype',
433 'name': 'parent_image_id_linkurl',
437 'name': 'parent_image_id_descript',
441 'name': 'parent_image_id_title',
445 'name': 'parent_image_id_credit',
449 'name': 'parent_image_id_source',
456 xtype: 'PagingToolbar',
460 displayMsg : "Displaying Images{0} - {1} of {2}",
461 emptyMsg : "No Images found"
473 Roo.MessageBox.alert("Updating", "Updating the cache");
475 url : baseURL + '/Core/RefreshDatabaseCache',
477 success : function() {
478 Roo.MessageBox.hide();
483 cls : 'x-btn-text-icon',
484 text : "Refresh Schema",
485 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
491 xtype: 'ColumnModel',
496 renderer : function(v) { return String.format('{0}', v); }
503 xtype: 'LayoutRegion',
509 xtype: 'LayoutRegion',
514 this.layout = this.panel.layout;