Pman.Tab.CmsTranslateTemplates.bjs
[Pman.Cms] / Pman.Dialog.CmsPage.bjs
1 {
2     "name" : "Pman.Dialog.CmsPage",
3     "parent" : "",
4     "title" : "Cms -Edit Page",
5     "path" : "/home/alan/gitlive/Pman.Cms/Pman.Dialog.CmsPage.bjs",
6     "permname" : "",
7     "modOrder" : "001",
8     "items" : [
9         {
10             "modal" : true,
11             "collapsible" : false,
12             "background" : true,
13             "title" : "Edit Page",
14             "xtype" : "LayoutDialog",
15             "width" : 850,
16             "$ xns" : "Roo",
17             "closable" : false,
18             "resizable" : false,
19             "height" : 600,
20             "items" : [
21                 {
22                     "xtype" : "LayoutRegion",
23                     "$ xns" : "Roo",
24                     "titlebar" : false,
25                     "* prop" : "center"
26                 },
27                 {
28                     "fitToFrame" : true,
29                     "xtype" : "LayoutRegion",
30                     "width" : 200,
31                     "$ xns" : "Roo",
32                     "titlebar" : false,
33                     "* prop" : "east"
34                 },
35                 {
36                     "autoScroll" : true,
37                     "region" : "center",
38                     "fitToFrame" : true,
39                     "xtype" : "ContentPanel",
40                     "$ xns" : "Roo",
41                     "items" : [
42                         {
43                             "listeners" : {
44                                 "|actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask();\n    Pman.standardActionFailed(_self, action);\n}\n",
45                                 "|actioncomplete" : "function (_self, action)\n{\n\n   if (action.type =='submit') {\n       \n       _this.dialog.el.unmask();\n       _this.dialog.hide();\n       \n        if (_this.callback) {\n           _this.callback.call(_this, _this.form.getValues());\n        }\n        _this.form.reset();\n        return;\n    }\n    if (action.type == 'setdata') {    \n          _this.loaded = false;\n          \n  //      _this.dialog.getLayout().showPanel(0);\n    //   _this.form.addForm(_this.form1);\n          if ( _this.data.id) {\n                _this.dialog.el.mask(\"Loading\");\n                this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n           } else {\n                _this.loaded = true;\n                //disable image upload!\n              _this.form.findField('publish_status').setValue(-1);\n          }\n\n       return;\n      \n    }\n    \n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n       _this.grid.getDataSource().load();\n        return;\n    }\n}\n",
46                                 "|rendered" : "function (_self)\n{\n    _this.form = _self;\n}\n"
47                             },
48                             "$ url" : "baseURL + '/Roo/Page.php'",
49                             "xtype" : "Form",
50                             "method" : "POST",
51                             "style" : "margin: 5px",
52                             "$ xns" : "Roo.form",
53                             "items" : [
54                                 {
55                                     "fieldLabel" : "Page link",
56                                     "xtype" : "TextField",
57                                     "width" : 200,
58                                     "$ xns" : "Roo.form",
59                                     "name" : "page_link"
60                                 },
61                                 {
62                                     "listWidth" : 400,
63                                     "triggerAction" : "all",
64                                     "fieldLabel" : "Parent page",
65                                     "forceSelection" : true,
66                                     "selectOnFocus" : true,
67                                     "pageSize" : 20,
68                                     "displayField" : "page_link",
69                                     "emptyText" : "Select Parent",
70                                     "hiddenName" : "parent_id",
71                                     "minChars" : 2,
72                                     "valueField" : "id",
73                                     "xtype" : "ComboBox",
74                                     "allowBlank" : true,
75                                     "typeAhead" : true,
76                                     "editable" : false,
77                                     "width" : 400,
78                                     "$ xns" : "Roo.form",
79                                     "name" : "parent_id_page_link",
80                                     "qtip" : "Select Category ",
81                                     "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b><br/><i>{page_link}</i> </div>",
82                                     "loadingText" : "Searching...",
83                                     "items" : [
84                                         {
85                                             "xtype" : "Store",
86                                             "remoteSort" : true,
87                                             "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
88                                             "$ xns" : "Roo.data",
89                                             "* prop" : "store",
90                                             "items" : [
91                                                 {
92                                                     "$ url" : "baseURL + '/Roo/Page.php'",
93                                                     "xtype" : "HttpProxy",
94                                                     "method" : "GET",
95                                                     "$ xns" : "Roo.data",
96                                                     "* prop" : "proxy"
97                                                 },
98                                                 {
99                                                     "id" : "id",
100                                                     "root" : "data",
101                                                     "xtype" : "JsonReader",
102                                                     "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
103                                                     "$ xns" : "Roo.data",
104                                                     "* prop" : "reader",
105                                                     "totalProperty" : "total"
106                                                 }
107                                             ]
108                                         }
109                                     ]
110                                 },
111                                 {
112                                     "xtype" : "Row",
113                                     "$ xns" : "Roo.form",
114                                     "items" : [
115                                         {
116                                             "fieldLabel" : "Date to Publish",
117                                             "format" : "Y-m-d",
118                                             "xtype" : "DateField",
119                                             "width" : 200,
120                                             "$ xns" : "Roo.form",
121                                             "name" : "published"
122                                         },
123                                         {
124                                             "fieldLabel" : "Replaces",
125                                             "xtype" : "TextField",
126                                             "width" : 75,
127                                             "$ xns" : "Roo.form",
128                                             "name" : "replaces_id"
129                                         }
130                                     ]
131                                 },
132                                 {
133                                     "hideLabels" : true,
134                                     "xtype" : "Row",
135                                     "labelWidth" : 0,
136                                     "width" : 520,
137                                     "$ xns" : "Roo.form",
138                                     "items" : [
139                                         {
140                                             "xtype" : "Checkbox",
141                                             "width" : 100,
142                                             "boxLabel" : "Visible",
143                                             "$ xns" : "Roo.form",
144                                             "name" : "visible"
145                                         },
146                                         {
147                                             "xtype" : "Checkbox",
148                                             "width" : 150,
149                                             "boxLabel" : "Display in RSS",
150                                             "$ xns" : "Roo.form",
151                                             "name" : "in_rss"
152                                         },
153                                         {
154                                             "inputValue" : 1,
155                                             "xtype" : "Checkbox",
156                                             "boxLabel" : "Extended Vis.?",
157                                             "width" : 140,
158                                             "$ xns" : "Roo.form",
159                                             "name" : "has_extended"
160                                         }
161                                     ]
162                                 },
163                                 {
164                                     "fieldLabel" : "Title",
165                                     "xtype" : "TextField",
166                                     "width" : 390,
167                                     "$ xns" : "Roo.form",
168                                     "name" : "title"
169                                 },
170                                 {
171                                     "labelAlign" : "top",
172                                     "xtype" : "Column",
173                                     "width" : 570,
174                                     "$ xns" : "Roo.form",
175                                     "items" : [
176                                         {
177                                             "fieldLabel" : "Contents",
178                                             "xtype" : "HtmlEditor",
179                                             "width" : 550,
180                                             "$ xns" : "Roo.form",
181                                             "resizable" : "s",
182                                             "name" : "contents",
183                                             "height" : 200
184                                         }
185                                     ]
186                                 },
187                                 {
188                                     "labelAlign" : "top",
189                                     "xtype" : "Column",
190                                     "width" : 570,
191                                     "$ xns" : "Roo.form",
192                                     "items" : [
193                                         {
194                                             "fieldLabel" : "Extended Contents",
195                                             "xtype" : "HtmlEditor",
196                                             "width" : 550,
197                                             "$ xns" : "Roo.form",
198                                             "resizable" : "s",
199                                             "name" : "extended",
200                                             "height" : 200
201                                         }
202                                     ]
203                                 },
204                                 {
205                                     "xtype" : "Hidden",
206                                     "$ xns" : "Roo.form",
207                                     "name" : "id"
208                                 }
209                             ]
210                         }
211                     ]
212                 },
213                 {
214                     "listeners" : {
215                         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
216                     },
217                     "fitToframe" : true,
218                     "background" : false,
219                     "region" : "east",
220                     "xtype" : "GridPanel",
221                     "title" : "Images",
222                     "fitContainer" : true,
223                     "$ xns" : "Roo",
224                     "tableName" : "Images",
225                     "items" : [
226                         {
227                             "listeners" : {
228                                 "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    var rd = _this.grid.getDataSource().getAt(rowIndex);\n    var id = rd.data.id;\n    var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);\n    _this.form.findField('contents').execCmd('insertimage', url);\n\n}",
229                                 "|render" : "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       //this.footer.onClick('first');\n    }\n}"
230                             },
231                             "autoExpandColumn" : "filename",
232                             "xtype" : "Grid",
233                             "loadMask" : true,
234                             "$ xns" : "Roo.grid",
235                             "* prop" : "grid",
236                             "items" : [
237                                 {
238                                     "listeners" : {
239                                         "|beforeload" : "function (_self, o)\n{\n    if (!_this.data.id) {\n       return false;\n    } \n    o.params = o.params || {};              \n    o.params.onid = _this.data.id;\n    o.params.ontable = 'Page';\n}"
240                                     },
241                                     "xtype" : "Store",
242                                     "$ xns" : "Roo.data",
243                                     "* prop" : "dataSource",
244                                     "items" : [
245                                         {
246                                             "id" : "id",
247                                             "root" : "data",
248                                             "xtype" : "JsonReader",
249                                             "$ xns" : "Roo.data",
250                                             "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'parent_image_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_title',\n        'type': 'string'\n    }\n]",
251                                             "* prop" : "reader",
252                                             "totalProperty" : "total"
253                                         },
254                                         {
255                                             "$ url" : "baseURL + '/Roo/Images.php'",
256                                             "method" : "GET",
257                                             "xtype" : "HttpProxy",
258                                             "$ xns" : "Roo.data",
259                                             "* prop" : "proxy"
260                                         }
261                                     ]
262                                 },
263                                 {
264                                     "xtype" : "Toolbar",
265                                     "$ xns" : "Roo",
266                                     "* prop" : "toolbar",
267                                     "items" : [
268                                         {
269                                             "listeners" : {
270                                                 "|click" : "function()\n{\n    Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Page' }, function() {\n        _this.grid.getDataSource().load();\n    }); \n\n}\n        "
271                                             },
272                                             "text" : "Add",
273                                             "xtype" : "Button",
274                                             "cls" : "x-btn-text-icon",
275                                             "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
276                                             "$ xns" : "Roo"
277                                         },
278                                         {
279                                             "listeners" : {
280                                                 "|click" : "function()\n        {\n        Pman.genericDelete(_this, _this.panel.tableName); \n        }\n        "
281                                             },
282                                             "text" : "Delete",
283                                             "xtype" : "Button",
284                                             "cls" : "x-btn-text-icon",
285                                             "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
286                                             "$ xns" : "Roo"
287                                         }
288                                     ]
289                                 },
290                                 {
291                                     "xtype" : "ColumnModel",
292                                     "sortable" : false,
293                                     "width" : 50,
294                                     "header" : "",
295                                     "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\">', baseURL, v, r.data.filename); }",
296                                     "$ xns" : "Roo.grid",
297                                     "* prop" : "colModel[]",
298                                     "dataIndex" : "id"
299                                 },
300                                 {
301                                     "xtype" : "ColumnModel",
302                                     "width" : 100,
303                                     "header" : "Filename",
304                                     "$ renderer" : "function(v) { return String.format('{0}', v); }",
305                                     "$ xns" : "Roo.grid",
306                                     "* prop" : "colModel[]",
307                                     "dataIndex" : "filename"
308                                 }
309                             ]
310                         }
311                     ]
312                 },
313                 {
314                     "listeners" : {
315                         "|click" : " function() {\n\n                                    _this.form.reset();\n\n                                    _this.dialog.hide();\n\n                                }\n"
316                     },
317                     "text" : "Cancel",
318                     "xtype" : "Button",
319                     "$ xns" : "Roo",
320                     "* prop" : "buttons[]"
321                 },
322                 {
323                     "listeners" : {
324                         "|click" : " function() {\n\n                                    _this.dialog.el.mask(\"Saving\");\n _this.form.findField('contents').syncValue();\n                                    _this.form.doAction(\"submit\");\n\n                                }\n"
325                     },
326                     "text" : "OK",
327                     "xtype" : "Button",
328                     "$ xns" : "Roo",
329                     "* prop" : "buttons[]"
330                 }
331             ]
332         }
333     ]
334 }