{
"name" : "Pman.Tab.CmsBlog",
"parent" : "Pman.Tab.Cms",
"title" : "Pman.Tab.CmsBlog",
"path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsBlog.bjs",
"permname" : "",
"modOrder" : "001",
"strings" : {
"30a2a59b5adaa49803297d4c06e09e67" : "Displaying cms_page{0} - {1} of {2}",
"a517747c3d12f99244ae598910d979c5" : "Author",
"63a6a88c066880c5ac42394a22803ca6" : "Refresh",
"ec211f7c20af43e742bf2570c3cb84f9" : "Add",
"0eceeb45861f9585dd7a97a3e36f85c6" : "Created",
"695e93e1d9db8283a9dd66782625065d" : "Child Elements",
"ebd9bec4d70abc789d439c1f136b0538" : "Layout",
"30269022e9d8f51beaabb52e5d0de2b7" : "Parent",
"a4863ff1cdfa709d5bf80939cd2e6757" : "T#",
"d7efa19fbe7d3972fd5adb6024223d74" : "C#",
"08d0135e24822f43171ed4944fc3bdda" : "Preview (resize by dragging next to this bar)",
"2cbaa804531fc7367ccc699fb1eef52a" : "Page link / Name / Order",
"3adbdb3ac060038aa0e6e6c138ef9873" : "Category",
"b8a00b5928fbead0626546550667b2b5" : "Pages, Menu and Blog Entries",
"c8043f5cd3d28cb76c548338497b06ab" : "Show Deleted",
"d645920e395fedad7bbbed0eca3fe2e0" : "40",
"be53a0541a6d36f6ecb879fa2c584b08" : "Image",
"9b9d8a976b42e0bd66381797644943d5" : "Published",
"b78a3223503896721cca1303f776159b" : "Title",
"f17755c3f16cb257f7793b9865ebafb3" : "No cms_page found",
"a9581db07856efb481fddef1b3e168f8" : "No page found",
"ce5bf551379459c1c61d2a204061c455" : "Location",
"0ecfa7150815d4ddb07470e3862c92c4" : "Export CMS (ZIP)",
"7ee49db2b46c732d681edc761cf487ae" : "Postion",
"5fb63579fc981698f97d55bfecb213ea" : "Copy",
"040dcb21af4618f18d04e667c07ef314" : "{0} - {1} of {2}",
"f46885d21c98f597303699f41b3d7afd" : "Ex?",
"f2a6c498fb90ee345d997f888fce3b18" : "Delete",
"4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
"a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
"f7070be7ec7d2443714a2e5dc63f4de2" : "Links to",
"75ae2cfdf786e5577f1b619f4ca8d728" : "To replace"
},
"items" : [
{
"title" : "Pages, Menu and Blog Entries",
"xtype" : "NestedLayoutPanel",
"$ xns" : "Roo",
"items" : [
{
"xtype" : "BorderLayout",
"$ xns" : "Roo",
"* prop" : "layout",
"items" : [
{
"xtype" : "LayoutRegion",
"$ xns" : "Roo",
"* prop" : "center"
},
{
"xtype" : "LayoutRegion",
"width" : 320,
"$ xns" : "Roo",
"split" : true,
"titlebar" : false,
"* prop" : "west"
},
{
"Boolean collapsed" : false,
"xtype" : "LayoutRegion",
"String collapsedTitle" : "Child Elements",
"width" : 500,
"$ xns" : "Roo",
"Boolean collapsible" : true,
"split" : true,
"String title" : "Child Elements",
"titlebar" : true,
"* prop" : "east"
},
{
"listeners" : {
"|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n \n}"
},
"bool background" : false,
"fitToframe" : true,
"region" : "center",
"title" : "Pages, Menu and Blog Entries",
"xtype" : "GridPanel",
"fitContainer" : true,
"$ xns" : "Roo",
"tableName" : "cms_page",
"items" : [
{
"listeners" : {
"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",
"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}",
"|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}",
"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}"
},
"autoExpandColumn" : "title",
"xtype" : "Grid",
"loadMask" : true,
"$ xns" : "Roo.grid",
"* prop" : "grid",
"items" : [
{
"listeners" : {
"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}",
"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}",
"load" : "function (_self, records, options)\n{\n _this.child_element_panel.region.collapse();\n}"
},
"xtype" : "Store",
"remoteSort" : true,
"$ sortInfo" : "{ field : 'created' , direction : 'DESC' }",
"$ xns" : "Roo.data",
"* prop" : "dataSource",
"items" : [
{
"$ url" : "baseURL + '/Roo/cms_page.php'",
"method" : "GET",
"xtype" : "HttpProxy",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
{
"id" : "id",
"root" : "data",
"xtype" : "JsonReader",
"$ 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]",
"$ xns" : "Roo.data",
"* prop" : "reader",
"totalProperty" : "total"
}
]
},
{
"pageSize" : 25,
"xtype" : "PagingToolbar",
"emptyMsg" : "No cms_page found",
"$ xns" : "Roo",
"displayMsg" : "Displaying cms_page{0} - {1} of {2}",
"displayInfo" : true,
"* prop" : "footer",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.showDeleted = this;\n}",
"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}"
},
"xtype" : "Button",
"String text" : "Show Deleted",
"$ xns" : "Roo.Toolbar",
"Boolean enableToggle" : true
},
{
"xtype" : "Separator",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"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}"
},
"text" : "Export CMS (ZIP)",
"xtype" : "Button",
"$ xns" : "Roo.Toolbar"
},
{
"xtype" : "Separator",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|render" : "function (_self)\n{\n _this.image_size_sel = _self;\n}",
"|select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
},
"triggerAction" : "all",
"Number width" : 100,
"displayField" : "value",
"valueField" : "key",
"xtype" : "ComboBox",
"allowBlank" : false,
"editable" : false,
"$ xns" : "Roo.form",
"Mixed value" : 40,
"mode" : "local",
"items" : [
{
"xtype" : "SimpleStore",
"$ data" : "[\n [ 40, \"Small\" ],\n [ 150, \"Medium\" ],\n [ 0, \"None\" ]\n]",
"$ fields" : "[ 'key', 'value']",
"$ xns" : "Roo.data",
"* prop" : "store"
}
]
}
]
},
{
"xtype" : "Toolbar",
"$ xns" : "Roo",
"* prop" : "toolbar",
"items" : [
{
"listeners" : {
"specialkey" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}",
"render" : "function (_self)\n{\n_this.searchBox= _self;\n}"
},
"xtype" : "TextField",
"$ xns" : "Roo.form"
},
{
"listeners" : {
"|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
},
"xtype" : "Button",
"cls" : "x-btn-icon",
"$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n \n _this.grid.footer.onClick('first');\n}"
},
"xtype" : "Button",
"cls" : "x-btn-icon",
"$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
"$ xns" : "Roo.Toolbar"
},
{
"xtype" : "Separator",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|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"
},
"text" : "Add",
"xtype" : "Button",
"cls" : "x-btn-text-icon",
"$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
"$ xns" : "Roo.Toolbar"
},
{
"xtype" : "Separator",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|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"
},
"text" : "Copy",
"xtype" : "Button",
"cls" : "x-btn-text-icon",
"$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
"$ xns" : "Roo.Toolbar"
},
{
"xtype" : "Fill",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|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",
"render" : "function (_self)\n{\n _this.deleteBtn = this;\n}"
},
"text" : "Delete",
"xtype" : "Button",
"cls" : "x-btn-text-icon",
"$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
"$ xns" : "Roo.Toolbar"
}
]
},
{
"xtype" : "ColumnModel",
"header" : "Active",
"width" : 75,
"$ 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 '';\n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "is_draft"
},
{
"xtype" : "ColumnModel",
"sortable" : false,
"header" : "Image",
"width" : 75,
"$ 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('', \n baseURL, size, v, Math.floor(size*0.6)); \n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "primary_image_id"
},
{
"xtype" : "ColumnModel",
"header" : "Created",
"width" : 75,
"$ renderer" : "function(v) { return v? v.format('d/M/Y') : '--' }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "created"
},
{
"xtype" : "ColumnModel",
"header" : "Published",
"width" : 75,
"$ 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}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "published"
},
{
"xtype" : "ColumnModel",
"header" : "Page link / Name / Order",
"width" : 150,
"$ 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}{1}', pr, v); \n }\n // menu..\n return String.format('{0}{1}', pr, v);\n \n \n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "page_link"
},
{
"xtype" : "ColumnModel",
"header" : "Title",
"width" : 200,
"$ 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 = '{2}{3}' + \n (r.data.is_draft ? '{0} {1}' : '{0} {1}');\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 }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "title"
},
{
"xtype" : "ColumnModel",
"header" : "Layout",
"width" : 75,
"$ renderer" : "function(v) { return String.format('{0}', v || ''); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "template_id_template"
},
{
"xtype" : "ColumnModel",
"header" : "Type",
"width" : 100,
"$ 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(\"
\");\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}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "category_type_id_name"
},
{
"xtype" : "ColumnModel",
"header" : "Links to",
"width" : 200,
"$ renderer" : "function(v,x,r) { \n\n if (r.data.is_attachment) {\n return \"[ATTACHMENT]\";\n }\n return String.format('{0}', v); \n }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "menu_page_id_title"
},
{
"xtype" : "ColumnModel",
"header" : "Author",
"width" : 75,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "author_id_name"
},
{
"hidden" : true,
"xtype" : "ColumnModel",
"header" : "Parent",
"width" : 75,
"$ renderer" : "function(v) { return String.format('{0}', v || ''); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "parent_id_title"
},
{
"hidden" : true,
"xtype" : "ColumnModel",
"header" : "To replace",
"width" : 75,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "to_replace_id_title"
},
{
"xtype" : "ColumnModel",
"header" : "Ex?",
"width" : 25,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "has_extended"
},
{
"hidden" : true,
"xtype" : "ColumnModel",
"header" : "T#",
"width" : 25,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "trackbacks_no"
},
{
"xtype" : "ColumnModel",
"header" : "C#",
"width" : 25,
"$ renderer" : "function(v) { return String.format('{0}', v); }",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "comments_no"
},
{
"xtype" : "ColumnModel",
"width" : 50,
"header" : "Postion",
"$ renderer" : "function(v,x,r) \n{ \n \n return v *1;\n \n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"Boolean hidden" : true,
"dataIndex" : "seq_id"
}
]
}
]
},
{
"Boolean fitContainer" : true,
"xtype" : "NestedLayoutPanel",
"Boolean fitToFrame" : true,
"$ xns" : "Roo",
"String region" : "west",
"Boolean background" : false,
"items" : [
{
"xtype" : "BorderLayout",
"$ xns" : "Roo",
"* prop" : "layout",
"items" : [
{
"Boolean titlebar" : false,
"xtype" : "LayoutRegion",
"$ xns" : "Roo",
"* prop" : "center"
},
{
"xtype" : "LayoutRegion",
"Number height" : 300,
"$ xns" : "Roo",
"* prop" : "south",
"Boolean split" : true
},
{
"listeners" : {
"|activate" : "function() {\n\n _this.category_panel = this;\n \n if (_this.category_grid) {\n _this.category_grid.ds.load({});\n }\n}"
},
"bool background" : true,
"region" : "center",
"fitToframe" : true,
"title" : "Category",
"xtype" : "GridPanel",
"fitContainer" : true,
"$ xns" : "Roo",
"Boolean autoScroll" : false,
"tableName" : "cms_page_category",
"items" : [
{
"listeners" : {
"|render" : "function() \n{\n _this.category_grid = this; \n \n if (_this.category_panel.active) {\n this.ds.load({});\n }\n}"
},
"autoExpandColumn" : "display_name",
"xtype" : "Grid",
"loadMask" : true,
"$ xns" : "Roo.grid",
"* prop" : "grid",
"items" : [
{
"listeners" : {
"afterselectionchange" : "function (_self)\n{\n _this.grid.footer.onClick('first');\n}"
},
"Boolean singleSelect" : true,
"xtype" : "RowSelectionModel",
"$ xns" : "Roo.grid",
"* prop" : "sm"
},
{
"xtype" : "Toolbar",
"$ xns" : "Roo",
"* prop" : "toolbar",
"items" : [
{
"listeners" : {
"click" : "function (_self, e)\n{\n _this.category_grid.ds.load({});\n}"
},
"xtype" : "Button",
"String text" : "Refresh",
"$ xns" : "Roo.Toolbar"
}
]
},
{
"listeners" : {
"beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n \n o.params._category_list = 1;\n}"
},
"xtype" : "Store",
"remoteSort" : true,
"$ sortInfo" : "{ field : 'category_id' , direction : 'ASC' }",
"$ xns" : "Roo.data",
"* prop" : "dataSource",
"items" : [
{
"$ url" : "baseURL + '/Roo/cms_page_category.php'",
"xtype" : "HttpProxy",
"method" : "GET",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
{
"id" : "id",
"root" : "data",
"xtype" : "JsonReader",
"$ 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]",
"$ xns" : "Roo.data",
"* prop" : "reader",
"totalProperty" : "total"
}
]
},
{
"xtype" : "ColumnModel",
"width" : 200,
"header" : "Category",
"$ renderer" : "function(v,x,r) \n{ \n if(r.data.category_id_is_draft * 1 == 1){\n return String.format('{0}', v ? v : ''); \n }\n \n return String.format('{0}', v ? v : '');\n}",
"$ xns" : "Roo.grid",
"* prop" : "colModel[]",
"dataIndex" : "display_name"
}
]
}
]
},
{
"listeners" : {
"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}"
},
"$ Boolean/Object autoCreate" : "{ tag: 'iframe', src : 'about:blank' }",
"region" : "south",
"fitToFrame" : true,
"title" : "Preview (resize by dragging next to this bar)",
"xtype" : "ContentPanel",
"fitContainer" : true,
"$ xns" : "Roo"
}
]
}
]
},
{
"listeners" : {
"|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}"
},
"bool background" : false,
"region" : "east",
"fitToframe" : true,
"title" : "Child Elements",
"xtype" : "GridPanel",
"fitContainer" : true,
"$ xns" : "Roo",
"tableName" : "cms_page",
"items" : [
{
"listeners" : {
"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",
"|render" : "function() \n{\n _this.child_element_grid = this; \n if (_this.child_element_panel.active) {\n // this.footer.onClick('first');\n }\n}",
"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}"
},
"autoExpandColumn" : "title",
"| 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}",
"xtype" : "Grid",
"loadMask" : true,
"$ xns" : "Roo.grid",
"* prop" : "grid",
"items" : [
{
"Boolean singleSelect" : true,
"xtype" : "RowSelectionModel",
"$ xns" : "Roo.grid",
"* prop" : "sm"
},
{
"listeners" : {
"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}",
"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}"
},
"xtype" : "Store",
"remoteSort" : true,
"$ sortInfo" : "{ field : 'created' , direction : 'DESC' }",
"$ xns" : "Roo.data",
"* prop" : "dataSource",
"items" : [
{
"$ url" : "baseURL + '/Roo/cms_page.php'",
"xtype" : "HttpProxy",
"method" : "GET",
"$ xns" : "Roo.data",
"* prop" : "proxy"
},
{
"id" : "id",
"root" : "data",
"xtype" : "JsonReader",
"$ 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 {\n 'name': 'template_id_template',\n 'type': 'string'\n }\n]",
"$ xns" : "Roo.data",
"* prop" : "reader",
"totalProperty" : "total"
}
]
},
{
"xtype" : "Toolbar",
"$ xns" : "Roo",
"* prop" : "toolbar",
"items" : [
{
"listeners" : {
"|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"
},
"text" : "Add",
"xtype" : "Button",
"cls" : "x-btn-text-icon",
"$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
"$ xns" : "Roo.Toolbar"
},
{
"xtype" : "Fill",
"$ xns" : "Roo.Toolbar"
},
{
"listeners" : {
"|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"
},
"text" : "Delete",
"xtype" : "Button",
"cls" : "x-btn-text-icon",
"$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
"$ xns" : "Roo.Toolbar"
}
]
},
{
"pageSize" : 25,
"xtype" : "PagingToolbar",
"emptyMsg" : "No page found",
"$ xns" : "Roo",
"displayMsg" : "{0} - {1} of {2}",
"displayInfo" : true,
"* prop" : "footer",
"items" : [
{
"listeners" : {
"render" : "function (_self)\n{\n _this.child_show_deleted = this;\n}",
"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}"
},
"xtype" : "Button",
"String text" : "Show Deleted",
"$ xns" : "Roo.Toolbar",
"Boolean enableToggle" : true
}
]
},
{
"xtype" : "ColumnModel",
"width" : 75,
"header" : "Image",
"$ renderer" : "function(v,x,r) \n{ \n if(!v){\n return '';\n }\n \n return String.format('', baseURL, v); \n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "primary_image_id"
},
{
"xtype" : "ColumnModel",
"width" : 50,
"header" : "Active",
"$ renderer" : "function(v,x,r) {\n \n var state = v> 0 ? '' : '-checked';\n\n return '';\n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "is_draft"
},
{
"xtype" : "ColumnModel",
"width" : 100,
"header" : "Location",
"$ renderer" : "function(v,x,r) { \n\n var fmt = (r.data.is_deleted ? '{0}' : '{0}');\n \n return String.format( fmt, v);\n }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "element_id_name"
},
{
"xtype" : "ColumnModel",
"header" : "Title",
"width" : 75,
"$ renderer" : "function(v,x,r) { \n\n var fmt = (r.data.is_deleted ? '{0}' : '{0}');\n \n return String.format( fmt, v);\n }",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "title"
},
{
"xtype" : "ColumnModel",
"width" : 100,
"header" : "Type",
"$ 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(\"
\");\n \n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "language"
},
{
"xtype" : "ColumnModel",
"width" : 75,
"header" : "Postion",
"$ renderer" : "function(v,x,r) \n{ \n \n var fmt = String.format(\n '↑' +\n '↓'\n );\n \n return fmt;\n \n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"dataIndex" : "seq_id"
},
{
"xtype" : "ColumnModel",
"header" : "Postion",
"width" : 50,
"$ renderer" : "function(v,x,r) \n{ \n \n return v *1;\n \n}",
"$ xns" : "Roo.grid",
"* prop" : "cm[]",
"Boolean hidden" : true,
"dataIndex" : "seq_id"
}
]
}
]
}
]
}
]
}
]
}