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) {
197 click : function (_self, e)
199 _this.nIndex = _this.nIndex || 0;
201 var m = _this.cxnode.firstChild ? 'insertBefore' : 'appendChild';
203 var n = _this.treepanel.laoder.createNode({
205 descrip :'New Group ' + (++_this.nIndex),
209 _this.cxnode[m]( n , _this.cxnode.firstChild);
222 activate : function() {
225 _this.grid.footer.onClick('first');
233 tableName : 'Tables',
242 //_this.dialog = Pman.Dialog.FILL_IN
243 if (_this.panel.active) {
244 this.footer.onClick('first');
247 rowdblclick : function (_self, rowIndex, e)
249 if (!_this.dialog) return;
250 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
251 _this.grid.footer.onClick('first');
255 autoExpandColumn : 'table',
261 sortInfo : { field : 'filename', direction: 'ASC' },
266 url : baseURL + '/Builder/ERM.php'
271 totalProperty : 'total',
308 'name': 'displayorder',
316 'name': 'parent_image_id',
322 'dateFormat': 'Y-m-d'
349 'name': 'parent_image_id_id',
353 'name': 'parent_image_id_filename',
357 'name': 'parent_image_id_ontable',
361 'name': 'parent_image_id_onid',
365 'name': 'parent_image_id_mimetype',
369 'name': 'parent_image_id_width',
373 'name': 'parent_image_id_height',
377 'name': 'parent_image_id_filesize',
381 'name': 'parent_image_id_displayorder',
385 'name': 'parent_image_id_language',
389 'name': 'parent_image_id_parent_image_id',
393 'name': 'parent_image_id_created',
397 'name': 'parent_image_id_imgtype',
401 'name': 'parent_image_id_linkurl',
405 'name': 'parent_image_id_descript',
409 'name': 'parent_image_id_title',
413 'name': 'parent_image_id_credit',
417 'name': 'parent_image_id_source',
424 xtype: 'PagingToolbar',
428 displayMsg : "Displaying Images{0} - {1} of {2}",
429 emptyMsg : "No Images found"
441 Roo.MessageBox.alert("Updating", "Updating the cache");
443 url : baseURL + '/Core/RefreshDatabaseCache',
445 success : function() {
446 Roo.MessageBox.hide();
451 cls : 'x-btn-text-icon',
452 text : "Refresh Schema",
453 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
459 xtype: 'ColumnModel',
464 renderer : function(v) { return String.format('{0}', v); }
471 xtype: 'LayoutRegion',
477 xtype: 'LayoutRegion',
482 this.layout = this.panel.layout;