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","Top"],
12 modKey : '001-Pman.Tab.BuilderTop',
13 module : Pman.Tab.BuilderTop,
15 parent : Pman.Tab.BuilderTab,
16 name : "Pman.Tab.BuilderTop",
22 Pman.Tab.BuilderTop = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
35 xtype: 'ContentPanel',
47 text : "Manage Modules",
56 click : function (_self, e)
58 Pman.Dialog.BuilderModule.show({
62 _this.modsel.setFromData(data);
69 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
75 click : function (_self, e)
78 if (!_this.modsel.getValue()) {
79 Roo.MessageBox.alert("Error", "Select Module");
82 Pman.Dialog.BuilderModule.show( { id : _this.modsel.getValue() } ,function(data) {
84 _this.modsel.setFromData(data);
96 click : function (_self, e)
112 click : function (_self, e)
116 url : baseURL + '/Roo/Builder_modules.php',
117 params : 'query[_sync]',
118 success : function() {
119 Roo.MessageBox.alert("Re-syned modules");
133 select : function (combo, record, index)
135 _this.filesel.reset();
136 _this.filesel.fireEvent('select', false);
139 render : function (_self)
146 displayField : 'name',
148 forceSelection : true,
150 loadingText : "Searching...",
153 queryParam : 'query[name]',
154 selectOnFocus : true,
155 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b></div>',
156 triggerAction : 'all',
164 sortInfo : { field : 'name' , direction : 'ASC' },
169 url : baseURL + '/Roo/Builder_modules.php'
176 totalProperty : 'total',
191 text : "Manage Parts ",
200 click : function (_self, e)
202 if (!_this.modsel.getValue()) {
203 Roo.MessageBox.alert("Error", "Select Module");
207 Pman.Dialog.BuilderPart.show( {
209 module_id: _this.modsel.getValue()
212 _this.filesel.reset();
216 _this.filesel.setfromdata(data);
217 Pman.Tab.BuilderTree.clearAll();
218 Pman.Tab.BuilderTree.setCurrentNode(Pman.Tab.BuilderTree.tree.root,true);
220 var bp = Pman.Tab.BuilderPanel;
221 bp.redraw.defer(100,bp,[true]);
227 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
241 select : function (combo, rec, index)
243 //cb.lastData = rec.data;
248 var bt = Pman.Tab.BuilderTree.tree;
253 bt.setCurrentNode(bt.root,true);
254 // var bv = Pman.Tab.BuilderView;
255 Pman.Tab.BuilderView.panel.clearAll();
256 // bv.panel.el.mask("select Module / Part");
259 //bv.panel.el.unmask();
261 bt.loadBJS(_this.modsel.getValue(), rec.data.id)
265 render : function (_self)
267 _this.filesel = this;
272 displayField : 'name',
274 forceSelection : true,
276 loadingText : "Searching...",
279 queryParam : 'query[name]',
280 selectOnFocus : true,
281 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b></div>',
282 triggerAction : 'all',
290 beforeload : function (_self, o)
292 o.params = o.params || {};
293 // o.params.btype = 'FORM';
294 if (!_this.modsel.getValue()) {
295 Roo.MessageBox.alert("Error", "Select Module");
298 o.params.module_id = _this.modsel.getValue();
299 o.params._columns = 'id,name';
303 sortInfo : { field : 'name' , direction : 'ASC' },
308 url : baseURL + '/Roo/Builder_part.php'
315 totalProperty : 'total',
330 click : function (_self, e)
334 render : function (_self)
336 _this.saveBtn = this;
339 cls : 'x-btn-text-icon',
342 // first see if first element has a name.. - we can not save otherwise..
343 var t = Pman.Tab.BuilderTree.tree;
344 if (!t.root.elConfig.name.length) {
345 Roo.MessageBox.alert("Error", "No name set for form");
349 sid = (typeof(sid) == 'undefined') ? (this.filesel.lastData ? this.filesel.lastData.id : 0) : sid;
351 var js = Pman.Tab.BuilderTree.toJS();
352 var json = Roo.encode(js);
354 // console.log(json);
356 // check the select box to see if that has been set... - save it with that id..
361 url: baseURL + '/Roo/Builder.php',
365 name : t.root.elConfig.name,
366 module : t.root.elConfig['|module'],
367 app : t.root.elConfig.app,
371 success : function(data) {
375 _this.filesel.setFromData(data);
379 _this.postCode(data);
384 icon : rootURL + '/Pman/templates/images/save.gif',
393 click : function (_self, e)
395 _this.saveBtn.save(false,0);
398 icon : rootURL + '/Pman/templates/images/save.gif',
399 text : "Save a copy as"
405 click : function (_self, e)
409 Pman.Dialog.BuilderViewCode.show({ id : _this.filesel.getValue() } );
425 xtype: 'SplitButton',
428 click : function (_self, e)
430 Pman.Tab.BuilderView.panel.redraw();
442 click : function (_self, e)
444 _this.redrawBtn.setText("Redraw (AUTO OFF)");
445 _this.redrawBtn.auto = 0;
449 text : "Auto redraw - OFF"
455 click : function (_self, e)
458 _this.redrawBtn.setText("Redraw");
459 _this.redrawBtn.auto = 1;
460 var bp = Pman.Tab.BuilderPanel;
461 bp.redraw.defer(100,bp,[true]);
466 text : "Auto redraw - On"
474 this.layout = this.panel.layout;