2 "name" : "Pman.Tab.CmsBlog",
3 "parent" : "Pman.Tab.Cms",
4 "title" : "Pman.Tab.CmsBlog",
5 "path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsBlog.bjs",
9 "30a2a59b5adaa49803297d4c06e09e67" : "Displaying cms_page{0} - {1} of {2}",
10 "a517747c3d12f99244ae598910d979c5" : "Author",
11 "63a6a88c066880c5ac42394a22803ca6" : "Refresh",
12 "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
13 "0eceeb45861f9585dd7a97a3e36f85c6" : "Created",
14 "695e93e1d9db8283a9dd66782625065d" : "Child Elements",
15 "ebd9bec4d70abc789d439c1f136b0538" : "Layout",
16 "30269022e9d8f51beaabb52e5d0de2b7" : "Parent",
17 "a4863ff1cdfa709d5bf80939cd2e6757" : "T#",
18 "d7efa19fbe7d3972fd5adb6024223d74" : "C#",
19 "08d0135e24822f43171ed4944fc3bdda" : "Preview (resize by dragging next to this bar)",
20 "2cbaa804531fc7367ccc699fb1eef52a" : "Page link / Name / Order",
21 "3adbdb3ac060038aa0e6e6c138ef9873" : "Category",
22 "b8a00b5928fbead0626546550667b2b5" : "Pages, Menu and Blog Entries",
23 "c8043f5cd3d28cb76c548338497b06ab" : "Show Deleted",
24 "d645920e395fedad7bbbed0eca3fe2e0" : "40",
25 "be53a0541a6d36f6ecb879fa2c584b08" : "Image",
26 "9b9d8a976b42e0bd66381797644943d5" : "Published",
27 "b78a3223503896721cca1303f776159b" : "Title",
28 "f17755c3f16cb257f7793b9865ebafb3" : "No cms_page found",
29 "a9581db07856efb481fddef1b3e168f8" : "No page found",
30 "ce5bf551379459c1c61d2a204061c455" : "Location",
31 "0ecfa7150815d4ddb07470e3862c92c4" : "Export CMS (ZIP)",
32 "7ee49db2b46c732d681edc761cf487ae" : "Postion",
33 "5fb63579fc981698f97d55bfecb213ea" : "Copy",
34 "040dcb21af4618f18d04e667c07ef314" : "{0} - {1} of {2}",
35 "f46885d21c98f597303699f41b3d7afd" : "Ex?",
36 "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
37 "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
38 "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
39 "f7070be7ec7d2443714a2e5dc63f4de2" : "Links to",
40 "75ae2cfdf786e5577f1b619f4ca8d728" : "To replace"
44 "title" : "Pages, Menu and Blog Entries",
45 "xtype" : "NestedLayoutPanel",
49 "xtype" : "BorderLayout",
54 "xtype" : "LayoutRegion",
59 "xtype" : "LayoutRegion",
67 "Boolean collapsed" : false,
68 "String collapsedTitle" : "Child Elements",
69 "xtype" : "LayoutRegion",
72 "Boolean collapsible" : true,
74 "String title" : "Child Elements",
80 "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n \n}"
82 "bool background" : false,
85 "title" : "Pages, Menu and Blog Entries",
86 "xtype" : "GridPanel",
87 "fitContainer" : true,
89 "tableName" : "cms_page",
93 "rowdblclick" : "function (_self, rowIndex, e)\n{\n var s = this.dataSource.getAt(rowIndex);\n /* \n if (s.data.language.length) {\n Roo.log('in lang');\n _this.dialog.show({ id : s.data.parent_id } , function() {\n _this.grid.footer.onClick('refresh');\n });\n return;\n }*/\n if (s.data.is_deleted) {\n Roo.MessageBox.alert(\"Undelete this\", \"You need to un-delete this item before you can edit it\");\n return;\n }\n \n \n \n _this.dialog.show(s.data, function() {\n _this.grid.footer.onClick('refresh');\n }); \n \n}\n",
94 "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.CmsBlog;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
95 "cellclick" : "function (g, ri,ci, e)\r\n{\n var h = this.colModel.getDataIndex(ci);\n \r\n if (h != 'is_draft') {\r\n return;\r\n }\r\n var rec = g.ds.getAt(ri);\n \n if(rec.data.is_system_page * 1 == 1){\n Roo.MessageBox.alert('Error', 'You cannot de-active the system page');\n return;\n }\r\n rec.set('is_draft', rec.data.is_draft ? 0 : 1);\r\n rec.commit();\r\n}",
96 "rowclick" : "function (_self, rowIndex, e)\n{\n var s = this.dataSource.getAt(rowIndex);\n\n _this.prepanel.el.dom.innerHTML = '';\n \n if(s.data.id * 1 < 1){\n return;\r\n }\n if (s.data.is_deleted) {\n _this.deleteBtn.setText(\"Un-delete\");\n } else {\n _this.deleteBtn.setText(\"Delete\");\n } \n \n \n _this.prepanel.el.dom.src = baseURL + '/Cms/PageThumb/' + s.data.id;\n \n _this.targetData = s;\n \n _this.child_element_grid.footer.onClick('first');\n \n}"
98 "autoExpandColumn" : "title",
101 "$ xns" : "Roo.grid",
106 "update" : "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.request({\r\n method : 'POST',\r\n url : baseURL + '/Roo/Cms_page',\r\n params : {\r\n id : record.data.id,\r\n is_draft : record.data.is_draft\r\n },\n success : function(res) {\n _this.grid.footer.onClick('refresh');\n }\r\n });\n}",
107 "beforeload" : "function (_self, options)\n{\n if (Pman.building || !Pman.Tab.Cms.panel.active) {\n return false;\n }\n \n var sel = _this.category_grid.getSelectionModel().getSelected();\n \n if(!sel || sel.data.pid * 1 < 1){\n this.removeAll();\n return false;\n }\n \n options.params._with_primary_image = 1;\n \n var cm = _this.grid.colModel;\n var vis = {\n category_type_id_name : true,\n menu_page_id_title : true\n };\n \n var cm = _this.grid.getColumnModel();\n \n function cid(str) {\n return cm.getIndexByDataIndex(str);\n }\n \n options.params['search[name]'] = _this.searchBox.getValue();\n \n options.params._exclude_columns = 'body,extended';\n \n if(sel.data.type == 'page_type'){\n options.params._page_type_id = sel.data.pid;\n }\n if (sel.data.page_type > 0 ) {\n options.params._page_type_id = sel.data.page_type;\n }\n \n if(sel.data.type == 'category'){\n options.params._category_id = sel.data.pid;\n }\n \n var size = _this.image_size_sel.getValue() * 1;\n \n cm.setHidden(cid('primary_image_id'), false);\n cm.setColumnWidth(cid('primary_image_id'), size + 10);\n \n if(size == 0){\n cm.setHidden(cid('primary_image_id'), true);\n }\n \n // options.params._treeview = 1;\n options.params._pman_short = 1;\n \n options.params.translation_of_id = 0;\n \n options.params._with_translation_type = 1;\n \n //options.params._requestMeta = 1; // always fetch meta.. as different types return different data..\n \n \n switch(sel.data.name) {\n case 'page' : \n // options.params.limit = 9999;\n // _this.grid.footer.pageSize = 9999;\n vis.menu_page_id_title = false;\n cm.setHidden(cid('created'), true);\n cm.setHidden(cid('published'), true);\n cm.setHidden(cid('template_id_template'), false); \n this.sortInfo.field = 'tree_sequence'; // force sort.\n this.sortInfo.direction = 'ASC'; // force sort.\n \n break;\n case 'blog' :\n // options.params.limit = 20;\n // options.params['search[category]'] = _this.category_type.getValue();\n // _this.grid.footer.pageSize = 20;\n vis.menu_page_id_title = false;\n cm.setHidden(cid('created'), false);\n cm.setHidden(cid('published'), false);\n cm.setHidden(cid('template_id_template'), true);\n this.sortInfo.field = 'published'; // force sort.\n this.sortInfo.direction = 'DESC'; // force sort.\n \n break;\n \n case 'menu' :\n // options.params.limit = 9999;\n // _this.grid.footer.pageSize = 9999;\n vis.category_type_id_name = false;\n cm.setHidden(cid('created'), true);\n cm.setHidden(cid('published'), true);\n cm.setHidden(cid('template_id_template'), true);\n this.sortInfo.field = 'tree_sequence'; // force sort.\n this.sortInfo.direction = 'ASC'; // force sort.\n \n break;\n case 'category' :\n // options.params.limit = 20;\n // _this.grid.footer.pageSize = 20;\n vis.menu_page_id_title = false;\n cm.setHidden(cid('created'), false);\n cm.setHidden(cid('published'), false);\n cm.setHidden(cid('template_id_template'), true);\n this.sortInfo.field = 'tree_sequence'; // force sort.\n this.sortInfo.direction = 'ASC'; // force sort.\n \n break;\n }\n \n if (_this.showDeleted.pressed) {\n options.params._show_deleted = 1;\n }\n \n for (var i in vis) {\n cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);\n }\n \n}",
108 "load" : "function (_self, records, options)\n{\n _this.child_element_panel.region.collapse();\n}"
112 "$ sortInfo" : "{ field : 'created' , direction : 'DESC' }",
113 "$ xns" : "Roo.data",
114 "* prop" : "dataSource",
117 "$ url" : "baseURL + '/Roo/cms_page.php'",
118 "xtype" : "HttpProxy",
120 "$ xns" : "Roo.data",
126 "xtype" : "JsonReader",
127 "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'title',\n 'type': 'string'\n },\n {\n 'name': 'published',\n 'type': 'date',\n 'format' : 'Y-m-d H:i:s'\n },\n {\n 'name': 'body',\n 'type': 'string'\n },\n {\n 'name': 'comments_no',\n 'type': 'int'\n },\n {\n 'name': 'trackbacks_no',\n 'type': 'int'\n },\n {\n 'name': 'extended',\n 'type': 'string'\n },\n {\n 'name': 'has_extended',\n 'type': 'int'\n },\n {\n 'name': 'author_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_title',\n 'type': 'string'\n },\n {\n 'name': 'is_draft',\n 'type': 'int'\n },\n {\n 'name': 'updated',\n 'type': 'date',\n 'format' : 'Y-m-d H:i:s'\n },\n {\n 'name': 'created',\n 'type': 'date',\n 'format' : 'Y-m-d H:i:s'\n },\n {\n 'name': 'to_replace_id',\n 'type': 'int'\n },\n {\n 'name': 'page_link',\n 'type': 'string'\n },\n {\n 'name': 'in_rss',\n 'type': 'int'\n },\n {\n 'name': 'parent_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_title',\n 'type': 'string'\n },\n\n {\n 'name': 'author_id_id',\n 'type': 'int'\n },\n {\n 'name': 'author_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'author_id_name',\n 'type': 'string'\n },\n {\n 'name': 'author_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'author_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'author_id_email',\n 'type': 'string'\n },\n {\n 'name': 'author_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'author_id_role',\n 'type': 'string'\n },\n {\n 'name': 'author_id_active',\n 'type': 'int'\n },\n {\n 'name': 'author_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'author_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'author_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'author_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'author_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'author_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'author_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_parent_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_short_name',\n 'type': 'string'\n },\n {\n 'name': 'category_id_title',\n 'type': 'string'\n },\n {\n 'name': 'category_id_page_text',\n 'type': 'string'\n },\n {\n 'name': 'category_id_type',\n 'type': 'string'\n },\n {\n 'name': 'category_id_search_on',\n 'type': 'string'\n },\n {\n 'name': 'category_id_image_menu_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_image_menuover_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_image_leftactive_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_image_page_id',\n 'type': 'int'\n },\n {\n 'name': 'category_id_display_order',\n 'type': 'int'\n },\n {\n 'name': 'category_id_more_info_title',\n 'type': 'string'\n },\n {\n 'name': 'category_id_more_info_text',\n 'type': 'string'\n },\n {\n 'name': 'category_id_visible',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_id',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_title',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_published',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_body',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_comments_no',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_trackbacks_no',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_extended',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_has_extended',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_author_id',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_category_id',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_is_draft',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_updated',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_created',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_to_replace_id',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_page_link',\n 'type': 'string'\n },\n {\n 'name': 'to_replace_id_in_rss',\n 'type': 'int'\n },\n {\n 'name': 'to_replace_id_parent_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_title',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_published',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_body',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_comments_no',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_trackbacks_no',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_extended',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_has_extended',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_author_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_category_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_is_draft',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_updated',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_created',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_to_replace_id',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_page_link',\n 'type': 'string'\n },\n {\n 'name': 'parent_id_in_rss',\n 'type': 'int'\n },\n {\n 'name': 'parent_id_parent_id',\n 'type': 'int'\n }\n]",
128 "$ xns" : "Roo.data",
130 "totalProperty" : "total"
136 "xtype" : "PagingToolbar",
137 "emptyMsg" : "No cms_page found",
139 "displayMsg" : "Displaying cms_page{0} - {1} of {2}",
140 "displayInfo" : true,
145 "render" : "function (_self)\n{\n _this.showDeleted = this;\n}",
146 "click" : "function (_self, e)\n{\n _this.grid.footer.onClick.defer(100, _this.grid.footer, ['first'] );\n this.setText( this.pressed ? \"Hide Deleted\" : \"Show Deleted\");\n}"
149 "String text" : "Show Deleted",
150 "$ xns" : "Roo.Toolbar",
151 "Boolean enableToggle" : true
154 "xtype" : "Separator",
155 "$ xns" : "Roo.Toolbar"
159 "click" : "function (_self, e)\n{\n new Pman.Download({\n url: baseURL + '/Roo/Cms_page',\n newWindow : true,\n params: {\n _dump_pages : 1\n }\n });\n \n Roo.MessageBox.alert(\"Downloading\", \"The file is downloading\");\n}"
161 "text" : "Export CMS (ZIP)",
163 "$ xns" : "Roo.Toolbar"
166 "xtype" : "Separator",
167 "$ xns" : "Roo.Toolbar"
171 "|render" : "function (_self)\n{\n _this.image_size_sel = _self;\n}",
172 "|select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
174 "triggerAction" : "all",
175 "Number width" : 100,
176 "displayField" : "value",
177 "valueField" : "key",
178 "xtype" : "ComboBox",
179 "allowBlank" : false,
181 "$ xns" : "Roo.form",
186 "xtype" : "SimpleStore",
187 "$ data" : "[\n [ 40, \"Small\" ],\n [ 150, \"Medium\" ],\n [ 0, \"None\" ]\n]",
188 "$ fields" : "[ 'key', 'value']",
189 "$ xns" : "Roo.data",
199 "* prop" : "toolbar",
203 "specialkey" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}",
204 "render" : "function (_self)\n{\n_this.searchBox= _self;\n}"
206 "xtype" : "TextField",
211 "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
214 "cls" : "x-btn-icon",
215 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
216 "$ xns" : "Roo.Toolbar"
220 "|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n \n _this.grid.footer.onClick('first');\n}"
223 "cls" : "x-btn-icon",
224 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
225 "$ xns" : "Roo.Toolbar"
228 "xtype" : "Separator",
229 "$ xns" : "Roo.Toolbar"
233 "|click" : "function()\n{\n var ds = false;\n \n \n if(_this.grid.selModel.getSelections().length == 1){\n ds = _this.grid.selModel.getSelected().data;\n }\n \n var page_type_id = 0;\n var page_type_id_name = '';\n var page_type_id_display_name = '';\n \n var sel = _this.category_grid.getSelectionModel().getSelected();\n \n if(!ds && sel && sel.data.pid * 1 > 0 && sel.data.type == 'page_type'){\n page_type_id = sel.data.pid;\n page_type_id_name = sel.data.name;\n page_type_id_display_name = sel.data.display_name;\n \n if(sel.data.name == 'page'){\n page_type_id_display_name = 'Pages';\n }\n \n if(sel.data.name == 'blog'){\n page_type_id_display_name = 'Blog Entries';\n }\n \n }\n\n /*\n var s = _this.page_type.selectedData;\n \n if(!ds){\n page_type_id = s.id;\n page_type_id_name = s.name;\n page_type_id_display_name = s.display_name;\n \n if(s.name == 'page'){\n page_type_id_display_name = 'Pages';\n }\n }\n */\n \n var q = {\n id : 0,\n parent_id : ds ? ds.id : '',\n parent_id_title : ds ? ds.title : '',\n page_link : ds && !ds.is_element ? (ds.page_link + '/') : '',\n page_type_id : ds ? ds.page_type_id : page_type_id,\n page_type_id_name : ds ? ds.page_type_id_name : page_type_id_name,\n page_type_id_display_name : ds ? ds.page_type_id_display_name : page_type_id_display_name\n };\n \n _this.dialog.show( q, function() {\n _this.grid.footer.onClick('first');\n });\n}\n"
237 "cls" : "x-btn-text-icon",
238 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
239 "$ xns" : "Roo.Toolbar"
242 "xtype" : "Separator",
243 "$ xns" : "Roo.Toolbar"
247 "|click" : "function()\n{\n var s = _this.grid.selModel.getSelections();\n \n if(_this.grid.selModel.getSelections().length != 1){\n Roo.MessageBox.alert('Error', 'Please select one row to copy');\n return;\n }\n \n var sel = _this.grid.selModel.getSelected();\n \n if(!sel || sel.data.id * 1 < 1){\n Roo.MessageBox.alert('Error', 'Please select one row to copy');\n return;\n }\n \n var editIt = function() {\n new Pman.Request({\n url : baseURL + '/Roo/cms_page.php',\n method : 'GET',\n params : {\n _id : sel.data.id\n }, \n success : function(res) {\n \n var params = Roo.apply({}, res.data);\n \n params.id = 0;\n params._is_copy = 1;\n \n if(params.page_link.length){\n params.page_link = params.page_link + '-copy';\n }\n \n if(params.title.length){\n params.title = 'Copy of ' + params.title;\n }\n \n _this.dialog.show( params, function() {\n _this.grid.footer.onClick('first');\n });\n }\n });\n }\n \n var copyIt = function() {\n \n new Pman.Request({\n url : baseURL + '/Roo/cms_page.php',\n method : 'POST',\n params : {\n _copy_of : sel.data.id\n }, \n success : function(res) {\n \n Roo.log(res);\n \n _this.dialog.show( { id : res.data }, function() {\n _this.grid.footer.onClick('first');\n });\n \n }\n });\n \n }\n \n Roo.MessageBox.confirm(\n \"Confirm\", \n \"Are you wish to copy the child elements as well?\", \n function(res) {\n if(res != 'yes') {\n editIt();\n return;\n }\n \n copyIt();\n \n return;\n }\n );\n \n \n}\n"
251 "cls" : "x-btn-text-icon",
252 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
253 "$ xns" : "Roo.Toolbar"
257 "$ xns" : "Roo.Toolbar"
261 "|click" : "function()\n{\n var ds = false;\n if(_this.grid.selModel.getSelections().length != 1){\n Roo.MessageBox.alert(\"Error\", \"Select page to delete\");\n return;\n }\n var sel = _this.grid.selModel.getSelected();\n if(sel.data.is_system_page){\n Roo.MessageBox.alert(\"Error\", \"System pages can not be deleted.\");\n return;\n }\n \n if (!sel.data.is_deleted) {\n Roo.MessageBox.confirm(\"Confirm\", \n \"Are you sure you want to delete this, - to un-delete, select 'Show Deleted' at bottom, select this item and press this button again\", \n function(res) {\n if (res != 'yes') {\n return;\n }\n new Pman.Request({\n method : 'POST',\n mask : \"Deleting\",\n url : baseURL + '/Roo/cms_page',\n params : {\n id : sel.data.id,\n is_deleted : 1 \n },\n success : function() { \n _this.grid.footer.onClick('refresh');\n }\n });\n \n \n }\n );\n return;\n }\n \n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/cms_page',\n mask: 'Un-deleting',\n params : {\n id : sel.data.id,\n is_deleted : 0\n },\n success : function() { \n _this.grid.footer.onClick('refresh');\n }\n });\n \n}\n",
262 "render" : "function (_self)\n{\n _this.deleteBtn = this;\n}"
266 "cls" : "x-btn-text-icon",
267 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
268 "$ xns" : "Roo.Toolbar"
273 "xtype" : "ColumnModel",
276 "$ renderer" : "function(v,x,r) {\n \n if (r.data.is_deleted) {\n return 'DELETED';\n }\n \n var state = v> 0 ? '' : '-checked';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n}",
277 "$ xns" : "Roo.grid",
278 "* prop" : "colModel[]",
279 "dataIndex" : "is_draft"
282 "xtype" : "ColumnModel",
286 "$ renderer" : "function(v,x,r) \n{ \n var size = _this.image_size_sel.getValue() * 1;\n \n if(v * 1 < 1 || size == 0){\n return;\n }\n \n return String.format('<img src=\"{0}/Images/Thumb/{1}/{2}\" width=\"{1}\" height=\"{3}\">', \n baseURL, size, v, Math.floor(size*0.6)); \n}",
287 "$ xns" : "Roo.grid",
288 "* prop" : "colModel[]",
289 "dataIndex" : "primary_image_id"
292 "xtype" : "ColumnModel",
294 "header" : "Created",
295 "$ renderer" : "function(v) { return v? v.format('d/M/Y') : '--' }",
296 "$ xns" : "Roo.grid",
297 "* prop" : "colModel[]",
298 "dataIndex" : "created"
301 "xtype" : "ColumnModel",
303 "header" : "Published",
304 "$ renderer" : "function(v,x,r) { \n if (r.data.is_draft) { \n return '[DRAFT]';\n }\n\n return v? v.format('d/M/Y') : '--' \n}",
305 "$ xns" : "Roo.grid",
306 "* prop" : "colModel[]",
307 "dataIndex" : "published"
310 "xtype" : "ColumnModel",
312 "header" : "Page link / Name / Order",
313 "$ renderer" : "function(v,x,r) { \n\n if (r.data.page_type_id_name == 'page') {\n return String.format('{0}', v); \n \n }\n \n if (r.data.page_type_id_name == 'blog') {\n return String.format('{0}', v); \n }\n // what about categories.??\n \n // menu, or elements.. ??\n \n var d = r.json.depth || 0;\n var pr = ''; \n for (i = 0; i < d; i++) {\n pr += ' .. ';\n }\n if (r.data.page_type_id_name == 'element') { \n return String.format('{0}<i>{1}</i>', pr, v); \n }\n // menu..\n return String.format('{0}{1}', pr, v);\n \n \n}",
314 "$ xns" : "Roo.grid",
315 "* prop" : "colModel[]",
316 "dataIndex" : "page_link"
319 "xtype" : "ColumnModel",
322 "$ renderer" : "function(v,x,r) { \n\n var d = r.json.tree_depth || 0;\n var pr = ''; \n for (i = 0; i < d; i++) {\n pr += ' .. ';\n }\n \n var fmt = '<span style=\"color:blue\">{2}{3}</span>' + \n (r.data.is_draft ? '<s>{0}</s> <b style=\"color:#a94442;\">{1}</b>' : '{0} <b style=\"color:#a94442;\">{1}</b>');\n \n return String.format( fmt,\n pr + v,\n (r.data.has_child * 1 > 0) ? '[has child]' : '',\n \n (r.data.page_type_id_name == 'menu' ? '('+r.data.seq_id +')' : ''),\n (r.data.category_page_id *1 ? ( '[' + r.data.category_page_id_title +'] ' ): '')\n );\n \n }",
323 "$ xns" : "Roo.grid",
324 "* prop" : "colModel[]",
325 "dataIndex" : "title"
328 "xtype" : "ColumnModel",
331 "$ renderer" : "function(v) { return String.format('{0}', v || ''); }",
332 "$ xns" : "Roo.grid",
333 "* prop" : "colModel[]",
334 "dataIndex" : "template_id_template"
337 "xtype" : "ColumnModel",
340 "$ renderer" : "function(v, x, r) \n{\n var ret = [];\n \n if (r.data.language.length) {\n ret.push('>> ' + Pman.I18n.toName('l', r.data.language));\n }\n \n if(r.data.translation_type.length){\n \n var types = r.data.translation_type.split(',');\n \n Roo.each(types, function(t){\n ret.push('>> ' + Pman.I18n.toName('l', t));\n });\n }\n \n return ret.join(\"<br/>\");\n \n /*\n if (r.data.language.length) {\n return '>> ' + Pman.I18n.toName('l', r.data.language);\n }\n */\n \n /* if (r.data.in_rss) {\n return String.format('{0}', v); \n }\n if (r.data.is_element) {\n return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : ''); \n }\n */\n\n}",
341 "$ xns" : "Roo.grid",
342 "* prop" : "colModel[]",
343 "dataIndex" : "category_type_id_name"
346 "xtype" : "ColumnModel",
348 "header" : "Links to",
349 "$ renderer" : "function(v,x,r) { \n\n if (r.data.is_attachment) {\n return \"[ATTACHMENT]\";\n }\n return String.format('{0}', v); \n }",
350 "$ xns" : "Roo.grid",
351 "* prop" : "colModel[]",
352 "dataIndex" : "menu_page_id_title"
355 "xtype" : "ColumnModel",
358 "$ renderer" : "function(v) { return String.format('{0}', v); }",
359 "$ xns" : "Roo.grid",
360 "* prop" : "colModel[]",
361 "dataIndex" : "author_id_name"
365 "xtype" : "ColumnModel",
368 "$ renderer" : "function(v) { return String.format('{0}', v || ''); }",
369 "$ xns" : "Roo.grid",
370 "* prop" : "colModel[]",
371 "dataIndex" : "parent_id_title"
375 "xtype" : "ColumnModel",
376 "header" : "To replace",
378 "$ renderer" : "function(v) { return String.format('{0}', v); }",
379 "$ xns" : "Roo.grid",
380 "* prop" : "colModel[]",
381 "dataIndex" : "to_replace_id_title"
384 "xtype" : "ColumnModel",
387 "$ renderer" : "function(v) { return String.format('{0}', v); }",
388 "$ xns" : "Roo.grid",
389 "* prop" : "colModel[]",
390 "dataIndex" : "has_extended"
394 "xtype" : "ColumnModel",
397 "$ renderer" : "function(v) { return String.format('{0}', v); }",
398 "$ xns" : "Roo.grid",
399 "* prop" : "colModel[]",
400 "dataIndex" : "trackbacks_no"
403 "xtype" : "ColumnModel",
406 "$ renderer" : "function(v) { return String.format('{0}', v); }",
407 "$ xns" : "Roo.grid",
408 "* prop" : "colModel[]",
409 "dataIndex" : "comments_no"
412 "xtype" : "ColumnModel",
413 "header" : "Postion",
415 "$ renderer" : "function(v,x,r) \n{ \n \n return v *1;\n \n}",
416 "$ xns" : "Roo.grid",
417 "* prop" : "colModel[]",
418 "Boolean hidden" : true,
419 "dataIndex" : "seq_id"
426 "Boolean fitContainer" : true,
427 "xtype" : "NestedLayoutPanel",
428 "Boolean fitToFrame" : true,
430 "String region" : "west",
431 "Boolean background" : false,
434 "xtype" : "BorderLayout",
439 "Boolean titlebar" : false,
440 "xtype" : "LayoutRegion",
445 "xtype" : "LayoutRegion",
446 "Number height" : 300,
449 "Boolean split" : true
453 "|activate" : "function() {\n\n _this.category_panel = this;\n \n if (_this.category_grid) {\n _this.category_grid.ds.load({});\n }\n}"
455 "bool background" : true,
458 "title" : "Category",
459 "xtype" : "GridPanel",
460 "fitContainer" : true,
462 "Boolean autoScroll" : false,
463 "tableName" : "cms_page_category",
467 "|render" : "function() \n{\n _this.category_grid = this; \n \n if (_this.category_panel.active) {\n this.ds.load({});\n }\n}"
469 "autoExpandColumn" : "display_name",
472 "$ xns" : "Roo.grid",
477 "afterselectionchange" : "function (_self)\n{\n _this.grid.footer.onClick('first');\n}"
479 "Boolean singleSelect" : true,
480 "xtype" : "RowSelectionModel",
481 "$ xns" : "Roo.grid",
487 "* prop" : "toolbar",
491 "click" : "function (_self, e)\n{\n _this.category_grid.ds.load({});\n}"
494 "String text" : "Refresh",
495 "$ xns" : "Roo.Toolbar"
501 "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n o.params._category_list = 1;\n}"
505 "$ sortInfo" : "{ field : 'category_id' , direction : 'ASC' }",
506 "$ xns" : "Roo.data",
507 "* prop" : "dataSource",
510 "$ url" : "baseURL + '/Roo/cms_page_category.php'",
512 "xtype" : "HttpProxy",
513 "$ xns" : "Roo.data",
519 "xtype" : "JsonReader",
520 "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'pid',\n 'type': 'int'\n },\n {\n 'name': 'display_name',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'string'\n },\n {\n 'name': 'page_type',\n 'type': 'int'\n },\n {\n 'name': 'category_id_is_draft',\n 'type': 'int'\n }\n]",
521 "$ xns" : "Roo.data",
523 "totalProperty" : "total"
528 "xtype" : "ColumnModel",
529 "header" : "Category",
531 "$ renderer" : "function(v,x,r) \n{ \n if(r.data.category_id_is_draft * 1 == 1){\n return String.format('<span style=\"text-decoration:line-through\">{0}</span>', v ? v : ''); \n }\n \n return String.format('{0}', v ? v : '');\n}",
532 "$ xns" : "Roo.grid",
533 "* prop" : "colModel[]",
534 "dataIndex" : "display_name"
542 "render" : "function (_self)\n{\n _this.prepanel = _self;\n \n this.el.dom.onload = function(){\n \n if(\n !_this.targetData || \n !_this.targetData.data.page_link.length ||\n !uiConfig || \n typeof(uiConfig.cms_page_preview_base) == 'undefined'\n ){\n return;\n }\n \n Roo.get(this.contentDocument.body).on('click', function(){\n var url = uiConfig.cms_page_preview_base + _this.targetData.data.page_link;\n window.open(url);\n });\n }\n}"
544 "$ Boolean/Object autoCreate" : "{ tag: 'iframe', src : 'about:blank' }",
547 "title" : "Preview (resize by dragging next to this bar)",
548 "xtype" : "ContentPanel",
549 "fitContainer" : true,
558 "|activate" : "function() {\n _this.child_element_panel = this;\n if (_this.child_element_grid) {\n //_this.child_element_grid.footer.onClick('first');\n }\n \n}"
560 "bool background" : false,
563 "title" : "Child Elements",
564 "xtype" : "GridPanel",
565 "fitContainer" : true,
567 "tableName" : "cms_page",
571 "rowdblclick" : "function (_self, rowIndex, e)\n{\n var s = this.dataSource.getAt(rowIndex);\n \n _this.dialog.show(s.data, function() {\n _this.child_element_grid.footer.onClick('refresh');\n }); \n \n}\n",
572 "cellclick" : "function (g, ri,ci, e)\r\n{\n var h = this.colModel.getDataIndex(ci);\n \n \n if(h == 'seq_id'){\n _this.child_element_grid.trigger_link_click(g, ri, ci, e);\n return;\n }\n \n \r\n if (h != 'is_draft') {\r\n return;\r\n }\n \r\n var rec = g.ds.getAt(ri);\n \r\n rec.set('is_draft', rec.data.is_draft ? 0 : 1);\r\n rec.commit();\n \r\n}",
573 "|render" : "function() \n{\n _this.child_element_grid = this; \n if (_this.child_element_panel.active) {\n // this.footer.onClick('first');\n }\n}"
575 "autoExpandColumn" : "title",
576 "| function trigger_link_click" : "function(g, rowIndex, columnIndex, e) \n{ \n e.preventDefault();\n \n var target = e.getTarget();\n \n if(target.nodeName.toLowerCase() != 'a'){\n return;\n }\n \n var rec = _this.grid.ds.getAt(rowIndex);\n \n var el = Roo.get(target);\n \n if(!el.hasClass('down') && !el.hasClass('up')){\n return;\n }\n \n var s = this.dataSource.getAt(rowIndex);\n \n if(!s || s.data.id * 1 < 1){\n return;\n }\n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/cms_page',\n params : {\n id : s.data.id,\n _move : el.hasClass('down') ? 'down' : 'up'\n },\n success : function() { \n _this.child_element_grid.footer.onClick('refresh');\n }\n });\n \n return;\n \n}",
579 "$ xns" : "Roo.grid",
583 "Boolean singleSelect" : true,
584 "xtype" : "RowSelectionModel",
585 "$ xns" : "Roo.grid",
590 "update" : "function (_self, record, operation)\n{\n if (operation != 'commit') {\n return;\n }\n // only used to change active status.\n \n new Pman.request({\r\n method : 'POST',\r\n url : baseURL + '/Roo/Cms_page',\r\n params : {\r\n id : record.data.id,\r\n is_draft : record.data.is_draft\r\n },\n success : function(res) {\n _this.child_element_grid.footer.onClick('refresh');\n }\r\n });\n}",
591 "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n \n var sel = _this.grid.selModel.getSelected();\n \n if(\n !sel || \n sel.data.id * 1< 1 || \n sel.data.page_type_id_name != 'page' ||\n sel.data.template_id * 1 < 1 ||\n sel.data.has_child_element_type * 1 < 1\n ){\n this.removeAll();\n \n _this.child_element_panel.region.collapse();\n \n return false;\n }\n \n _this.child_element_panel.region.expand();\n \n options.params._list_elements = sel.data.id;\n \n if (_this.child_show_deleted.pressed) {\n options.params._show_deleted = 1;\n }\n \n}"
595 "$ sortInfo" : "{ field : 'created' , direction : 'DESC' }",
596 "$ xns" : "Roo.data",
597 "* prop" : "dataSource",
600 "$ url" : "baseURL + '/Roo/cms_page.php'",
602 "xtype" : "HttpProxy",
603 "$ xns" : "Roo.data",
609 "xtype" : "JsonReader",
610 "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'title',\n 'type': 'string'\n },\n {\n 'name': 'element_id_name',\n 'type': 'string'\n },\n {\n 'name': 'seq_id',\n 'type': 'int'\n },\n {\n 'name': 'is_draft',\n 'type': 'int'\n },\n {\n 'name': 'is_deleted',\n 'type': 'int'\n },\n {\n 'name': 'language',\n 'type': 'string'\n },\n {\n 'name': 'translation_type',\n 'type': 'string'\n },\n {\n 'name': 'primary_image_id',\n 'type': 'int'\n }\n]",
611 "$ xns" : "Roo.data",
613 "totalProperty" : "total"
620 "* prop" : "toolbar",
624 "|click" : "function()\n{\n var s = _this.grid.selModel.getSelected();\n \n if(!s || s.data.id * 1 < 1 || s.data.template_id * 1 < 1){\n Roo.MessageBox.alert('Error', 'Please select a page');\n return;\n }\n \n Pman.Dialog.AddChildElementToPage.show({\n template_id : s.data.template_id\n }, function(res) {\n \n var params = {\n id : 0,\n element_id : res.element_id,\n element_id_name : res.element_id_name,\n page_type_id : s.data.element_page_type_id,\n page_type_id_name : 'element',\n page_type_id_display_name : 'Elements',\n parent_id : s.data.id,\n parent_id_title : s.data.title\n };\n \n _this.dialog.show( params, function() {\n _this.grid.footer.onClick('first');\n });\n \n });\n \n \n}\n"
628 "cls" : "x-btn-text-icon",
629 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
630 "$ xns" : "Roo.Toolbar"
634 "$ xns" : "Roo.Toolbar"
638 "|click" : "function()\n{\n var sel = _this.child_element_grid.selModel.getSelected();\n \n if(!sel || sel.data.id * 1< 1){\n Roo.MessageBox.alert(\"Error\", \"Select page to delete\");\n return;\n }\n \n new Pman.Request({\n method : 'POST',\n url : baseURL + '/Roo/cms_page',\n params : {\n id : sel.data.id,\n is_deleted : 1\n },\n success : function() { \n _this.child_element_grid.footer.onClick('refresh');\n }\n });\n}\n"
642 "cls" : "x-btn-text-icon",
643 "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
644 "$ xns" : "Roo.Toolbar"
650 "xtype" : "PagingToolbar",
651 "emptyMsg" : "No page found",
653 "displayMsg" : "{0} - {1} of {2}",
654 "displayInfo" : true,
659 "render" : "function (_self)\n{\n _this.child_show_deleted = this;\n}",
660 "click" : "function (_self, e)\n{\n _this.child_element_grid.footer.onClick.defer(100, _this.child_element_grid.footer, ['first'] );\n this.setText( this.pressed ? \"Hide Deleted\" : \"Show Deleted\");\n}"
663 "String text" : "Show Deleted",
664 "$ xns" : "Roo.Toolbar",
665 "Boolean enableToggle" : true
670 "xtype" : "ColumnModel",
673 "$ renderer" : "function(v,x,r) \n{ \n if(!v){\n return '';\n }\n \n return String.format('<img src=\"{0}/Images/Thumb/40/{1}\" width=\"40\">', baseURL, v); \n}",
674 "$ xns" : "Roo.grid",
676 "dataIndex" : "primary_image_id"
679 "xtype" : "ColumnModel",
682 "$ renderer" : "function(v,x,r) {\n \n var state = v> 0 ? '' : '-checked';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n}",
683 "$ xns" : "Roo.grid",
685 "dataIndex" : "is_draft"
688 "xtype" : "ColumnModel",
689 "header" : "Location",
691 "$ renderer" : "function(v,x,r) { \n\n var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');\n \n return String.format( fmt, v);\n }",
692 "$ xns" : "Roo.grid",
694 "dataIndex" : "element_id_name"
697 "xtype" : "ColumnModel",
700 "$ renderer" : "function(v,x,r) { \n\n var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');\n \n return String.format( fmt, v);\n }",
701 "$ xns" : "Roo.grid",
703 "dataIndex" : "title"
706 "xtype" : "ColumnModel",
709 "$ renderer" : "function(v, x, r) \n{\n var ret = [];\n \n if (r.data.language.length) {\n ret.push('>> ' + Pman.I18n.toName('l', r.data.language));\n }\n \n if(r.data.translation_type.length){\n \n var types = r.data.translation_type.split(',');\n \n Roo.each(types, function(t){\n ret.push('>> ' + Pman.I18n.toName('l', t));\n });\n }\n \n return ret.join(\"<br/>\");\n \n}",
710 "$ xns" : "Roo.grid",
712 "dataIndex" : "language"
715 "xtype" : "ColumnModel",
716 "header" : "Postion",
718 "$ renderer" : "function(v,x,r) \n{ \n \n var fmt = String.format(\n '<a href=\"#\" class=\"down\" style=\"font-weight: bold; font-size: 20px; text-decoration: none;\" tooltip=\"Down\">↑</a>' +\n '<a href=\"#\" class=\"up\" style=\"font-weight: bold; font-size: 20px; text-decoration: none; margin-left: 15px;\" tooltip=\"Up\">↓</a>'\n );\n \n return fmt;\n \n}",
719 "$ xns" : "Roo.grid",
721 "dataIndex" : "seq_id"
724 "xtype" : "ColumnModel",
726 "header" : "Postion",
727 "$ renderer" : "function(v,x,r) \n{ \n \n return v *1;\n \n}",
728 "$ xns" : "Roo.grid",
730 "Boolean hidden" : true,
731 "dataIndex" : "seq_id"