php7 fixes
[Pman.Builder] / Pman.Tab.BuilderTop.bjs
1 {
2     "id": "roo-file-200",
3     "name": "Pman.Tab.BuilderTop",
4     "parent": "Pman.Tab.BuilderTab",
5     "title": "Pman.Tab.BuilderTop",
6     "path": "/home/edward/gitlive/Pman.Builder/Pman.Tab.BuilderTop.bjs",
7     "items": [
8         {
9             "background": true,
10             "fitToFrame": true,
11             "region": "north",
12             "xtype": "ContentPanel",
13             "|xns": "Roo",
14             "items": [
15                 {
16                     "|xns": "Roo",
17                     "xtype": "Toolbar",
18                     "*prop": "toolbar",
19                     "items": [
20                         {
21                             "text": "Manage Modules",
22                             "xtype": "Button",
23                             "|xns": "Roo.Toolbar",
24                             "items": [
25                                 {
26                                     "|xns": "Roo.menu",
27                                     "xtype": "Menu",
28                                     "*prop": "menu",
29                                     "items": [
30                                         {
31                                             "listeners": {
32                                                 "click": "function (_self, e)\n{\n    Pman.Dialog.BuilderModule.show({\n         id : 0\n    },function(data) {\n        if (data) {\n           _this.modsel.setFromData(data);\n        }\n    });\n\n}"
33                                             },
34                                             "text": "Create",
35                                             "xtype": "Item",
36                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
37                                             "|xns": "Roo.menu"
38                                         },
39                                         {
40                                             "listeners": {
41                                                 "click": "function (_self, e)\n{\n \n    if (!_this.modsel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Module\");\n        return false;\n    }\n    Pman.Dialog.BuilderModule.show( { id : _this.modsel.getValue() } ,function(data) {\n        if (data) {\n            _this.modsel.setFromData(data);\n        }\n    });\n\n}"
42                                             },
43                                             "text": "Edit",
44                                             "xtype": "Item",
45                                             "|xns": "Roo.menu"
46                                         },
47                                         {
48                                             "listeners": {
49                                                 "click": "function (_self, e)\n{\n   \n\n}"
50                                             },
51                                             "text": "Delete",
52                                             "xtype": "Item",
53                                             "|xns": "Roo.menu"
54                                         },
55                                         {
56                                             "|xns": "Roo.menu",
57                                             "xtype": "Separator"
58                                         },
59                                         {
60                                             "listeners": {
61                                                 "click": "function (_self, e)\n{\n    new Pman.Request({\n        method : 'GET',\n        url : baseURL + '/Roo/Builder_modules.php',\n        params : {\n            'query[_sync]' : 1\n        },\n        success : function() {\n            Roo.MessageBox.alert(\"Done\", \"Re-syned modules\");\n        }\n    });\n}"
62                                             },
63                                             "text": "Sync",
64                                             "xtype": "Item",
65                                             "|xns": "Roo.menu"
66                                         }
67                                     ]
68                                 }
69                             ]
70                         },
71                         {
72                             "listeners": {
73                                 "select": "function (combo, record, index)\n{\n    _this.filesel.reset();\n    _this.filesel.fireEvent('select', false);\n\n}",
74                                 "render": "function (_self)\n{\n    _this.modsel = this;\n}"
75                             },
76                             "allowBlank": true,
77                             "alwaysQuery": true,
78                             "displayField": "name",
79                             "editable": false,
80                             "forceSelection": true,
81                             "listWidth": 300,
82                             "loadingText": "Searching...",
83                             "minChars": 2,
84                             "pageSize": 40,
85                             "queryParam": "query[name]",
86                             "selectOnFocus": true,
87                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
88                             "triggerAction": "all",
89                             "typeAhead": true,
90                             "valueField": "id",
91                             "width": 100,
92                             "xtype": "ComboBox",
93                             "|xns": "Roo.form",
94                             "items": [
95                                 {
96                                     "*prop": "store",
97                                     "remoteSort": true,
98                                     "xtype": "Store",
99                                     "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
100                                     "|xns": "Roo.data",
101                                     "items": [
102                                         {
103                                             "*prop": "proxy",
104                                             "method": "GET",
105                                             "xtype": "HttpProxy",
106                                             "|url": "baseURL + '/Roo/Builder_modules.php'",
107                                             "|xns": "Roo.data"
108                                         },
109                                         {
110                                             "*prop": "reader",
111                                             "id": "id",
112                                             "root": "data",
113                                             "totalProperty": "total",
114                                             "xtype": "JsonReader",
115                                             "|fields": "[\n \n    {\n        'name': 'name',\n        'type': 'string'\n    }\n    \n]",
116                                             "|xns": "Roo.data"
117                                         }
118                                     ]
119                                 }
120                             ]
121                         },
122                         {
123                             "text": "Manage Parts ",
124                             "xtype": "Button",
125                             "|xns": "Roo.Toolbar",
126                             "items": [
127                                 {
128                                     "|xns": "Roo.menu",
129                                     "xtype": "Menu",
130                                     "*prop": "menu",
131                                     "items": [
132                                         {
133                                             "listeners": {
134                                                 "click": "function (_self, e)\n{\n    if (!_this.modsel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Module\");\n        return false;\n    }\n     if (!_this.filesel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Part\");\n        return false;\n    }\n    Pman.Dialog.BuilderPart.show( {\n             id : _this.filesel.getValue(),\n             module_id: _this.modsel.getValue() \n         } ,\n         function(data) {\n            //_this.filesel.reset();\n            if (!data.id) {\n                return;\n            }\n            _this.filesel.setFromData(data);\n            // set the part name on the json..\n            \n            \n            pt.loadBJS(_this.modsel.getValue(), _this.filesel.getValue())\n    });\n\n}"
135                                             },
136                                             "text": "Rename",
137                                             "xtype": "Item",
138                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
139                                             "|xns": "Roo.menu"
140                                         },
141                                         {
142                                             "|xns": "Roo.menu",
143                                             "xtype": "Separator"
144                                         },
145                                         {
146                                             "listeners": {
147                                                 "click": "function (_self, e)\n{\n    if (!_this.modsel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Module\");\n        return false;\n    }\n    \n    Pman.Dialog.BuilderPart.show( {\n             id : 0, \n             module_id: _this.modsel.getValue() \n         } ,\n         function(data) {\n            _this.filesel.reset();\n            if (!data.id) {\n                return;\n            }\n            _this.filesel.setfromdata(data);\n            Pman.Builder.Tree.clearAll();\n            Pman.Builder.Tree.setCurrentNode(Pman.Tab.BuilderTree.tree.root,true);\n             \n            Pman.Tab.BuilderPanel.redraw.defer(100,Pman.Tab.BuilderPanel,[true]);\n    });\n\n}"
148                                             },
149                                             "text": "New Part",
150                                             "xtype": "Item",
151                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
152                                             "|xns": "Roo.menu"
153                                         },
154                                         {
155                                             "listeners": {
156                                                 "click": "function (_self, e)\n{\n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete it?\", function(a) {\n        if (a != 'yes') {\n            return;\n        }\n            \n       \n       new Pman.Request({\n            url : baseURL + '/Roo/Builder_part',\n            method : 'POST',\n            params : {\n                _delete :  _this.filesel.getValue()\n            },\n            success : function() {\n                _this.filesel.setValue('');\n                // unload stuff..\n                 _this.filesel.fireEvent('select', false);\n//                Pman.Tab.BuilderTab.layout.getRegion('west').el.mask(\"select part\");\n            \n            }\n       \n       \n       });\n   });\n}"
157                                             },
158                                             "text": "Delete",
159                                             "xtype": "Item",
160                                             "|xns": "Roo.menu"
161                                         },
162                                         {
163                                             "|xns": "Roo.menu",
164                                             "xtype": "Separator"
165                                         },
166                                         {
167                                             "listeners": {
168                                                 "click": "function (_self, e)\n{\n    if (!_this.modsel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Module\");\n        return false;\n    }\n     if (!_this.filesel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Part\");\n        return false;\n    }\n    Pman.Dialog.BuilderImport.show( {\n             id : _this.filesel.getValue(), \n             module_id: _this.modsel.getValue() \n         } ,\n         function(data) {\n             var bt = Pman.Tab.BuilderTree.tree;\n            var pt = Pman.Builder.Tree;\n            \n            \n            //bv.panel.el.unmask();\n            Pman.Tab.BuilderTab.layout.getRegion('west').el.unmask();\n            pt.loadBJS(_this.modsel.getValue(), _this.filesel.getValue())\n\n             \n    });\n\n}"
169                                             },
170                                             "text": "Import (by pasting)",
171                                             "xtype": "Item",
172                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
173                                             "|xns": "Roo.menu"
174                                         }
175                                     ]
176                                 }
177                             ]
178                         },
179                         {
180                             "listeners": {
181                                 "select": "function (combo, rec, index)\n{\n   //cb.lastData = rec.data;\n    \n    \n    \n    \n    var bt = Pman.Tab.BuilderTree.tree;\n    var pt = Pman.Builder.Tree;\n    \n    if (!rec) {\n        pt.clearAll();\n        pt.setCurrentNode(bt.root,true);\n       // var bv = Pman.Tab.BuilderView;\n        Pman.Tab.BuilderView.panel.clearAll();\n        Pman.Tab.BuilderTab.layout.getRegion('west').el.mask(\"select part\");\n       // bv.panel.el.mask(\"select Module / Part\");\n        return;\n    }\n    //bv.panel.el.unmask();\n    Pman.Tab.BuilderTab.layout.getRegion('west').el.unmask();\n    pt.loadBJS(_this.modsel.getValue(), rec.data.id)\n\n\n}",
182                                 "render": "function (_self)\n{\n    _this.filesel = this;\n}"
183                             },
184                             "allowBlank": true,
185                             "alwaysQuery": true,
186                             "displayField": "name",
187                             "editable": false,
188                             "forceSelection": true,
189                             "listWidth": 400,
190                             "loadingText": "Searching...",
191                             "minChars": 2,
192                             "pageSize": 40,
193                             "queryParam": "query[name]",
194                             "selectOnFocus": true,
195                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
196                             "triggerAction": "all",
197                             "typeAhead": true,
198                             "valueField": "id",
199                             "width": 200,
200                             "xtype": "ComboBox",
201                             "|xns": "Roo.form",
202                             "items": [
203                                 {
204                                     "listeners": {
205                                         "beforeload": "function (_self, o)\n{\n     o.params = o.params || {}; \n   // o.params.btype = 'FORM';\n    if (!_this.modsel.getValue()) {\n        Roo.MessageBox.alert(\"Error\", \"Select Module\");\n        return false;\n    }\n    o.params.module_id = _this.modsel.getValue();\n    o.params._columns = 'id,name';\n}"
206                                     },
207                                     "*prop": "store",
208                                     "remoteSort": true,
209                                     "xtype": "Store",
210                                     "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
211                                     "|xns": "Roo.data",
212                                     "items": [
213                                         {
214                                             "*prop": "proxy",
215                                             "method": "GET",
216                                             "xtype": "HttpProxy",
217                                             "|url": "baseURL + '/Roo/Builder_part.php'",
218                                             "|xns": "Roo.data"
219                                         },
220                                         {
221                                             "*prop": "reader",
222                                             "id": "id",
223                                             "root": "data",
224                                             "totalProperty": "total",
225                                             "xtype": "JsonReader",
226                                             "|fields": "[\n   \n    {\n        'name': 'name',\n        'type': 'string'\n    } \n]",
227                                             "|xns": "Roo.data"
228                                         }
229                                     ]
230                                 }
231                             ]
232                         },
233                         {
234                             "listeners": {
235                                 "click": "function (_self, e)\n{\n    Pman.Builder.save();\n}",
236                                 "render": "function (_self)\n{\n   _this.saveBtn = this;\n}"
237                             },
238                             "cls": "x-btn-text-icon",
239                             "text": "Save",
240                             "xtype": "SplitButton",
241                             "|icon": "rootURL + '/Pman/templates/images/save.gif'",
242                             "|xns": "Roo.Toolbar",
243                             "items": [
244                                 {
245                                     "|xns": "Roo.menu",
246                                     "xtype": "Menu",
247                                     "*prop": "menu",
248                                     "items": [
249                                         {
250                                             "listeners": {
251                                                 "click": "function (_self, e)\n{\n      Pman.Builder.save(false,0);\n}"
252                                             },
253                                             "text": "Save a copy as",
254                                             "xtype": "Item",
255                                             "|icon": "rootURL + '/Pman/templates/images/save.gif'",
256                                             "|xns": "Roo.menu"
257                                         },
258                                         {
259                                             "listeners": {
260                                                 "click": "function (_self, e)\n{\n   Pman.Builder.save(\n     function(data) {\n         Roo.log(\"JSON GOT\");\n              Roo.log(data);\n             Pman.Dialog.BuilderViewCode.show(data ); \n                \n\n      } );\n}\n"
261                                             },
262                                             "text": "Show JSON / Javascript HTML",
263                                             "xtype": "Item",
264                                             "|xns": "Roo.menu"
265                                         }
266                                     ]
267                                 }
268                             ]
269                         },
270                         {
271                             "|xns": "Roo.Toolbar",
272                             "xtype": "Separator"
273                         },
274                         {
275                             "listeners": {
276                                 "click": "function (_self, e)\n{\n   Pman.Tab.BuilderView.panel.redraw();\n}"
277                             },
278                             "text": "Redraw",
279                             "xtype": "SplitButton",
280                             "|xns": "Roo.Toolbar",
281                             "items": [
282                                 {
283                                     "|xns": "Roo.menu",
284                                     "xtype": "Menu",
285                                     "*prop": "menu",
286                                     "items": [
287                                         {
288                                             "listeners": {
289                                                 "click": "function (_self, e)\n{\n _this.redrawBtn.setText(\"Redraw (AUTO OFF)\");\n    _this.redrawBtn.auto = 0;\n\n}"
290                                             },
291                                             "text": "Auto redraw - OFF",
292                                             "xtype": "Item",
293                                             "|xns": "Roo.menu"
294                                         },
295                                         {
296                                             "listeners": {
297                                                 "click": "function (_self, e)\n{\n \n    _this.redrawBtn.setText(\"Redraw\");\n     _this.redrawBtn.auto = 1;\n    var bp = Pman.Tab.BuilderPanel;\n    bp.redraw.defer(100,bp,[true]);\n    \n\n}"
298                                             },
299                                             "text": "Auto redraw - On",
300                                             "xtype": "Item",
301                                             "|xns": "Roo.menu"
302                                         }
303                                     ]
304                                 }
305                             ]
306                         },
307                         {
308                             "|xns": "Roo.Toolbar",
309                             "xtype": "Fill"
310                         },
311                         {
312                             "listeners": {
313                                 "select": "function (combo, record, index)\n{\n    Pman.Builder.View.frameUpdateTheme(record.data.name);\n}"
314                             },
315                             "allowBlank": false,
316                             "displayField": "name",
317                             "editable": false,
318                             "emptyText": "Select Theme",
319                             "forceSelection": true,
320                             "hiddenName": "name",
321                             "listWidth": 200,
322                             "loadingText": "Searching...",
323                             "minChars": 2,
324                             "name": "name",
325                             "pageSize": 20,
326                             "qtip": "Select Theme",
327                             "queryParam": "",
328                             "selectOnFocus": true,
329                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
330                             "triggerAction": "all",
331                             "typeAhead": true,
332                             "valueField": "name",
333                             "width": 200,
334                             "xtype": "ComboBox",
335                             "|xns": "Roo.form",
336                             "items": [
337                                 {
338                                     "listeners": {
339                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
340                                     },
341                                     "*prop": "store",
342                                     "remoteSort": false,
343                                     "xtype": "Store",
344                                     "|sortInfo": "{ direction : 'ASC', field: 'name' }",
345                                     "|xns": "Roo.data",
346                                     "items": [
347                                         {
348                                             "*prop": "proxy",
349                                             "method": "GET",
350                                             "xtype": "HttpProxy",
351                                             "|url": "baseURL + '/Builder/Themes'",
352                                             "|xns": "Roo.data"
353                                         },
354                                         {
355                                             "*prop": "reader",
356                                             "id": "name",
357                                             "root": "data",
358                                             "totalProperty": "total",
359                                             "xtype": "JsonReader",
360                                             "|fields": "[\"name\"]",
361                                             "|xns": "Roo.data"
362                                         }
363                                     ]
364                                 }
365                             ]
366                         }
367                     ]
368                 }
369             ]
370         }
371     ],
372     "permname": "",
373     "modOrder": "001"
374 }