Pman.Tab.BuilderTop.bjs
[Pman.Builder] / Pman.Tab.BuilderTop.bjs
1 {
2     "id": "roo-file-248",
3     "name": "Pman.Tab.BuilderTop",
4     "parent": "Pman.Tab.BuilderTab",
5     "title": "Pman.Tab.BuilderTop",
6     "path": "/home/alan/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    \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}"
135                                             },
136                                             "text": "New Part",
137                                             "xtype": "Item",
138                                             "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
139                                             "|xns": "Roo.menu"
140                                         },
141                                         {
142                                             "listeners": {
143                                                 "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}"
144                                             },
145                                             "text": "Delete",
146                                             "xtype": "Item",
147                                             "|xns": "Roo.menu"
148                                         }
149                                     ]
150                                 }
151                             ]
152                         },
153                         {
154                             "listeners": {
155                                 "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}",
156                                 "render": "function (_self)\n{\n    _this.filesel = this;\n}"
157                             },
158                             "allowBlank": true,
159                             "alwaysQuery": true,
160                             "displayField": "name",
161                             "editable": false,
162                             "forceSelection": true,
163                             "listWidth": 400,
164                             "loadingText": "Searching...",
165                             "minChars": 2,
166                             "pageSize": 40,
167                             "queryParam": "query[name]",
168                             "selectOnFocus": true,
169                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
170                             "triggerAction": "all",
171                             "typeAhead": true,
172                             "valueField": "id",
173                             "width": 200,
174                             "xtype": "ComboBox",
175                             "|xns": "Roo.form",
176                             "items": [
177                                 {
178                                     "listeners": {
179                                         "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}"
180                                     },
181                                     "*prop": "store",
182                                     "remoteSort": true,
183                                     "xtype": "Store",
184                                     "|sortInfo": "{ field : 'name' , direction : 'ASC' }",
185                                     "|xns": "Roo.data",
186                                     "items": [
187                                         {
188                                             "*prop": "proxy",
189                                             "method": "GET",
190                                             "xtype": "HttpProxy",
191                                             "|url": "baseURL + '/Roo/Builder_part.php'",
192                                             "|xns": "Roo.data"
193                                         },
194                                         {
195                                             "*prop": "reader",
196                                             "id": "id",
197                                             "root": "data",
198                                             "totalProperty": "total",
199                                             "xtype": "JsonReader",
200                                             "|fields": "[\n   \n    {\n        'name': 'name',\n        'type': 'string'\n    } \n]",
201                                             "|xns": "Roo.data"
202                                         }
203                                     ]
204                                 }
205                             ]
206                         },
207                         {
208                             "listeners": {
209                                 "click": "function (_self, e)\n{\n    Pman.Builder.save();\n}",
210                                 "render": "function (_self)\n{\n   _this.saveBtn = this;\n}"
211                             },
212                             "cls": "x-btn-text-icon",
213                             "text": "Save",
214                             "xtype": "SplitButton",
215                             "|icon": "rootURL + '/Pman/templates/images/save.gif'",
216                             "|xns": "Roo.Toolbar",
217                             "items": [
218                                 {
219                                     "|xns": "Roo.menu",
220                                     "xtype": "Menu",
221                                     "*prop": "menu",
222                                     "items": [
223                                         {
224                                             "listeners": {
225                                                 "click": "function (_self, e)\n{\n      Pman.Builder.save(false,0);\n}"
226                                             },
227                                             "text": "Save a copy as",
228                                             "xtype": "Item",
229                                             "|icon": "rootURL + '/Pman/templates/images/save.gif'",
230                                             "|xns": "Roo.menu"
231                                         },
232                                         {
233                                             "listeners": {
234                                                 "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"
235                                             },
236                                             "text": "Show JSON / Javascript HTML",
237                                             "xtype": "Item",
238                                             "|xns": "Roo.menu"
239                                         }
240                                     ]
241                                 }
242                             ]
243                         },
244                         {
245                             "|xns": "Roo.Toolbar",
246                             "xtype": "Separator"
247                         },
248                         {
249                             "listeners": {
250                                 "click": "function (_self, e)\n{\n   Pman.Tab.BuilderView.panel.redraw();\n}"
251                             },
252                             "text": "Redraw",
253                             "xtype": "SplitButton",
254                             "|xns": "Roo.Toolbar",
255                             "items": [
256                                 {
257                                     "|xns": "Roo.menu",
258                                     "xtype": "Menu",
259                                     "*prop": "menu",
260                                     "items": [
261                                         {
262                                             "listeners": {
263                                                 "click": "function (_self, e)\n{\n _this.redrawBtn.setText(\"Redraw (AUTO OFF)\");\n    _this.redrawBtn.auto = 0;\n\n}"
264                                             },
265                                             "text": "Auto redraw - OFF",
266                                             "xtype": "Item",
267                                             "|xns": "Roo.menu"
268                                         },
269                                         {
270                                             "listeners": {
271                                                 "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}"
272                                             },
273                                             "text": "Auto redraw - On",
274                                             "xtype": "Item",
275                                             "|xns": "Roo.menu"
276                                         }
277                                     ]
278                                 }
279                             ]
280                         },
281                         {
282                             "|xns": "Roo.Toolbar",
283                             "xtype": "Fill"
284                         },
285                         {
286                             "allowBlank": false,
287                             "displayField": "name",
288                             "editable": false,
289                             "emptyText": "Select Theme",
290                             "forceSelection": true,
291                             "hiddenName": "name",
292                             "listWidth": 200,
293                             "loadingText": "Searching...",
294                             "minChars": 2,
295                             "name": "name",
296                             "pageSize": 20,
297                             "qtip": "Select Theme",
298                             "queryParam": "",
299                             "selectOnFocus": true,
300                             "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
301                             "triggerAction": "all",
302                             "typeAhead": true,
303                             "valueField": "name",
304                             "width": 300,
305                             "xtype": "ComboBox",
306                             "|xns": "Roo.form",
307                             "items": [
308                                 {
309                                     "listeners": {
310                                         "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
311                                     },
312                                     "*prop": "store",
313                                     "remoteSort": false,
314                                     "xtype": "Store",
315                                     "|sortInfo": "{ direction : 'ASC', field: 'name' }",
316                                     "|xns": "Roo.data",
317                                     "items": [
318                                         {
319                                             "*prop": "proxy",
320                                             "method": "GET",
321                                             "xtype": "HttpProxy",
322                                             "|url": "baseURL + '/Builder/Themes'",
323                                             "|xns": "Roo.data"
324                                         },
325                                         {
326                                             "*prop": "reader",
327                                             "id": "name",
328                                             "root": "data",
329                                             "totalProperty": "total",
330                                             "xtype": "JsonReader",
331                                             "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"assigntype\",\"type\":\"string\"}]",
332                                             "|xns": "Roo.data"
333                                         }
334                                     ]
335                                 }
336                             ]
337                         }
338                     ]
339                 }
340             ]
341         }
342     ],
343     "permname": "",
344     "modOrder": "001"
345 }