Pman.Dialog.CmsBlog.bjs
[Pman.Cms] / Pman.Tab.CmsBlog.Old.bjs
1 {
2  "name" : "Pman.Tab.CmsBlog.Old",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Cms/Pman.Tab.CmsBlog.Old.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "30a2a59b5adaa49803297d4c06e09e67" : "Displaying cms_page{0} - {1} of {2}",
10   "a517747c3d12f99244ae598910d979c5" : "Author",
11   "6a5b847af3d97df722040debdbccfbed" : "Page Type",
12   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
13   "0eceeb45861f9585dd7a97a3e36f85c6" : "Created",
14   "ebd9bec4d70abc789d439c1f136b0538" : "Layout",
15   "30269022e9d8f51beaabb52e5d0de2b7" : "Parent",
16   "a4863ff1cdfa709d5bf80939cd2e6757" : "T#",
17   "d7efa19fbe7d3972fd5adb6024223d74" : "C#",
18   "08d0135e24822f43171ed4944fc3bdda" : "Preview (resize by dragging next to this bar)",
19   "b8a00b5928fbead0626546550667b2b5" : "Pages, Menu and Blog Entries",
20   "3adbdb3ac060038aa0e6e6c138ef9873" : "Category",
21   "2cbaa804531fc7367ccc699fb1eef52a" : "Page link / Name / Order",
22   "c8043f5cd3d28cb76c548338497b06ab" : "Show Deleted",
23   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
24   "9b9d8a976b42e0bd66381797644943d5" : "Published",
25   "b78a3223503896721cca1303f776159b" : "Title",
26   "f17755c3f16cb257f7793b9865ebafb3" : "No cms_page found",
27   "20bec77364d863100a1f9325873a8504" : "Select Page Type",
28   "8dfef8a6f3beef9ff28ff1fafb5c2009" : "Select Category Type",
29   "f46885d21c98f597303699f41b3d7afd" : "Ex?",
30   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
31   "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
32   "a1fa27779242b4902f7ae3bdd5c6d508" : "Type",
33   "779e2624ddf330fb05b51ae59faf212d" : "Select Status Type",
34   "f7070be7ec7d2443714a2e5dc63f4de2" : "Links to",
35   "75ae2cfdf786e5577f1b619f4ca8d728" : "To replace"
36  },
37  "items" : [
38   {
39    "title" : "Pages, Menu and Blog Entries ",
40    "xtype" : "NestedLayoutPanel",
41    "$ xns" : "Roo",
42    "items" : [
43     {
44      "xtype" : "BorderLayout",
45      "$ xns" : "Roo",
46      "* prop" : "layout",
47      "items" : [
48       {
49        "xtype" : "LayoutRegion",
50        "$ xns" : "Roo",
51        "* prop" : "center"
52       },
53       {
54        "xtype" : "LayoutRegion",
55        "width" : 300,
56        "$ xns" : "Roo",
57        "split" : true,
58        "titlebar" : true,
59        "* prop" : "east"
60       },
61       {
62        "listeners" : {
63         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
64        },
65        "bool background" : false,
66        "fitToframe" : true,
67        "region" : "center",
68        "title" : "Pages, Menu and Blog Entries",
69        "xtype" : "GridPanel",
70        "fitContainer" : true,
71        "$ xns" : "Roo",
72        "tableName" : "cms_page",
73        "items" : [
74         {
75          "listeners" : {
76           "rowdblclick" : "function (_self, rowIndex, e)\n{\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    _this.dialog.show(s.data, function() {\n        _this.grid.footer.onClick('refresh');\n    }); \n    \n}\n",
77           "cellclick" : "function (g, ri,ci, e)\r\n{\r\n    var h = g.getColumnModel().config[ci].dataIndex;\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}",
78           "|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}",
79           "rowclick" : "function (_self, rowIndex, e)\n{\n    var s = this.dataSource.getAt(rowIndex);\n\n    if(s.data.id *1 > 0){\n    \n        _this.prepanel.el.dom.src =  baseURL + '/Roo/Cms_page?_preview=' +  s.data.id ; \r\n    }\n //   Roo.log(s.data);\n //   _this.prepanel.setContent(s.data.body,true);\n}"
80          },
81          "autoExpandColumn" : "title",
82          "xtype" : "Grid",
83          "loadMask" : true,
84          "$ xns" : "Roo.grid",
85          "* prop" : "grid",
86          "items" : [
87           {
88            "listeners" : {
89             "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}",
90             "beforeload" : "function (_self, options)\n{\n    \n    if (Pman.building || !Pman.Tab.Cms.panel.active) {\n        return false;\n    }\n    var cm = _this.grid.colModel;\n    var vis = {\n        category_type_id_name : true,\n        menu_page_id_title : true\n    };\n    var cm = _this.grid.getColumnModel();\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    options.params._page_type_id = _this.page_type.getValue();\n    options.params._treeview = 1;\n    options.params._pman_short=1;\n    options.params.translation_of_id=0;    \n    options.params._requestMeta  = 1; // always fetch meta.. as different types return different data..\n    \n    \n    var page_type_name = (_this.page_type.lastData.name) ? _this.page_type.lastData.name : 'page';\n    \n    Roo.log(page_type_name);\n    switch(page_type_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 = 'page_link'; // 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 = 'seq_id'; // 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 = 'seq_id'; // force sort.\n            this.sortInfo.direction = 'ASC'; // force sort.\n             \n            break;                \n    }\n    if (_this.showDeleted.pressed) {\n        options.params._show_deleted = 1;\n    }\n    \n    \n  //  }\n    for (var i in vis) {\n        cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);\n    }\n\n    \n    \n    \n}"
91            },
92            "xtype" : "Store",
93            "remoteSort" : true,
94            "$ sortInfo" : "{ field : 'created' , direction : 'DESC' }",
95            "$ xns" : "Roo.data",
96            "* prop" : "dataSource",
97            "items" : [
98             {
99              "$ url" : "baseURL + '/Roo/cms_page.php'",
100              "method" : "GET",
101              "xtype" : "HttpProxy",
102              "$ xns" : "Roo.data",
103              "* prop" : "proxy"
104             },
105             {
106              "id" : "id",
107              "root" : "data",
108              "xtype" : "JsonReader",
109              "$ 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]",
110              "$ xns" : "Roo.data",
111              "* prop" : "reader",
112              "totalProperty" : "total"
113             }
114            ]
115           },
116           {
117            "pageSize" : 20,
118            "xtype" : "PagingToolbar",
119            "emptyMsg" : "No cms_page found",
120            "$ xns" : "Roo",
121            "displayMsg" : "Displaying cms_page{0} - {1} of {2}",
122            "displayInfo" : true,
123            "* prop" : "footer",
124            "items" : [
125             {
126              "listeners" : {
127               "render" : "function (_self)\n{\n  _this.showDeleted = this;\n}",
128               "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}"
129              },
130              "xtype" : "Button",
131              "String text" : "Show Deleted",
132              "$ xns" : "Roo.Toolbar",
133              "Boolean enableToggle" : true
134             }
135            ]
136           },
137           {
138            "xtype" : "Toolbar",
139            "$ xns" : "Roo",
140            "* prop" : "toolbar",
141            "items" : [
142             {
143              "listeners" : {
144               "specialkey" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}",
145               "render" : "function (_self)\n{\n_this.searchBox=  _self;\n}"
146              },
147              "xtype" : "TextField",
148              "$ xns" : "Roo.form"
149             },
150             {
151              "listeners" : {
152               "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
153              },
154              "xtype" : "Button",
155              "cls" : "x-btn-icon",
156              "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
157              "$ xns" : "Roo.Toolbar"
158             },
159             {
160              "listeners" : {
161               "|click" : "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    \n    _this.grid.footer.onClick('first');\n}"
162              },
163              "xtype" : "Button",
164              "cls" : "x-btn-icon",
165              "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
166              "$ xns" : "Roo.Toolbar"
167             },
168             {
169              "listeners" : {
170               "render" : "function (_self)\n{\n    _this.page_type = _self;\n   \n    new Pman.request({\r\n        method : 'GET',\r\n        url : baseURL + '/Roo/core_enum',\r\n        params : {\r\n            etype : 'cms_page_type',\n            _columns : 'id,name,display_name',\n            sort : 'seqid',\n            dir : 'ASC',\n            cmsTab : 1,\n            limit : 1\r\n        },\n        success : function(res) {\n           _self.setValue(res.data[0].id);\n           _self.el.dom.value = res.data[0].display_name;\n           _self.selectedData =  res.data[0];\n        }\r\n   });\n}",
171               "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n    _this.category_type.hide();\n    if(record.data.name == 'blog'){\n        _this.category_type.show();\n    }\n   combo.selectedData =  record.data;\n    \n}"
172              },
173              "alwaysQuery" : true,
174              "listWidth" : 400,
175              "triggerAction" : "all",
176              "fieldLabel" : "Page Type",
177              "forceSelection" : true,
178              "selectOnFocus" : true,
179              "pageSize" : 20,
180              "displayField" : "display_name",
181              "emptyText" : "Select Status Type",
182              "hiddenName" : "page_type",
183              "minChars" : 2,
184              "valueField" : "id",
185              "xtype" : "ComboBox",
186              "allowBlank" : false,
187              "typeAhead" : false,
188              "editable" : false,
189              "$ xns" : "Roo.form",
190              "name" : "page_type",
191              "qtip" : "Select Page Type",
192              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
193              "loadingText" : "Searching...",
194              "items" : [
195               {
196                "listeners" : {
197                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'cms_page_type';\n  //  o.params.cmsTab = 1;\n}\n"
198                },
199                "xtype" : "Store",
200                "remoteSort" : true,
201                "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }",
202                "$ xns" : "Roo.data",
203                "* prop" : "store",
204                "items" : [
205                 {
206                  "$ url" : "baseURL + '/Roo/core_enum.php'",
207                  "method" : "GET",
208                  "xtype" : "HttpProxy",
209                  "$ xns" : "Roo.data",
210                  "* prop" : "proxy"
211                 },
212                 {
213                  "id" : "id",
214                  "root" : "data",
215                  "xtype" : "JsonReader",
216                  "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"display_name\",\"type\":\"string\"}]",
217                  "$ xns" : "Roo.data",
218                  "* prop" : "reader",
219                  "totalProperty" : "total"
220                 }
221                ]
222               }
223              ]
224             },
225             {
226              "listeners" : {
227               "render" : "function (_self)\n{\n    _this.category_type = _self;\n    _this.category_type.hide();\n}",
228               "select" : "function (combo, record, index)\n{\n    _this.grid.footer.onClick('first');\n}"
229              },
230              "listWidth" : 400,
231              "triggerAction" : "all",
232              "fieldLabel" : "Category",
233              "forceSelection" : true,
234              "selectOnFocus" : true,
235              "pageSize" : 20,
236              "displayField" : "name",
237              "emptyText" : "Select Category Type",
238              "hiddenName" : "category_type",
239              "minChars" : 2,
240              "valueField" : "id",
241              "xtype" : "ComboBox",
242              "allowBlank" : true,
243              "typeAhead" : true,
244              "editable" : false,
245              "width" : 200,
246              "$ xns" : "Roo.form",
247              "qtip" : "Select Category Type",
248              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
249              "loadingText" : "Searching...",
250              "items" : [
251               {
252                "$ beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'cms_page_type'; \n}\n",
253                "remoteSort" : true,
254                "xtype" : "Store",
255                "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
256                "$ xns" : "Roo.data",
257                "* prop" : "store",
258                "items" : [
259                 {
260                  "$ url" : "baseURL + '/Roo/Cms_category_type.php'",
261                  "xtype" : "HttpProxy",
262                  "method" : "GET",
263                  "$ xns" : "Roo.data",
264                  "* prop" : "proxy"
265                 },
266                 {
267                  "id" : "id",
268                  "root" : "data",
269                  "xtype" : "JsonReader",
270                  "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
271                  "$ xns" : "Roo.data",
272                  "* prop" : "reader",
273                  "totalProperty" : "total"
274                 }
275                ]
276               }
277              ]
278             },
279             {
280              "xtype" : "Fill",
281              "$ xns" : "Roo.Toolbar"
282             },
283             {
284              "listeners" : {
285               "|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    Roo.MessageBox.confirm(\"Confirm\", \n        \"Are you sure you want to delete this, it can not be recovered if you make a mistake!\", \n        function(res) {\n            if (res != 'yes') {\n                return;\n            }\n            new Pman.Request({\n                method : 'POST',\n                url : baseURL + '/Roo/cms_page',\n                params : {\n                    _delete : sel.data.id\n                },\n                success : function() { \n                    _this.grid.footer.onClick('refresh');\n                }\n            });\n            \n                \n        }\n    );\n    \n}\n"
286              },
287              "text" : "Delete",
288              "xtype" : "Button",
289              "cls" : "x-btn-text-icon",
290              "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
291              "$ xns" : "Roo.Toolbar"
292             },
293             {
294              "listeners" : {
295               "|click" : "function()\n{\n    var ds = false;\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    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"
296              },
297              "text" : "Add",
298              "xtype" : "Button",
299              "cls" : "x-btn-text-icon",
300              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
301              "$ xns" : "Roo.Toolbar"
302             }
303            ]
304           },
305           {
306            "xtype" : "ColumnModel",
307            "header" : "Active",
308            "width" : 75,
309            "$ 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}",
310            "$ xns" : "Roo.grid",
311            "* prop" : "colModel[]",
312            "dataIndex" : "is_draft"
313           },
314           {
315            "xtype" : "ColumnModel",
316            "header" : "Created",
317            "width" : 75,
318            "$ renderer" : "function(v) { return v? v.format('d/M/Y') : '--' }",
319            "$ xns" : "Roo.grid",
320            "* prop" : "colModel[]",
321            "dataIndex" : "created"
322           },
323           {
324            "xtype" : "ColumnModel",
325            "header" : "Published",
326            "width" : 75,
327            "$ 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}",
328            "$ xns" : "Roo.grid",
329            "* prop" : "colModel[]",
330            "dataIndex" : "published"
331           },
332           {
333            "xtype" : "ColumnModel",
334            "header" : "Page link / Name / Order",
335            "width" : 120,
336            "$ renderer" : "function(v,x,r) { \n    if (r.data.page_type_id_name == 'page') {\n        return String.format('{0}', v); \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}",
337            "$ xns" : "Roo.grid",
338            "* prop" : "colModel[]",
339            "dataIndex" : "page_link"
340           },
341           {
342            "xtype" : "ColumnModel",
343            "header" : "Title",
344            "width" : 200,
345            "$ renderer" : "function(v,x,r) { \n\n    var d = r.json.depth || 0;\n    var pr = ''; \n    for (i = 0; i < d; i++) {\n      pr += ' ..  ';\n    }\n    \n    \n    return String.format( '<span style=\"color:blue\">{1}{2}</span>' + \n            (r.data.is_draft ? '<s>{0}</s>' : '{0}'),\n            pr + v,\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 }",
346            "$ xns" : "Roo.grid",
347            "* prop" : "colModel[]",
348            "dataIndex" : "title"
349           },
350           {
351            "xtype" : "ColumnModel",
352            "header" : "Layout",
353            "width" : 75,
354            "$ renderer" : "function(v) { return String.format('{0}', v  || ''); }",
355            "$ xns" : "Roo.grid",
356            "* prop" : "colModel[]",
357            "dataIndex" : "template_id_template"
358           },
359           {
360            "xtype" : "ColumnModel",
361            "header" : "Type",
362            "width" : 100,
363            "$ renderer" : "function(v, x, r) { \n    \n    if (r.data.language.length) {\n        return '&gt;&gt; ' + Pman.I18n.toName('l', r.data.language);\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    return '';\n}",
364            "$ xns" : "Roo.grid",
365            "* prop" : "colModel[]",
366            "dataIndex" : "category_type_id_name"
367           },
368           {
369            "xtype" : "ColumnModel",
370            "header" : "Links to",
371            "width" : 200,
372            "$ renderer" : "function(v,x,r) { \n\n   if (r.data.is_attachment) {\n        return \"[ATTACHMENT]\";\n    }\n   return String.format('{0}', v); \n }",
373            "$ xns" : "Roo.grid",
374            "* prop" : "colModel[]",
375            "dataIndex" : "menu_page_id_title"
376           },
377           {
378            "xtype" : "ColumnModel",
379            "header" : "Author",
380            "width" : 75,
381            "$ renderer" : "function(v) { return String.format('{0}', v); }",
382            "$ xns" : "Roo.grid",
383            "* prop" : "colModel[]",
384            "dataIndex" : "author_id_name"
385           },
386           {
387            "hidden" : true,
388            "xtype" : "ColumnModel",
389            "header" : "Parent",
390            "width" : 75,
391            "$ renderer" : "function(v) { return String.format('{0}', v  || ''); }",
392            "$ xns" : "Roo.grid",
393            "* prop" : "colModel[]",
394            "dataIndex" : "parent_id_title"
395           },
396           {
397            "hidden" : true,
398            "xtype" : "ColumnModel",
399            "header" : "To replace",
400            "width" : 75,
401            "$ renderer" : "function(v) { return String.format('{0}', v); }",
402            "$ xns" : "Roo.grid",
403            "* prop" : "colModel[]",
404            "dataIndex" : "to_replace_id_title"
405           },
406           {
407            "xtype" : "ColumnModel",
408            "header" : "Ex?",
409            "width" : 25,
410            "$ renderer" : "function(v) { return String.format('{0}', v); }",
411            "$ xns" : "Roo.grid",
412            "* prop" : "colModel[]",
413            "dataIndex" : "has_extended"
414           },
415           {
416            "hidden" : true,
417            "xtype" : "ColumnModel",
418            "header" : "T#",
419            "width" : 25,
420            "$ renderer" : "function(v) { return String.format('{0}', v); }",
421            "$ xns" : "Roo.grid",
422            "* prop" : "colModel[]",
423            "dataIndex" : "trackbacks_no"
424           },
425           {
426            "xtype" : "ColumnModel",
427            "header" : "C#",
428            "width" : 25,
429            "$ renderer" : "function(v) { return String.format('{0}', v); }",
430            "$ xns" : "Roo.grid",
431            "* prop" : "colModel[]",
432            "dataIndex" : "comments_no"
433           }
434          ]
435         }
436        ]
437       },
438       {
439        "listeners" : {
440         "render" : "function (_self)\n{\n    _this.prepanel = _self;\n\n}"
441        },
442        "$ autoCreate" : "{ tag: 'iframe', src : 'about:blank' }",
443        "region" : "east",
444        "fitToFrame" : true,
445        "title" : "Preview (resize by dragging next to this bar)",
446        "xtype" : "ContentPanel",
447        "fitContainer" : true,
448        "$ xns" : "Roo"
449       }
450      ]
451     }
452    ]
453   }
454  ]
455 }