fix 'Optional parameter declared before required parameter is implicitly treated'
[Pman.Cms] / Pman.Dialog.CmsBlog.Old.bjs
1 {
2  "name" : "Pman.Dialog.CmsBlog.Old",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsBlog.Old.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "2f26e35d61be90501e099089dc533638" : "Select Images",
10   "f3912172e6bf57f8979782f4a2342233" : "Appears in Block",
11   "95cb4f45ab7ff3984f25ab8668499020" : "Select Parent",
12   "c1df1da7a1ce305a3b60af9d5733ac1d" : "Contents",
13   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
14   "ebd9bec4d70abc789d439c1f136b0538" : "Layout",
15   "20bec77364d863100a1f9325873a8504" : "Select Page Type",
16   "a517747c3d12f99244ae598910d979c5" : "Author",
17   "779e2624ddf330fb05b51ae59faf212d" : "Select Status Type",
18   "6a5b847af3d97df722040debdbccfbed" : "Page Type",
19   "30d1a216420426fcbd43ca70acd4aa48" : "Select interests",
20   "e6b391a8d2c4d45902a23a8b6585703d" : "URL",
21   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
22   "778551900655782c5c7827332b08cf3f" : "Save and close",
23   "77174410b72decfd0b259961f1f65a8f" : "Attributes:",
24   "b28a711cf7e94ec793ef926633997529" : "Seq",
25   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
26   "580b21aac58f1b73cece26e272cdfbee" : "Add Link",
27   "8bc84316c4078bf66723fd019616d920" : "Descriptions",
28   "83dad8107f9459efe2b4fabcf5b63108" : "Select Language",
29   "76729937a5eb6b0fd88c42581161facd" : "Select Category",
30   "0b8d92bc19b720bb1065649535463409" : "Translations",
31   "d41d8cd98f00b204e9800998ecf8427e" : "",
32   "867343577fa1f33caa632a19543bd252" : "Keywords",
33   "340c2ee497b85d5954b01c64de7f44f6" : "Select Person",
34   "69dd756ae9c23191a5bb9b61f0857432" : "Date to Publish",
35   "3adbdb3ac060038aa0e6e6c138ef9873" : "Category",
36   "57e195426892c5515935f21d97228814" : "Extended Contents",
37   "d88aa1eee60ba140f07d5f81769cec74" : "<< Edit Translations",
38   "b9c49611cfda3259a2b837b39489e650" : "Add Image",
39   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
40   "cfcd208495d565ef66e7dff9f98764da" : "0",
41   "aa6356b678bc4fc78253c9edf65bff03" : "Edit Page / Blog Entry ",
42   "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
43   "70a4bc2672e2e3912e6476a2bd7ba29b" : "Parent page",
44   "31bb2f6e9b8fb11cbb7fb63c6025223f" : "Select Template",
45   "c02bd0c22c290ae599ee2f3ff2023fd3" : "Manage Images / Attachments >>",
46   "b78a3223503896721cca1303f776159b" : "Title",
47   "39f64cc9436cacfbceda3b7bdeb8e24c" : "Styles (CSS)",
48   "e64df1d7c22b9638f084ce8a4aff3ff3" : "Target URL",
49   "a240fa27925a635b08dc28c9e4f9216d" : "Order",
50   "287234a1ff35a314b5b6bc4e5828e745" : "Attributes",
51   "99e7707748ae048e17c5810fad119e0b" : "Select Page",
52   "06933067aafd48425d67bcb01bba5cb6" : "Update",
53   "8adedb6a6226807ba810215dd3b3c61b" : "Menu links to Page",
54   "b5216c9b4e0ac0afd9c76eb1d12ad1b9" : "Select Section",
55   "308f2757bfc9ce92fb00ff93fdffd279" : "Images / Attachments",
56   "1351017ac6423911223bc19a8cb7c653" : "Filename",
57   "c9cc8cce247e49bae79f15173ce97354" : "Save",
58   "e659b52eba1f0299b2d8ca3483919e72" : "Type:",
59   "c70952e4ab3806c049737cd7d2b8896b" : "Interests",
60   "d52f80f80467bb575253a5a39ca016a7" : "Page link /  Name / Order",
61   "fff0d600f8a0b5e19e88bfb821dd1157" : "Images",
62   "fb3f11443065d5f4d8303ad913db9680" : "Replaces (ignore)"
63  },
64  "items" : [
65   {
66    "listeners" : {
67     "show" : "function (_self)\n{\n    // @see the contentpanel - center - resize handler.\n\n    var w = Roo.lib.Dom.getViewWidth();\n    var h = Roo.lib.Dom.getViewHeight();    \n    this.resizeTo(w-50, h-50);\n    this.center();\n    \n    var ew = Math.max(250, w-150); // was 350?/ why?\n    var eh = Math.max(250, h-350) ;\n    \n    var bd = _this.form.findField('body');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        // since render delays resize.. \n       bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n        _this.bodycol.el.setWidth(bd.width+20);\n    }\n    var bd = _this.form.findField('extended');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        // since render delays resize.. \n       bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n       _this.extendcol.el.setWidth(bd.width+20);\n    }\n     var bd = _this.form.findField('extra_css');\n    if (bd) { \n        bd.el.setWidth(ew);\n       _this.keywordscol.el.setWidth(ew+20);\n    }\n    Pman.Cms.pageEditAddCustomFields();\n    // fix messed up scroll.\n    _this.dialog.layout.el.dom.scrollTop = 0;\n    \n\n}"
68    },
69    "modal" : true,
70    "collapsible" : false,
71    "background" : true,
72    "title" : "Edit Page / Blog Entry ",
73    "xtype" : "LayoutDialog",
74    "| function setStylesheets" : "function() {\n    var sheets = [];\n    \n    sheets.push(rootURL + '/Pman/Cms/templates/undoreset.css');\n    \n    if(typeof(uiConfig) !== 'undefined'  && typeof(uiConfig.cms_css) != 'undefined'){\n        Roo.each(uiConfig.cms_css, function(v){\n            sheets.push(rootURL + v);\n        })\n    }\n    \n    new Pman.Request({\n       url : baseURL + '/Roo/Cms_page.php',\n       method : 'GET',\n       params : {\n           _stylesheets : 1\n       }, \n       success : function(res) {\n            Roo.log(res);\n            if(res.data._stylesheets.length){\n                var setting = res.data._stylesheets.split(\"\\n\");\n                \n                Roo.each(setting, function(s){\n                    sheets.push(s.replace('{rootURL}', rootURL));\n                });\n                \n            }\n            Roo.log(sheets);\n            Roo.log(_this.form.findField('body'));\n            _this.form.findField('body').removeStylesheets();\n            _this.form.findField('extended').removeStylesheets();\n\n            _this.form.findField('body').setStylesheets(sheets);\n            _this.form.findField('extended').setStylesheets(sheets);\n\n            _this.trform.findField('body').removeStylesheets();\n            _this.trform.findField('extended').removeStylesheets();\n            \n            _this.trform.findField('body').setStylesheets(sheets);\n            _this.trform.findField('extended').setStylesheets(sheets);\n       }\n   });\n\n}",
75    "width" : 850,
76    "$ xns" : "Roo",
77    "closable" : true,
78    "resizable" : false,
79    "height" : 600,
80    "items" : [
81     {
82      "xtype" : "LayoutRegion",
83      "$ xns" : "Roo",
84      "* prop" : "center",
85      "titlebar" : false
86     },
87     {
88      "listeners" : {
89       "expanded" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    if(id < 1){\n        Roo.MessageBox.alert('Error', 'Save first');\n        this.collapse();\n        return;\n    }\n    \n    var w = Roo.lib.Dom.getViewWidth();\n    var h = Roo.lib.Dom.getViewHeight();\n    \n    _self.resizeTo.defer(110, _self,[ w-400,  h-350] );\n    \n    _this.panel.region.collapse();\n    \n}"
90      },
91      "collapsedTitle" : "Translations",
92      "collapsible" : true,
93      "fitToFrame" : true,
94      "title" : "Translations",
95      "xtype" : "LayoutRegion",
96      "collapsed" : true,
97      "$ xns" : "Roo",
98      "split" : true,
99      "* prop" : "west",
100      "titlebar" : true
101     },
102     {
103      "listeners" : {
104       "expanded" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    if(id < 1){\n        Roo.MessageBox.alert('Error', 'Save first');\n        this.collapse();\n        return;\n    }\n    \n    var w = Roo.lib.Dom.getViewWidth();\n    var h = Roo.lib.Dom.getViewHeight();\n    \n    _self.resizeTo.defer(110, _self,[ w-400,  h] );\n    _this.trpanel.region.collapse();\n}"
105      },
106      "collapsedTitle" : "Images / Attachments",
107      "collapsible" : true,
108      "fitToFrame" : true,
109      "title" : "Images / Attachments",
110      "xtype" : "LayoutRegion",
111      "collapsed" : true,
112      "$ xns" : "Roo",
113      "split" : true,
114      "* prop" : "east",
115      "titlebar" : true
116     },
117     {
118      "listeners" : {
119       "resize" : "function (_self, width, height)\n{\n      Roo.log(\"RESIZE, \" + width + ',' + height);\n    \n    var ew = Math.max(250, width-50);\n    var eh = Math.max(250,height-50) ;\n    if (!_this.form) {\n        return;\n        }\n    \n    var bd = _this.form.findField('body');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        // since render delays resize.. \n        Roo.log('resizing body to ' + bd.width);        \n       bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n        _this.bodycol.el.setWidth(bd.width+20);\n    }\n    \n    \n    bd = _this.form.findField('extended');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        \n        Roo.log('resizing extended to ' + bd.width);\n        // since render delays resize.. \n       bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n       _this.extendcol.el.setWidth(bd.width+20);\n    }\n    bd = _this.form.findField('extra_css');\n    if (bd) { \n        bd.el.setWidth(ew);\n       _this.keywordscol.el.setWidth(ew+20);\n    }\n    // fix for messed up rendering of dialog?\n    _this.dialog.layout.el.dom.scrollTop = 0;\n}",
120       "render" : "function (_self)\n{\n  _this.cpanel = _self;\n}"
121      },
122      "autoScroll" : true,
123      "fitToFrame" : true,
124      "region" : "center",
125      "xtype" : "ContentPanel",
126      "$ xns" : "Roo",
127      "items" : [
128       {
129        "xtype" : "Toolbar",
130        "$ xns" : "Roo",
131        "* prop" : "toolbar",
132        "items" : [
133         {
134          "listeners" : {
135           "click" : "function (_self, e)\n{\n    if (_this.trpanel.region.collapsed) {\n        _this.trpanel.region.expand();\n    } else {\n        _this.trpanel.region.collapse(); \n    }\n    \n}"
136          },
137          "text" : "<< Edit Translations",
138          "xtype" : "Button",
139          "$ xns" : "Roo.Toolbar"
140         },
141         {
142          "xtype" : "Fill",
143          "$ xns" : "Roo.Toolbar"
144         },
145         {
146          "listeners" : {
147           "click" : "function (_self, e)\n{\n    if (_this.panel.region.collapsed) {\n        _this.panel.region.expand();\n    } else {\n        _this.panel.region.collapse();\n    }\n    \n}"
148          },
149          "text" : "Manage Images / Attachments >>",
150          "xtype" : "Button",
151          "$ xns" : "Roo.Toolbar"
152         }
153        ]
154       },
155       {
156        "listeners" : {
157         "|actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask(); \n    Pman.standardActionFailed(_self, action);\n}\n",
158         "|actioncomplete" : "function (_self, action)\n{\n\n   if (action.type == 'setdata') {\n\n        _this.dialog.setStylesheets();\n        \n        _this.trpanel.region.collapse(); \n        _this.panel.region.collapse();\n        \n        _this.trpanel.el.mask('Save first');\n        _this.panel.el.mask('Save first');\n        \n        _this.loaded = false;\n        _this.interestsCol.hide();\n        \n        _this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';\n        \n        if ( _this.data.id) {\n            _this.dialog.el.mask(\"Loading\");\n            this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n        } else {\n\n            _this.loaded = true;\n            var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;\n            this.findField('is_draft').setValue(is_draft);\n            _this.page_type.setValue(_this.data.page_type_id);\n            _this.page_type.el.dom.value = _this.data.page_type_id_display_name;\n            \n            if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf(\"Crm\") !== -1){\n                _this.interestsCol.show();\n            }\n            /*\n            var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()\n            catlabel.dom.innerHTML = 'Category';            \n            if(_this.data.page_type_id_name == 'category'){\n                catlabel.dom.innerHTML = 'Parent Category';\n            } \n            */\n            var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();\n            catlabel.dom.innerHTML = 'Parent page';            \n            if(_this.data.page_type_id_name == 'category'){\n                catlabel.dom.innerHTML = 'Parent';\n            }\n        }\n       return;\n    }\n    \n    if (action.type == 'load') {\n    \n        //_this.data = action.result.data;\n        \n        var d = action.result.data;\n        \n        _this.dialog.el.unmask();\n       _this.grid.getDataSource().load();\n       _this.trform.reset();\n       _this.form.findField('body').originalValue = _this.form.findField('body').getValue();\n       _this.form.findField('extended').originalValue = _this.form.findField('extended').getValue();\n       \n       /*\n        var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()\n        catlabel.dom.innerHTML = 'Category';            \n        \n        if(_this.data.page_type_id_name == 'category'){\n            catlabel.dom.innerHTML = 'Parent Category';\n        }\n        */\n        \n        var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();\n        catlabel.dom.innerHTML = 'Parent page';            \n        if(_this.data.page_type_id_name == 'category'){\n            catlabel.dom.innerHTML = 'Parent';\n        }\n        \n        // better if this was not here... - not sure which project uses it?\n        \n        if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf(\"Crm\") !== -1){\n            _this.interestsCol.show();\n        }\n        if(typeof(d['interests']) != 'undefined'){\n            _this.form.findField('interest').setValue(Roo.decode(d['interests']));\n        }\n        \n        _this.trpanel.el.unmask();\n        _this.panel.el.unmask();\n        \n        // fix scrolling..\n        _this.cpanel.el.dom.scrollTop = 0;\n        \n        // fix messed up scroll.\n        _this.dialog.layout.el.dom.scrollTop = 0;\n        return;\n    }\n    if (action.type =='submit') {\n       \n       _this.dialog.el.unmask();\n       \n       if(!_this.exit){\n            this.load({ method: 'GET', params: { '_id' : action.result.data.id }});\n            return;\n       }\n       \n       _this.dialog.hide();\n       \n\n        if (_this.callback) {\n           _this.callback.call(_this, action.result.data);\n        }\n        _this.form.reset();\n        return;\n    }\n}\n",
159         "|rendered" : "function (_self)\n{\n    _this.form = _self;\n}\n"
160        },
161        "labelAlign" : "right",
162        "$ url" : "baseURL + '/Roo/cms_page.php'",
163        "method" : "POST",
164        "style" : "margin: 5px",
165        "xtype" : "Form",
166        "labelWidth" : 120,
167        "$ showHide" : "function()\n{\n    var in_rss= 0;\n    var is_menu= 0;\n    var is_element  = 0;\n    var is_category = 0;\n    var page_type_name = _this.form.findField('page_type_id_name').getValue();\n    switch(page_type_name){\n        case 'page' :\n            is_element = 0;\n        break;\n        \n        case 'element' :\n            is_element = 1;\n        break;\n        \n        case 'blog' :\n            in_rss = 1;\n        break;\n        \n        case 'menu' :\n            is_menu = 1;\n        break;\n        \n        case 'category' :\n            in_rss = 1;\n            is_category = 1;\n        break;\n    }\n    \n    var is_system_page = _this.form.findField('is_system_page').getValue() * 1;\n    var is_attachment = _this.form.findField('is_attachment').getValue() * 1;\n    var has_extended = _this.form.findField('has_extended').getValue() * 1;\n    \n    var vis = {\n        is_attachment : !in_rss,\n        \n        category_type_id : in_rss && !is_menu,\n         page_link : 1, //!in_rss, // always show page link.. may not be needed though..\n        target_url : is_menu,\n        \n        category_page_id : !is_category,\n        \n        parent_id : !in_rss || is_category ,\n        published : in_rss ,\n        \n        to_replace_id :false, // !in_rss, // is this used.\n        is_draft : !is_system_page,\n        author_id : in_rss && !is_menu  && !is_attachment,\n        \n        template_id : !is_attachment && !is_menu && !is_system_page,\n        element_id : is_element &&   !is_menu, \n        menu_page_id : is_menu,\n \n        has_extended : !is_menu && !is_attachment, // always shown.\n        extended : has_extended && !is_menu  && !is_attachment,\n        body : !is_attachment && !is_menu,\n        keywords : !is_attachment && !is_menu, \n        descriptions : !is_attachment && !is_menu,\n        extra_css : !is_attachment && !is_menu\n    };\n\n    for(var k in vis) {\n        var el = _this.form.findField(k);\n        if (!el) {\n            Roo.log(\"missing field \" + k);\n            continue;\n        }\n        el.actionMode = 'fieldEl';\n        if (vis[k]) {\n            el.show();\n        } else{\n            el.hide();\n        }\n\n    }\n    \n    \n    _this.trform.showHide();\n    \n    if(typeof(_this.form.editors) == 'undefined'){\n        _this.form.editors = {\n            body : _this.form.findField('body').wrap.isVisible(),\n            extended : _this.form.findField('extended').wrap.isVisible()\n       };\n       \n       if(_this.form.editors.body){\n            setInterval(_this.form.findField('body').autosave, 60000);\n       }\n       \n       if(_this.form.editors.extended){\n            setInterval(_this.form.findField('extended').autosave, 60000);\n       }\n   }\n   \n   if(!_this.form.editors.body && _this.form.findField('body').wrap.isVisible()){\n        setInterval(_this.form.findField('body').autosave, 60000);\n        _this.form.editors.body = true;\n   }\n   \n   if(!_this.form.editors.extended && _this.form.findField('extended').wrap.isVisible()){\n        setInterval(_this.form.findField('extended').autosave, 60000);\n        _this.form.editors.extended = true;\n   }\n    \n    \n    \n}\n",
168        "$ xns" : "Roo.form",
169        "items" : [
170         {
171          "xtype" : "Column",
172          "labelWidth" : 200,
173          "width" : 750,
174          "$ xns" : "Roo.form",
175          "items" : [
176           {
177            "labelAlign" : "right",
178            "hideLabels" : false,
179            "style" : "height:30px;overflow:hidden",
180            "xtype" : "Row",
181            "labelWidth" : 200,
182            "width" : 850,
183            "$ xns" : "Roo.form",
184            "items" : [
185             {
186              "fieldLabel" : "Type:",
187              "xtype" : "Hidden",
188              "width" : 1,
189              "$ xns" : "Roo.form"
190             },
191             {
192              "hideLabels" : true,
193              "xtype" : "Row",
194              "style" : "height:30px;overflow:hidden",
195              "labelWidth" : 0,
196              "width" : 600,
197              "$ xns" : "Roo.form",
198              "items" : [
199               {
200                "listeners" : {
201                 "render" : "function (_self)\n{\n    _this.page_type = _self;\n}",
202                 "select" : "function (combo, record, index)\n{\n//    _this.grid.footer.onClick('first');\n    var page_type_name = record.data.name;\n    _this.form.findField('page_type_id_name').setValue(page_type_name);\n    if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment\n        _this.form.findField('is_attachment').setValue(0);\n        return;\n    }\n    if (_this.form) { \n        _this.form.showHide.defer(100, _this.form);      \n    } \n    \n}"
203                },
204                "alwaysQuery" : true,
205                "listWidth" : 400,
206                "triggerAction" : "all",
207                "fieldLabel" : "Page Type",
208                "forceSelection" : true,
209                "selectOnFocus" : true,
210                "pageSize" : 20,
211                "displayField" : "display_name",
212                "emptyText" : "Select Status Type",
213                "hiddenName" : "page_type_id",
214                "minChars" : 2,
215                "valueField" : "id",
216                "xtype" : "ComboBox",
217                "typeAhead" : false,
218                "editable" : false,
219                "$ xns" : "Roo.form",
220                "name" : "page_type_id_display_name",
221                "qtip" : "Select Page Type",
222                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
223                "loadingText" : "Searching...",
224                "items" : [
225                 {
226                  "listeners" : {
227                   "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'cms_page_type'; \n}\n"
228                  },
229                  "xtype" : "Store",
230                  "remoteSort" : true,
231                  "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }",
232                  "$ xns" : "Roo.data",
233                  "* prop" : "store",
234                  "items" : [
235                   {
236                    "$ url" : "baseURL + '/Roo/core_enum.php'",
237                    "xtype" : "HttpProxy",
238                    "method" : "GET",
239                    "$ xns" : "Roo.data",
240                    "* prop" : "proxy"
241                   },
242                   {
243                    "id" : "id",
244                    "root" : "data",
245                    "xtype" : "JsonReader",
246                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"display_name\",\"type\":\"string\"}]",
247                    "$ xns" : "Roo.data",
248                    "* prop" : "reader",
249                    "totalProperty" : "total"
250                   }
251                  ]
252                 }
253                ]
254               },
255               {
256                "style" : "padding-left:  -70px;",
257                "xtype" : "Column",
258                "labelWidth" : 60,
259                "width" : 200,
260                "$ xns" : "Roo.form",
261                "items" : [
262                 {
263                  "fieldLabel" : "Seq",
264                  "xtype" : "NumberField",
265                  "decimalPrecision" : 0,
266                  "width" : 50,
267                  "$ xns" : "Roo.form",
268                  "name" : "seq_id"
269                 }
270                ]
271               }
272              ]
273             }
274            ]
275           },
276           {
277            "labelAlign" : "right",
278            "hideLabels" : false,
279            "style" : "height:30px;overflow:hidden",
280            "xtype" : "Row",
281            "labelWidth" : 200,
282            "width" : 800,
283            "$ xns" : "Roo.form",
284            "items" : [
285             {
286              "fieldLabel" : "Attributes:",
287              "xtype" : "Hidden",
288              "width" : 1,
289              "$ xns" : "Roo.form"
290             },
291             {
292              "hideLabels" : true,
293              "xtype" : "Row",
294              "style" : "height:30px;overflow:hidden",
295              "labelWidth" : 0,
296              "width" : 540,
297              "$ xns" : "Roo.form",
298              "items" : [
299               {
300                "fieldLabel" : "Attributes",
301                "xtype" : "Checkbox",
302                "boxLabel" : "Draft",
303                "width" : 100,
304                "$ xns" : "Roo.form",
305                "name" : "is_draft"
306               },
307               {
308                "listeners" : {
309                 "check" : "function (_self, checked)\n{  \n   if (_this.form) {\n\n       (function() { \n            _this.form.showHide();\n            _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ]  );\n            \n       }).defer(100);\n    }\n}"
310                },
311                "inputValue" : 1,
312                "xtype" : "Checkbox",
313                "boxLabel" : "Has Extended content?",
314                "width" : 180,
315                "$ xns" : "Roo.form",
316                "name" : "has_extended"
317               },
318               {
319                "listeners" : {
320                 "check" : "function (_self, checked)\n{  \n   if (_this.form) { \n \n     _this.form.showHide.defer(100, _this.form);      \n   }\n}"
321                },
322                "inputValue" : 1,
323                "xtype" : "Checkbox",
324                "boxLabel" : "Downloads first Attachment",
325                "width" : 180,
326                "$ xns" : "Roo.form",
327                "name" : "is_attachment"
328               }
329              ]
330             }
331            ]
332           },
333           {
334            "listWidth" : 400,
335            "triggerAction" : "all",
336            "fieldLabel" : "Author",
337            "forceSelection" : true,
338            "selectOnFocus" : true,
339            "pageSize" : 40,
340            "displayField" : "name",
341            "emptyText" : "Select Person",
342            "hiddenName" : "author_id",
343            "minChars" : 2,
344            "valueField" : "id",
345            "xtype" : "ComboBox",
346            "allowBlank" : true,
347            "typeAhead" : false,
348            "editable" : true,
349            "width" : 300,
350            "$ xns" : "Roo.form",
351            "name" : "author_id_name",
352            "qtip" : "Select Person",
353            "queryParam" : "query[name]",
354            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b>  - {company_id_name}</div>",
355            "loadingText" : "Searching...",
356            "items" : [
357             {
358              "listeners" : {
359               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    o.params.active = 1;\n    o.params['query[is_owner]'] = 1;\n}\n"
360              },
361              "xtype" : "Store",
362              "remoteSort" : true,
363              "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
364              "$ xns" : "Roo.data",
365              "* prop" : "store",
366              "items" : [
367               {
368                "$ url" : "baseURL + '/Roo/core_person'",
369                "xtype" : "HttpProxy",
370                "method" : "GET",
371                "$ xns" : "Roo.data",
372                "* prop" : "proxy"
373               },
374               {
375                "id" : "id",
376                "root" : "data",
377                "xtype" : "JsonReader",
378                "$ xns" : "Roo.data",
379                "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
380                "* prop" : "reader",
381                "totalProperty" : "total"
382               }
383              ]
384             }
385            ]
386           },
387           {
388            "listWidth" : 400,
389            "triggerAction" : "all",
390            "fieldLabel" : "Category",
391            "forceSelection" : true,
392            "selectOnFocus" : true,
393            "pageSize" : 20,
394            "displayField" : "title",
395            "emptyText" : "Select Category",
396            "hiddenName" : "category_page_id",
397            "minChars" : 2,
398            "valueField" : "id",
399            "xtype" : "ComboBox",
400            "allowBlank" : true,
401            "typeAhead" : true,
402            "editable" : false,
403            "width" : 200,
404            "$ xns" : "Roo.form",
405            "name" : "category_page_id_title",
406            "qtip" : "Select Category",
407            "queryParam" : "",
408            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> </div>",
409            "loadingText" : "Searching...",
410            "items" : [
411             {
412              "listeners" : {
413               "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    o.params.page_type_id_name= 'CATEGORY';\n    // set more here\n}\n"
414              },
415              "xtype" : "Store",
416              "$ xns" : "Roo.data",
417              "$ sortInfo" : "{ field: 'title', dir: 'ASC' }",
418              "* prop" : "store",
419              "items" : [
420               {
421                "$ url" : "baseURL + '/Roo/cms_page.php'",
422                "method" : "GET",
423                "xtype" : "HttpProxy",
424                "$ xns" : "Roo.data",
425                "* prop" : "proxy"
426               },
427               {
428                "id" : "id",
429                "root" : "data",
430                "xtype" : "JsonReader",
431                "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"}]",
432                "$ xns" : "Roo.data",
433                "* prop" : "reader",
434                "totalProperty" : "total"
435               }
436              ]
437             }
438            ]
439           },
440           {
441            "listeners" : {
442             "select" : "function (combo, record, index)\n{\n   var page_type_name = _this.form.findField('page_type_id_name').getValue();\n   if (page_type_name == 'page') { // page\n        return;\n   }\n   // do not default to put 'Home' at the beginning.\n   if (!(record.data.parent_id *1)) {\n        return;\n   }\n   var pl = _this.form.findField('page_link');\n   var lk = pl.getValue();\n   var new_link = record.data.page_link + '/';\n   if (lk.length) {\n        new_link += lk.split('/').pop();\n   }\n   pl.setValue(new_link);\n   \n}"
443            },
444            "listWidth" : 600,
445            "triggerAction" : "all",
446            "fieldLabel" : "Parent page",
447            "forceSelection" : true,
448            "selectOnFocus" : true,
449            "pageSize" : 40,
450            "displayField" : "page_link",
451            "emptyText" : "Select Parent",
452            "hiddenName" : "parent_id",
453            "minChars" : 2,
454            "valueField" : "id",
455            "xtype" : "ComboBox",
456            "allowBlank" : true,
457            "typeAhead" : true,
458            "Boolean alwaysQuery" : true,
459            "editable" : true,
460            "width" : 400,
461            "$ xns" : "Roo.form",
462            "name" : "parent_id_title",
463            "qtip" : "Select Category ",
464            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
465            "loadingText" : "Searching...",
466            "items" : [
467             {
468              "listeners" : {
469               "beforeload" : "function (_self, options)\n{\n     options.params['search[page_link_no_empty]'] =1;\n     \n     options.params.page_type_id = _this.data.page_type_id;\n     \n     var id = _this.form.findField('id').getValue() * 1;\n     \n     if(id > 0){\n        options.params['!id'] = id;\n     }\n     /*\n     options.params.is_element = 0;\n     var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;\n     options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;    \n     */\n}"
470              },
471              "xtype" : "Store",
472              "remoteSort" : true,
473              "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
474              "$ xns" : "Roo.data",
475              "* prop" : "store",
476              "items" : [
477               {
478                "$ url" : "baseURL + '/Roo/cms_page.php'",
479                "method" : "GET",
480                "xtype" : "HttpProxy",
481                "$ xns" : "Roo.data",
482                "* prop" : "proxy"
483               },
484               {
485                "id" : "id",
486                "root" : "data",
487                "xtype" : "JsonReader",
488                "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
489                "$ xns" : "Roo.data",
490                "* prop" : "reader",
491                "totalProperty" : "total"
492               }
493              ]
494             }
495            ]
496           },
497           {
498            "xtype" : "Row",
499            "labelWidth" : 200,
500            "$ xns" : "Roo.form",
501            "items" : [
502             {
503              "format" : "Y-m-d",
504              "fieldLabel" : "Date to Publish",
505              "xtype" : "DateField",
506              "width" : 200,
507              "$ xns" : "Roo.form",
508              "altFormats" : "Y-m-d H:i:s",
509              "name" : "published"
510             },
511             {
512              "fieldLabel" : "Replaces (ignore)",
513              "xtype" : "TextField",
514              "width" : 75,
515              "$ xns" : "Roo.form",
516              "name" : "to_replace_id"
517             }
518            ]
519           },
520           {
521            "listeners" : {
522             "keyup" : "function (_self, e)\n{\n    if (_this.page_type.getRawValue() == 'Category') {\n    \n        _this.form.findField('page_link').setValue(this.getValue().replace(/[\\s]/ig, '-').toLowerCase());\n    \n    }\n}"
523            },
524            "fieldLabel" : "Title",
525            "xtype" : "TextField",
526            "width" : 400,
527            "$ xns" : "Roo.form",
528            "name" : "title"
529           },
530           {
531            "fieldLabel" : "Page link /  Name / Order",
532            "xtype" : "TextField",
533            "width" : 400,
534            "$ xns" : "Roo.form",
535            "name" : "page_link"
536           },
537           {
538            "fieldLabel" : "Target URL",
539            "xtype" : "TextField",
540            "width" : 400,
541            "$ xns" : "Roo.form",
542            "name" : "target_url"
543           },
544           {
545            "alwaysQuery" : true,
546            "listWidth" : 400,
547            "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><b>{template_clean}</b></div>'\n",
548            "triggerAction" : "all",
549            "fieldLabel" : "Layout",
550            "forceSelection" : true,
551            "selectOnFocus" : true,
552            "pageSize" : 20,
553            "displayField" : "template_clean",
554            "emptyText" : "Select Template",
555            "hiddenName" : "template_id",
556            "minChars" : 2,
557            "valueField" : "id",
558            "xtype" : "ComboBox",
559            "allowBlank" : true,
560            "typeAhead" : true,
561            "editable" : true,
562            "width" : 400,
563            "$ xns" : "Roo.form",
564            "name" : "template_id_template_clean",
565            "qtip" : "Select Category ",
566            "loadingText" : "Searching...",
567            "items" : [
568             {
569              "listeners" : {
570               "beforeload" : "function (_self, options)\n{\n \n    options.params._rescan = 1;\n   options.params._clean_name = 1;\n//    options.params.lang = 'en';\n    options.params['!template[0]'] = 'master.html';\n    //options.params['!template[1]'] = 'index.html';\n}"
571              },
572              "xtype" : "Store",
573              "remoteSort" : true,
574              "$ sortInfo" : "{ field: 'template', direction: 'ASC' }",
575              "$ xns" : "Roo.data",
576              "* prop" : "store",
577              "items" : [
578               {
579                "$ url" : "baseURL + '/Roo/Cms_template'",
580                "method" : "GET",
581                "xtype" : "HttpProxy",
582                "$ xns" : "Roo.data",
583                "* prop" : "proxy"
584               },
585               {
586                "id" : "id",
587                "root" : "data",
588                "xtype" : "JsonReader",
589                "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]",
590                "$ xns" : "Roo.data",
591                "* prop" : "reader",
592                "totalProperty" : "total"
593               }
594              ]
595             }
596            ]
597           },
598           {
599            "alwaysQuery" : true,
600            "listWidth" : 400,
601            "triggerAction" : "all",
602            "fieldLabel" : "Appears in Block",
603            "forceSelection" : true,
604            "selectOnFocus" : true,
605            "pageSize" : 20,
606            "displayField" : "name",
607            "emptyText" : "Select Section",
608            "hiddenName" : "element_id",
609            "minChars" : 2,
610            "valueField" : "id",
611            "xtype" : "ComboBox",
612            "allowBlank" : true,
613            "typeAhead" : true,
614            "editable" : true,
615            "width" : 400,
616            "$ xns" : "Roo.form",
617            "name" : "element_id_name",
618            "qtip" : "Select Category ",
619            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
620            "loadingText" : "Searching...",
621            "items" : [
622             {
623              "listeners" : {
624               "beforeload" : "function (_self, options)\n{\n    var par = _this.form.findField('parent_id').getValue() * 1;\n    if (!par) {\n        Roo.MessageBox.alert(\"Error\", \"Select on what parent page it appears\");\n        return false;\n    }\n    \n    options.params._cms_page_id = par;\n}"
625              },
626              "xtype" : "Store",
627              "remoteSort" : true,
628              "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
629              "$ xns" : "Roo.data",
630              "* prop" : "store",
631              "items" : [
632               {
633                "$ url" : "baseURL + '/Roo/Cms_template_element'",
634                "method" : "GET",
635                "xtype" : "HttpProxy",
636                "$ xns" : "Roo.data",
637                "* prop" : "proxy"
638               },
639               {
640                "id" : "id",
641                "root" : "data",
642                "xtype" : "JsonReader",
643                "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]",
644                "$ xns" : "Roo.data",
645                "* prop" : "reader",
646                "totalProperty" : "total"
647               }
648              ]
649             }
650            ]
651           },
652           {
653            "alwaysQuery" : true,
654            "listWidth" : 600,
655            "triggerAction" : "all",
656            "fieldLabel" : "Menu links to Page",
657            "forceSelection" : true,
658            "selectOnFocus" : true,
659            "pageSize" : 40,
660            "displayField" : "page_link",
661            "emptyText" : "Select Page",
662            "hiddenName" : "menu_page_id",
663            "minChars" : 2,
664            "valueField" : "id",
665            "xtype" : "ComboBox",
666            "allowBlank" : true,
667            "typeAhead" : true,
668            "editable" : true,
669            "width" : 400,
670            "$ xns" : "Roo.form",
671            "name" : "menu_page_id_page_link",
672            "qtip" : "Select Category ",
673            "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><span style=\"color:#1b809e\">[{page_type_id_display_name}] </span><b>{title} </b><i>{page_link}</i></div>",
674            "loadingText" : "Searching...",
675            "items" : [
676             {
677              "listeners" : {
678               "beforeload" : "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    options.params['search[page_link_no_empty]'] =1;\n     \n    options.params['page_type_id_name[0]'] = 'page';\n    options.params['page_type_id_name[1]'] = 'blog';\n     /*\n     options.params.is_element = 0;\n     options.params.is_menuitem = 0;     \n     */\n}"
679              },
680              "xtype" : "Store",
681              "remoteSort" : true,
682              "$ sortInfo" : "{ field: 'title', direction: 'ASC' }",
683              "$ xns" : "Roo.data",
684              "* prop" : "store",
685              "items" : [
686               {
687                "$ url" : "baseURL + '/Roo/cms_page.php'",
688                "method" : "GET",
689                "xtype" : "HttpProxy",
690                "$ xns" : "Roo.data",
691                "* prop" : "proxy"
692               },
693               {
694                "id" : "id",
695                "root" : "data",
696                "xtype" : "JsonReader",
697                "$ fields" : "[\n    {\n        \"name\":\"id\",\n        \"type\":\"int\"\n    },\n    {\n        \"name\":\"title\",\n        \"type\":\"string\"\n    },\n    {\n        \"name\":\"page_link\",\n        \"type\":\"string\"\n    },\n    {\n        \"name\":\"page_type_id_display_name\",\n        \"type\":\"string\"\n    }\n]",
698                "$ xns" : "Roo.data",
699                "* prop" : "reader",
700                "totalProperty" : "total"
701               }
702              ]
703             }
704            ]
705           }
706          ]
707         },
708         {
709          "listeners" : {
710           "render" : "function (_self)\n{\n  _this.bodycol = _self;\n}"
711          },
712          "labelAlign" : "top",
713          "xtype" : "Column",
714          "width" : 900,
715          "$ xns" : "Roo.form",
716          "items" : [
717           {
718            "listeners" : {
719             "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
720             "savedpreview" : "function (_self)\n{\n    Roo.log('saved preview');\n    \n    var id = _this.form.findField('id').getValue() * 1;\n    \n    var successFn = function(res){\n        return res.data.POST.source;\n    };\n    \n    var params = {\n        action : 'AUTOSAVE',\n        remarks : 'BODY',\n        on_id : (id < 1) ? 0 : id,\n        on_table : 'cms_page',\n        successFn : successFn\n    };\n    \n    \n    Pman.Dialog.CoreAutoSavePreview.show(params, function(res){\n        _self.setValue(res);\n        _self.originalValue = res;\n    });\n}",
721             "autosave" : "function (_self)\n{\n    Roo.log('autosave');\n    \n    var id = _this.form.findField('id').getValue() * 1;\n    /*\n    if(!_self.editorcore.sourceEditMode){\n        _self.syncValue();\n    }else{\n        _self.pushValue();\n    }\n    */\n    new Pman.Request({\n        url : baseURL + '/Roo/Events.php',\n        method :'POST',\n        params : {\n            id : 0,\n            action : 'AUTOSAVE',\n            on_id : (id > 0) ? id : 0,\n            on_table : 'cms_page',\n            remarks : 'BODY',\n            source: _self.getValue()\n        },\n        success : function() {\n            _self.originalValue = _self.getValue();\n            \n        },\n        failure : function() \n        {\n            //Roo.MessageBox.alert(\"Error\", \"autosave failed\");\n            Roo.log('body autosave failed?!');\n        }\n    });\n    \n}"
722            },
723            "fieldLabel" : "Contents",
724            "xtype" : "HtmlEditor",
725            "width" : 550,
726            "$ xns" : "Roo.form",
727            "resizable" : "s",
728            "$ autosave" : "function() {\n    \n    var body = _this.form.findField('body');\n    \n    if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){\n        Roo.log('body not dirty');\n        return;\n    }\n    \n    Roo.log('body dirty, auto save!');\n    \n    body.fireEvent('autosave', body);\n        \n   \n}\n",
729            "$ array white" : "[ 'iframe' ]",
730            "name" : "body",
731            "height" : 140,
732            "items" : [
733             {
734              "xtype" : "ToolbarStandard",
735              "$ xns" : "Roo.form.HtmlEditor",
736              "* prop" : "toolbars[]",
737              "items" : [
738               {
739                "listeners" : {
740                 "render" : "function (_self)\n{\n    _this.bodyimgselect = _self;\n}",
741                 "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n \n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save Document First before adding images\");\n        return false;\n    }\n}",
742                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    \n    var editor = _this.form.findField('body').editorcore;\n    \n    var curnode = editor.getSelectedNode();\n    \n    if (curnode && curnode.tagName == 'IMG') {\n        curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',\n                baseURL,  record.data.id, record.data.filename\n            );\n            // note -forces an update... hopefully...\n        editor.owner.fireEvent('editorevent', editor, false);\n    } else {\n    \n        editor.insertAtCursor(\n            String.format('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n            baseURL,  record.data.id, record.data.filename\n            )\n        );\n\n    }\n    \n}"
743                },
744                "alwaysQuery" : true,
745                "listWidth" : 400,
746                "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><b>{filename}</b> </div>'",
747                "triggerAction" : "all",
748                "fieldLabel" : "Images",
749                "forceSelection" : true,
750                "selectOnFocus" : true,
751                "pageSize" : 20,
752                "displayField" : "name",
753                "emptyText" : "Add Image",
754                "minChars" : 2,
755                "valueField" : "id",
756                "xtype" : "ComboBox",
757                "typeAhead" : true,
758                "editable" : false,
759                "width" : 100,
760                "$ xns" : "Roo.form",
761                "* prop" : "btns[]",
762                "qtip" : "Select Images",
763                "queryParam" : "search",
764                "loadingText" : "Searching...",
765                "items" : [
766                 {
767                  "listeners" : {
768                   "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n    o.params.onid = id;\n    o.params.ontable = 'cms_page';\n   // o.params.imgtype = 'PressRelease';\n    //o.params['query[imagesize]'] = '150x150';\n    // set more here\n}\n"
769                  },
770                  "xtype" : "Store",
771                  "remoteSort" : true,
772                  "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
773                  "$ xns" : "Roo.data",
774                  "* prop" : "store",
775                  "items" : [
776                   {
777                    "$ url" : "baseURL + '/Roo/Images.php'",
778                    "xtype" : "HttpProxy",
779                    "method" : "GET",
780                    "$ xns" : "Roo.data",
781                    "* prop" : "proxy"
782                   },
783                   {
784                    "id" : "id",
785                    "root" : "data",
786                    "xtype" : "JsonReader",
787                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
788                    "$ xns" : "Roo.data",
789                    "* prop" : "reader",
790                    "totalProperty" : "total"
791                   }
792                  ]
793                 }
794                ]
795               },
796               {
797                "listeners" : {
798                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    var editor = _this.form.findField('body');\n    editor.editorcore.insertAtCursor(\n            String.format('<a href=\"#page-{0}\">{1}</a>',\n            record.data.page_link,  record.data.title\n            )\n     );\n\n    \n }"
799                },
800                "listWidth" : 200,
801                "triggerAction" : "all",
802                "forceSelection" : true,
803                "selectOnFocus" : true,
804                "pageSize" : 40,
805                "displayField" : "page_link",
806                "emptyText" : "Add Link",
807                "hiddenName" : "add_link_id",
808                "minChars" : 2,
809                "valueField" : "id",
810                "xtype" : "ComboBox",
811                "allowBlank" : true,
812                "typeAhead" : true,
813                "editable" : true,
814                "width" : 100,
815                "$ xns" : "Roo.form",
816                "* prop" : "btns[]",
817                "name" : "add_link",
818                "qtip" : "Select Category ",
819                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
820                "loadingText" : "Searching...",
821                "items" : [
822                 {
823                  "listeners" : {
824                   "beforeload" : "function (_self, options)\n{\n     options.params['search[page_link_no_empty]'] =1;\n     /*\n     options.params.is_element = 0;\n     options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;     \n     */\n}"
825                  },
826                  "xtype" : "Store",
827                  "remoteSort" : true,
828                  "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
829                  "$ xns" : "Roo.data",
830                  "* prop" : "store",
831                  "items" : [
832                   {
833                    "$ url" : "baseURL + '/Roo/cms_page.php'",
834                    "method" : "GET",
835                    "xtype" : "HttpProxy",
836                    "$ xns" : "Roo.data",
837                    "* prop" : "proxy"
838                   },
839                   {
840                    "id" : "id",
841                    "root" : "data",
842                    "xtype" : "JsonReader",
843                    "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
844                    "$ xns" : "Roo.data",
845                    "* prop" : "reader",
846                    "totalProperty" : "total"
847                   }
848                  ]
849                 }
850                ]
851               },
852               {
853                "xtype" : "Separator",
854                "$ xns" : "Roo.Toolbar",
855                "* prop" : "btns[]"
856               },
857               {
858                "listeners" : {
859                 "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
860                },
861                "String cls" : "x-init-enable",
862                "text" : "Saved Version",
863                "xtype" : "Button",
864                "$ xns" : "Roo.Toolbar",
865                "* prop" : "btns[]"
866               }
867              ]
868             },
869             {
870              "xtype" : "ToolbarContext",
871              "$ xns" : "Roo.form.HtmlEditor",
872              "* prop" : "toolbars[]"
873             }
874            ]
875           }
876          ]
877         },
878         {
879          "listeners" : {
880           "render" : "function (_self)\n{\n  _this.extendcol = _self;\n}"
881          },
882          "labelAlign" : "top",
883          "xtype" : "Column",
884          "width" : 900,
885          "$ xns" : "Roo.form",
886          "items" : [
887           {
888            "listeners" : {
889             "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
890             "savedpreview" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    var successFn = function(res){\n        return res.data.POST.source;\n    };\n    \n    var params = {\n        action : 'AUTOSAVE',\n        remarks : 'EXTENDED',\n        on_id : (id < 1) ? 0 : id,\n        on_table : 'cms_page',\n        successFn : successFn\n    };\n    \n    \n    Pman.Dialog.CoreAutoSavePreview.show(params, function(res){\n        _self.setValue(res);\n        _self.originalValue = res;\n    });\n}",
891             "autosave" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    /*\n    if(!_self.editorcore.sourceEditMode){\n        _self.syncValue();\n    }else{\n        _self.pushValue();\n    }\n    */\n    new Pman.Request({\n        url : baseURL + '/Roo/Events.php',\n        method :'POST',\n        params : {\n            id : 0,\n            action : 'AUTOSAVE',\n            on_id : (id > 0) ? id : 0,\n            on_table : 'cms_page',\n            remarks : 'EXTENDED',\n            source: _self.getValue()\n        },\n        success : function() {\n            _self.originalValue = _self.getValue();\n            \n        },\n        failure : function() \n        {\n            //Roo.MessageBox.alert(\"Error\", \"autosave failed\");\n            Roo.log('extended autosave failed?!');\n        }\n    });\n}"
892            },
893            "fieldLabel" : "Extended Contents",
894            "xtype" : "HtmlEditor",
895            "width" : 550,
896            "$ xns" : "Roo.form",
897            "resizable" : "s",
898            "$ autosave" : "function() {\n    \n    var extended = _this.form.findField('extended');\n    \n    if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){\n        Roo.log('extend not dirty');\n        return;\n    }\n\n    \n    Roo.log('extend dirty, auto save!');\n    \n    extended.fireEvent('autosave', extended);\n}\n",
899            "$ array white" : "[ 'iframe' ]",
900            "name" : "extended",
901            "height" : 160,
902            "items" : [
903             {
904              "xtype" : "ToolbarStandard",
905              "$ xns" : "Roo.form.HtmlEditor",
906              "* prop" : "toolbars[]",
907              "items" : [
908               {
909                "listeners" : {
910                 "render" : "function (_self)\n{\n    _this.extendimgselect = _self;\n}",
911                 "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n \n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save Document First before adding images\");\n        return false;\n    }\n}",
912                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    \n    var editor = _this.form.findField('extended').editorcore;\n    \n    var curnode = editor.getSelectedNode();\n    \n    if (curnode && curnode.tagName == 'IMG') {\n        curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',\n                baseURL,  record.data.id, record.data.filename\n            );\n            // note -forces an update... hopefully...\n        editor.owner.fireEvent('editorevent', editor, false);\n    } else {\n    \n        editor.insertAtCursor(\n            String.format('<img src=\"{0}/Images/{1}/{2}#image-{1}\">',\n            baseURL,  record.data.id, record.data.filename\n            )\n        );\n\n    }\n    \n}"
913                },
914                "alwaysQuery" : true,
915                "listWidth" : 400,
916                "triggerAction" : "all",
917                "fieldLabel" : "Images",
918                "forceSelection" : true,
919                "selectOnFocus" : true,
920                "pageSize" : 20,
921                "displayField" : "name",
922                "emptyText" : "Add Image",
923                "minChars" : 2,
924                "valueField" : "id",
925                "xtype" : "ComboBox",
926                "typeAhead" : true,
927                "editable" : false,
928                "width" : 100,
929                "$ xns" : "Roo.form",
930                "* prop" : "btns[]",
931                "qtip" : "Select Images",
932                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>",
933                "loadingText" : "Searching...",
934                "items" : [
935                 {
936                  "listeners" : {
937                   "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n    o.params.onid = id;\n    o.params.ontable = 'cms_page';\n   // o.params.imgtype = 'PressRelease';\n    //o.params['query[imagesize]'] = '150x150';\n    // set more here\n}\n"
938                  },
939                  "xtype" : "Store",
940                  "remoteSort" : true,
941                  "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
942                  "$ xns" : "Roo.data",
943                  "* prop" : "store",
944                  "items" : [
945                   {
946                    "$ url" : "baseURL + '/Roo/Images.php'",
947                    "xtype" : "HttpProxy",
948                    "method" : "GET",
949                    "$ xns" : "Roo.data",
950                    "* prop" : "proxy"
951                   },
952                   {
953                    "id" : "id",
954                    "root" : "data",
955                    "xtype" : "JsonReader",
956                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
957                    "$ xns" : "Roo.data",
958                    "* prop" : "reader",
959                    "totalProperty" : "total"
960                   }
961                  ]
962                 }
963                ]
964               },
965               {
966                "listeners" : {
967                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    var editor = _this.form.findField('body');\n    editor.editorcore.insertAtCursor(\n            String.format('<a href=\"#page-{0}\">{1}</a>',\n            record.data.page_link,  record.data.title\n            )\n     );\n\n    \n }"
968                },
969                "listWidth" : 200,
970                "triggerAction" : "all",
971                "forceSelection" : true,
972                "selectOnFocus" : true,
973                "pageSize" : 40,
974                "displayField" : "page_link",
975                "emptyText" : "Add Link",
976                "hiddenName" : "add_link_id",
977                "minChars" : 2,
978                "valueField" : "id",
979                "xtype" : "ComboBox",
980                "allowBlank" : true,
981                "typeAhead" : true,
982                "editable" : true,
983                "width" : 100,
984                "$ xns" : "Roo.form",
985                "* prop" : "btns[]",
986                "name" : "add_link",
987                "qtip" : "Select Category ",
988                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
989                "loadingText" : "Searching...",
990                "items" : [
991                 {
992                  "listeners" : {
993                   "beforeload" : "function (_self, options)\n{\n     options.params['search[page_link_no_empty]'] =1;\n     /*\n     options.params.is_element = 0;\n     options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;     \n     */\n}"
994                  },
995                  "xtype" : "Store",
996                  "remoteSort" : true,
997                  "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
998                  "$ xns" : "Roo.data",
999                  "* prop" : "store",
1000                  "items" : [
1001                   {
1002                    "$ url" : "baseURL + '/Roo/cms_page.php'",
1003                    "method" : "GET",
1004                    "xtype" : "HttpProxy",
1005                    "$ xns" : "Roo.data",
1006                    "* prop" : "proxy"
1007                   },
1008                   {
1009                    "id" : "id",
1010                    "root" : "data",
1011                    "xtype" : "JsonReader",
1012                    "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
1013                    "$ xns" : "Roo.data",
1014                    "* prop" : "reader",
1015                    "totalProperty" : "total"
1016                   }
1017                  ]
1018                 }
1019                ]
1020               },
1021               {
1022                "xtype" : "Separator",
1023                "$ xns" : "Roo.Toolbar",
1024                "* prop" : "btns[]"
1025               },
1026               {
1027                "listeners" : {
1028                 "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1029                },
1030                "text" : "Saved Version",
1031                "xtype" : "Button",
1032                "$ xns" : "Roo.Toolbar",
1033                "* prop" : "btns[]"
1034               }
1035              ]
1036             },
1037             {
1038              "xtype" : "ToolbarContext",
1039              "$ xns" : "Roo.form.HtmlEditor",
1040              "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
1041              "* prop" : "toolbars[]"
1042             }
1043            ]
1044           }
1045          ]
1046         },
1047         {
1048          "listeners" : {
1049           "render" : "function (_self)\n{\n  _this.keywordscol = _self;\n}"
1050          },
1051          "labelAlign" : "top",
1052          "xtype" : "Column",
1053          "width" : 950,
1054          "$ xns" : "Roo.form",
1055          "items" : [
1056           {
1057            "xtype" : "Row",
1058            "$ xns" : "Roo.form",
1059            "items" : [
1060             {
1061              "fieldLabel" : "Keywords",
1062              "xtype" : "TextArea",
1063              "width" : 350,
1064              "$ xns" : "Roo.form",
1065              "name" : "keywords",
1066              "height" : 150
1067             },
1068             {
1069              "fieldLabel" : "Descriptions",
1070              "xtype" : "TextArea",
1071              "width" : 350,
1072              "$ xns" : "Roo.form",
1073              "name" : "descriptions",
1074              "height" : 150
1075             }
1076            ]
1077           },
1078           {
1079            "xtype" : "Row",
1080            "$ xns" : "Roo.form",
1081            "items" : [
1082             {
1083              "fieldLabel" : "Styles (CSS)",
1084              "xtype" : "TextArea",
1085              "width" : 700,
1086              "$ xns" : "Roo.form",
1087              "name" : "extra_css",
1088              "height" : 150
1089             }
1090            ]
1091           }
1092          ]
1093         },
1094         {
1095          "listeners" : {
1096           "render" : "function (_self)\n{\n    _this.interestsCol = _self;\n}"
1097          },
1098          "labelAlign" : "top",
1099          "xtype" : "Column",
1100          "$ xns" : "Roo.form",
1101          "items" : [
1102           {
1103            "listeners" : {
1104             "render" : "function (_self)\n{\n    _this.interests = _self;\n    /*\n    _self.combo.addicon.setStyle( {\n        position : 'absolute',\n        right: '9px',\n        top : '2px',\n        float : 'left'\n    });\n    */\n}"
1105            },
1106            "fieldLabel" : "Interests",
1107            "xtype" : "ComboBoxArray",
1108            "hiddenName" : "interest",
1109            "width" : 300,
1110            "$ xns" : "Roo.form",
1111            "name" : "interest_name",
1112            "items" : [
1113             {
1114              "alwaysQuery" : true,
1115              "listWidth" : 400,
1116              "triggerAction" : "all",
1117              "fieldLabel" : "Interests",
1118              "forceSelection" : true,
1119              "selectOnFocus" : true,
1120              "displayField" : "display_name",
1121              "emptyText" : "Select interests",
1122              "minChars" : 2,
1123              "valueField" : "id",
1124              "xtype" : "ComboBox",
1125              "allowBlank" : true,
1126              "editable" : true,
1127              "width" : 285,
1128              "$ xns" : "Roo.form",
1129              "* prop" : "combo",
1130              "queryParam" : "query[name]",
1131              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
1132              "items" : [
1133               {
1134                "listeners" : {
1135                 "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    o.params.etype = 'crm_interest';\n}\n"
1136                },
1137                "xtype" : "Store",
1138                "remoteSort" : true,
1139                "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
1140                "$ xns" : "Roo.data",
1141                "* prop" : "store",
1142                "items" : [
1143                 {
1144                  "$ url" : "baseURL + '/Roo/Core_enum.php'",
1145                  "method" : "GET",
1146                  "xtype" : "HttpProxy",
1147                  "$ xns" : "Roo.data",
1148                  "* prop" : "proxy"
1149                 },
1150                 {
1151                  "id" : "id",
1152                  "root" : "data",
1153                  "xtype" : "JsonReader",
1154                  "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"name\",\"type\":\"string\"},\n    {\"name\":\"display_name\",\"type\":\"string\"}\n]",
1155                  "$ xns" : "Roo.data",
1156                  "* prop" : "reader",
1157                  "totalProperty" : "total"
1158                 }
1159                ]
1160               }
1161              ]
1162             }
1163            ]
1164           }
1165          ]
1166         },
1167         {
1168          "xtype" : "Hidden",
1169          "$ xns" : "Roo.form",
1170          "name" : "id"
1171         },
1172         {
1173          "xtype" : "Hidden",
1174          "$ xns" : "Roo.form",
1175          "name" : "is_system_page"
1176         },
1177         {
1178          "xtype" : "Hidden",
1179          "$ xns" : "Roo.form",
1180          "name" : "is_menuitem"
1181         },
1182         {
1183          "xtype" : "Hidden",
1184          "$ xns" : "Roo.form",
1185          "name" : "page_type_id_name"
1186         },
1187         {
1188          "listeners" : {
1189           "render" : "function (_self)\n{\n    _this.user_defined_fields = _self;\n}"
1190          },
1191          "xtype" : "Column",
1192          "$ xns" : "Roo.form"
1193         }
1194        ]
1195       }
1196      ]
1197     },
1198     {
1199      "listeners" : {
1200       "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
1201      },
1202      "fitToframe" : true,
1203      "background" : false,
1204      "region" : "east",
1205      "title" : "Images / Attachments",
1206      "xtype" : "GridPanel",
1207      "fitContainer" : true,
1208      "$ xns" : "Roo",
1209      "tableName" : "Images",
1210      "items" : [
1211       {
1212        "listeners" : {
1213         "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    var rd = _this.grid.getDataSource().getAt(rowIndex);\n    var id = rd.data.id;\n    var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);\n    _this.form.findField('contents').execCmd('insertimage', url);\n\n}",
1214         "|render" : "function() { \n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       //this.footer.onClick('first');\n    }\n}"
1215        },
1216        "autoExpandColumn" : "title",
1217        "xtype" : "EditorGrid",
1218        "loadMask" : true,
1219        "clicksToEdit" : 1,
1220        "$ xns" : "Roo.grid",
1221        "* prop" : "grid",
1222        "items" : [
1223         {
1224          "listeners" : {
1225           "|beforeload" : "function (_self, o)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n\n    if (id < 1) {\n        this.removeAll();\n        return false;\n    } \n    o.params = o.params || {};    \n    o.params.limit = 9999;          \n    o.params.onid = id;\n    o.params.ontable = 'cms_page';\n}",
1226           "update" : "function (_self, rec, operation)\n{\n    \n    new Pman.Request({\n        url : baseURL+'/Roo/Images.php',\n        method : 'POST',\n        params : rec.data,\n        success: function(res)\n        {\n            Roo.log(\"GOT success\");\n            // update the data...\n            _this.grid.ds.load({});\n        },\n        failure : function(res)\n        {\n            \n        }\n        \n        \n    });\n}"
1227          },
1228          "xtype" : "Store",
1229          "$ xns" : "Roo.data",
1230          "* prop" : "dataSource",
1231          "items" : [
1232           {
1233            "$ url" : "baseURL + '/Roo/Images.php'",
1234            "method" : "GET",
1235            "xtype" : "HttpProxy",
1236            "$ xns" : "Roo.data",
1237            "* prop" : "proxy"
1238           },
1239           {
1240            "id" : "id",
1241            "root" : "data",
1242            "xtype" : "JsonReader",
1243            "$ xns" : "Roo.data",
1244            "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'filename',\n        'type': 'string'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'width',\n        'type': 'int'\n    },\n    {\n        'name': 'height',\n        'type': 'int'\n    },\n    {\n        'name': 'filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'created',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'descript',\n        'type': 'string'\n    },\n    {\n        'name': 'title',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filename',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_onid',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_mimetype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_width',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_height',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_filesize',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_displayorder',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_language',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_parent_image_id',\n        'type': 'int'\n    },\n    {\n        'name': 'parent_image_id_created',\n        'type': 'date'\n    },\n    {\n        'name': 'parent_image_id_imgtype',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_linkurl',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_descript',\n        'type': 'string'\n    },\n    {\n        'name': 'parent_image_id_title',\n        'type': 'string'\n    }\n]",
1245            "* prop" : "reader",
1246            "totalProperty" : "total"
1247           }
1248          ]
1249         },
1250         {
1251          "xtype" : "Toolbar",
1252          "$ xns" : "Roo",
1253          "* prop" : "toolbar",
1254          "items" : [
1255           {
1256            "listeners" : {
1257             "|click" : "function()\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    if(id < 1){\n        return;\n    }\n    \n    Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {\n        Roo.log('load?????');\n        _this.grid.ds.load({});\n    }); \n\n}\n        "
1258            },
1259            "text" : "Add",
1260            "xtype" : "Button",
1261            "cls" : "x-btn-text-icon",
1262            "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1263            "$ xns" : "Roo"
1264           },
1265           {
1266            "listeners" : {
1267             "|click" : "function()\n{\n    var selection = _this.grid.getSelectionModel().getSelectedCell();\n    var sn = _this.grid.ds.getAt(selection[0]);\n    if (!sn || isNaN(sn.id *1)) {\n        Roo.MessageBox.alert(\"Error\", \"Select a image\"); \n        return;\n    }\n    Roo.MessageBox.confirm(\"Confirm\", \"Are sure you want to delete this image?\", function (v){\n        if (v != 'yes') {\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method: 'POST',\n            params : {\n                _delete : sn.id\n            },\n            success : function()\n            {\n                Roo.log('Got Success!!');\n               _this.grid.ds.load({});\n            }\n        });\n    });\n}\n        "
1268            },
1269            "text" : "Delete",
1270            "xtype" : "Button",
1271            "cls" : "x-btn-text-icon",
1272            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
1273            "$ xns" : "Roo"
1274           }
1275          ]
1276         },
1277         {
1278          "xtype" : "ColumnModel",
1279          "sortable" : false,
1280          "header" : "",
1281          "width" : 75,
1282          "$ renderer" : "function(v,x,r) { \n    return  String.format('<img src=\"{0}/Images/Thumb/100/{1}/{2}\" height=\"100\">', baseURL, v, r.data.filename); \n}",
1283          "$ xns" : "Roo.grid",
1284          "* prop" : "colModel[]",
1285          "dataIndex" : "id"
1286         },
1287         {
1288          "xtype" : "ColumnModel",
1289          "width" : 100,
1290          "header" : "Filename",
1291          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1292          "$ xns" : "Roo.grid",
1293          "* prop" : "colModel[]",
1294          "dataIndex" : "filename"
1295         },
1296         {
1297          "xtype" : "ColumnModel",
1298          "width" : 50,
1299          "header" : "Order",
1300          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1301          "$ xns" : "Roo.grid",
1302          "* prop" : "colModel[]",
1303          "dataIndex" : "displayorder",
1304          "items" : [
1305           {
1306            "xtype" : "GridEditor",
1307            "$ xns" : "Roo.grid",
1308            "* prop" : "editor",
1309            "items" : [
1310             {
1311              "listeners" : {
1312               "focus" : "function (_self)\n{\n    if (this.value == 0) {\n        this.el.dom.value = '';\n    }\n}"
1313              },
1314              "xtype" : "NumberField",
1315              "$ xns" : "Roo.form",
1316              "decimalPrecision" : 0,
1317              "* prop" : "field"
1318             }
1319            ]
1320           }
1321          ]
1322         },
1323         {
1324          "xtype" : "ColumnModel",
1325          "width" : 100,
1326          "header" : "Title",
1327          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1328          "$ xns" : "Roo.grid",
1329          "* prop" : "colModel[]",
1330          "dataIndex" : "title",
1331          "items" : [
1332           {
1333            "xtype" : "GridEditor",
1334            "$ xns" : "Roo.grid",
1335            "* prop" : "editor",
1336            "items" : [
1337             {
1338              "xtype" : "TextField",
1339              "$ xns" : "Roo.form",
1340              "* prop" : "field"
1341             }
1342            ]
1343           }
1344          ]
1345         },
1346         {
1347          "xtype" : "ColumnModel",
1348          "width" : 300,
1349          "header" : "URL",
1350          "$ renderer" : "function(v)\n{\n    return String.format('{0}', (v) ? v : '');\n}",
1351          "$ xns" : "Roo.grid",
1352          "* prop" : "colModel[]",
1353          "dataIndex" : "linkurl",
1354          "items" : [
1355           {
1356            "xtype" : "GridEditor",
1357            "$ xns" : "Roo.grid",
1358            "* prop" : "editor",
1359            "items" : [
1360             {
1361              "xtype" : "TextField",
1362              "$ xns" : "Roo.form",
1363              "* prop" : "field"
1364             }
1365            ]
1366           }
1367          ]
1368         }
1369        ]
1370       }
1371      ]
1372     },
1373     {
1374      "listeners" : {
1375       "resize" : "function (_self, width, height)\n{\n    Roo.log('resize called');\n    var ew = Math.max(250, width-50);\n    var eh = Math.max(250,height-50) ;\n    if (!_this.trform) {\n        return;\n        }\n        _this.trform.showHide();\n   \n    var bd = _this.trform.findField('body');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        // since render delays resize.. \n        bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n        _this.trbodycol.el.setWidth(bd.width+20);\n    }\n    var bd = _this.trform.findField('extended');\n    if (bd.resizeEl) { \n        bd.width = ew;\n        bd.height = eh;\n        // since render delays resize.. \n        bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height  ] );\n        _this.trextendcol.el.setWidth(bd.width+20);\n    }\n\n}",
1376       "render" : "function (_self)\n{\n  _this.trpanel = _self;\n}"
1377      },
1378      "autoScroll" : true,
1379      "fitToFrame" : true,
1380      "region" : "west",
1381      "xtype" : "ContentPanel",
1382      "$ xns" : "Roo",
1383      "items" : [
1384       {
1385        "listeners" : {
1386         "|actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask();\n \n    Pman.standardActionFailed(_self, action);\n}\n",
1387         "|actioncomplete" : "function (_self, action)\n{\n\n   if (action.type =='submit') {\n       //   _this.dialog.el.mask(\"Saving\");\n        return;\n    }\n    \n    if (action.type == 'setdata') {    \n          \n          if ( _this.data.id) {\n               // _this.dialog.el.mask(\"Loading\");\n                this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n           } else {\n                \n                //_this.loaded = true;\n                 this.trpanel.el.mask(\"save first\");\n          }\n\n       return;\n      \n    }\n    \n    if (action.type == 'load') {\n//        _this.dialog.el.unmask();\n        this.showHide();\n        \n        _this.trform.findField('body').originalValue = _this.trform.findField('body').getValue();\n       _this.trform.findField('extended').originalValue = _this.trform.findField('extended').getValue();\n  \n        return;\n    }\n}\n",
1388         "|rendered" : "function (_self)\n{\n    _this.trform = _self;\n}\n"
1389        },
1390        "labelAlign" : "right",
1391        "$ url" : "baseURL + '/Roo/cms_page.php'",
1392        "method" : "POST",
1393        "style" : "margin: 5px",
1394        "xtype" : "Form",
1395        "labelWidth" : 120,
1396        "$ showHide" : "function() {\n\n  //  var in_rss= _this.form.findField('in_rss').getValue() * 1;\n    var has_extended = _this.form.findField('has_extended').getValue() * 1;\n    var has_lang = _this.trform.findField('language').getValue().length;\n    \n    var vis = {\n        //category_id : in_rss,\n        //page_link : !in_rss, // blogs which have perm links?\n        //is_element : !in_rss,        \n        //parent_id : !in_rss,\n        //published : in_rss,\n        //to_replace_id : !in_rss, // is this used.\n        //has_extended : true, // always shown.\n        extended : has_lang && has_extended,\n        body : has_lang,\n        title : has_lang,\n        descriptions : has_lang,\n        keywords : has_lang\n        //author_id : in_rss\n        \n    };\n    for(var k in vis) {\n        var el = _this.trform.findField(k);\n        el.actionMode = 'fieldEl';\n        if (    vis[k]) {\n            Roo.log(\"show: \" + k);\n            el.show();\n        } else{ \n            Roo.log(\"hide: \" + k);\n            el.hide();\n        }\n\n    }\n\n    _this.updateRow.el[has_lang ? 'show' : 'hide']();\n    // we should now trigger the panel resize event..\n   \n    \n    if(typeof(_this.trform.editors) == 'undefined'){\n        _this.trform.editors = {\n            body : _this.trform.findField('body').wrap.isVisible(),\n            extended : _this.trform.findField('extended').wrap.isVisible()\n       };\n       if(_this.trform.editors.body){\n            setInterval(_this.trform.findField('body').autosave, 60000);\n       }\n       \n       if(_this.trform.editors.extended){\n            setInterval(_this.trform.findField('extended').autosave, 60000);\n       }\n   }\n   \n   if(!_this.trform.editors.body && _this.trform.findField('body').wrap.isVisible()){\n        setInterval(_this.trform.findField('body').autosave, 60000);\n        _this.trform.editors.body = true;\n   }\n   \n   if(!_this.trform.editors.extended && _this.trform.findField('extended').wrap.isVisible()){\n        setInterval(_this.trform.findField('extended').autosave, 60000);\n        _this.trform.editors.extended = true;\n   }\n    \n    \n    \n    \n}\n",
1397        "$ xns" : "Roo.form",
1398        "items" : [
1399         {
1400          "labelAlign" : "top",
1401          "xtype" : "Column",
1402          "width" : 400,
1403          "$ xns" : "Roo.form",
1404          "items" : [
1405           {
1406            "labelAlign" : "top",
1407            "xtype" : "Row",
1408            "width" : 400,
1409            "$ xns" : "Roo.form",
1410            "items" : [
1411             {
1412              "listeners" : {
1413               "add" : "function (combo)\n{\n    Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {\n       // Roo.log(res);\n        combo.setValue(res.lang);\n        combo.el.dom.value = res.lang_name;\n        (function() { \n            _this.trform.showHide();\n           _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ]  );\n       }).defer(100); \n    });\n    \n}",
1414               "render" : "function (_self)\n{\n    _this.language = _self;\n}",
1415               "select" : "function (combo, record, index)\n{\n    (function() { \n        _this.trform.showHide();\n       _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ]  );\n   }).defer(100); \n    \n    \n   _this.trform.load({\n    \n        method: 'GET', \n        params: {\n            'lookup[language]' : record.data.language,\n            'lookup[translation_of_id]' : _this.data.id,\n            'lookup[_id]' : 1\n        }\n   });\n}"
1416              },
1417              "alwaysQuery" : true,
1418              "listWidth" : 400,
1419              "triggerAction" : "all",
1420              "fieldLabel" : "Select Language",
1421              "forceSelection" : true,
1422              "selectOnFocus" : true,
1423              "pageSize" : 20,
1424              "displayField" : "language_name",
1425              "emptyText" : "Select Language",
1426              "hiddenName" : "language",
1427              "minChars" : 2,
1428              "valueField" : "language",
1429              "xtype" : "ComboBox",
1430              "typeAhead" : false,
1431              "editable" : false,
1432              "$ xns" : "Roo.form",
1433              "name" : "language_name",
1434              "qtip" : "Select Language",
1435              "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>",
1436              "loadingText" : "Searching...",
1437              "items" : [
1438               {
1439                "listeners" : {
1440                 "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._distinct = 'language';\n    o.params._columns ='language_name,language';\n    o.params._with_name = true;\n    \n    if(_this.form.findField('id').getValue()*1 > 0){\n        o.params.translation_of_id = _this.form.findField('id').getValue();\n    }\n    \n}\n"
1441                },
1442                "xtype" : "Store",
1443                "remoteSort" : true,
1444                "$ sortInfo" : "{ direction : 'ASC', field: 'language' }",
1445                "$ xns" : "Roo.data",
1446                "* prop" : "store",
1447                "items" : [
1448                 {
1449                  "$ url" : "baseURL + '/Roo/Cms_page.php'",
1450                  "method" : "GET",
1451                  "xtype" : "HttpProxy",
1452                  "$ xns" : "Roo.data",
1453                  "* prop" : "proxy"
1454                 },
1455                 {
1456                  "id" : "id",
1457                  "root" : "data",
1458                  "xtype" : "JsonReader",
1459                  "$ fields" : "[{\"name\":\"language\",\"type\":\"string\"}]",
1460                  "$ xns" : "Roo.data",
1461                  "* prop" : "reader",
1462                  "totalProperty" : "total"
1463                 }
1464                ]
1465               }
1466              ]
1467             },
1468             {
1469              "listeners" : {
1470               "render" : "function (_self)\n{\n_this.updateRow = _self;\n}"
1471              },
1472              "xtype" : "Row",
1473              "style" : "padding-top:12px;padding-left:30px;float:left",
1474              "width" : 100,
1475              "$ xns" : "Roo.form",
1476              "items" : [
1477               {
1478                "listeners" : {
1479                 "click" : " function()\n {\n    //   _this.dialog.el.mask(\"Saving\");\n    if(!_this.trform.findField('body').editorcore.sourceEditMode){\n        _this.trform.findField('body').syncValue(); \n        _this.trform.findField('extended').syncValue();\n    }else{\n        _this.trform.findField('body').pushValue();\n        _this.trform.findField('extended').pushValue();\n    }\n    \n    _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());\n    _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());\n    _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());\n    _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());\n    _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());\n    \n    if(_this.trform.findField('element_id').getValue()*1 > 0){\n        _this.trform.findField('is_element').setValue(1);\n    }\n    \n    _this.trform.doAction(\"submit\");\n}\n"
1480                },
1481                "text" : "Update",
1482                "xtype" : "Button",
1483                "$ xns" : "Roo"
1484               }
1485              ]
1486             }
1487            ]
1488           },
1489           {
1490            "fieldLabel" : "Title",
1491            "xtype" : "TextField",
1492            "width" : 400,
1493            "$ xns" : "Roo.form",
1494            "name" : "title"
1495           }
1496          ]
1497         },
1498         {
1499          "listeners" : {
1500           "render" : "function (_self)\n{\n  _this.trbodycol = _self;\n}"
1501          },
1502          "labelAlign" : "top",
1503          "xtype" : "Column",
1504          "width" : 1000,
1505          "$ xns" : "Roo.form",
1506          "items" : [
1507           {
1508            "listeners" : {
1509             "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
1510             "savedpreview" : "function (_self)\n{\n    var id = _this.trform.findField('id').getValue() * 1;\n    \n    var successFn = function(res){\n        return res.data.POST.source;\n    };\n    \n    var params = {\n        action : 'AUTOSAVE',\n        remarks : 'BODY',\n        on_id : (id < 1) ? 0 : id,\n        on_table : 'cms_page',\n        successFn : successFn\n    };\n    \n    \n    Pman.Dialog.CoreAutoSavePreview.show(params, function(res){\n        _self.setValue(res);\n        _self.originalValue = res;\n    });\n}",
1511             "autosave" : "function (_self)\n{\n    var id = _this.trform.findField('id').getValue() * 1;\n    \n    /*\n    if(!_self.editorcore.sourceEditMode){\n        _self.syncValue();\n    }else{\n        _self.pushValue();\n    }\n    */\n    new Pman.Request({\n        url : baseURL + '/Roo/Events.php',\n        method :'POST',\n        params : {\n            id : 0,\n            action : 'AUTOSAVE',\n            on_id : (id > 0) ? id : 0,\n            on_table : 'cms_page',\n            remarks : 'BODY',\n            source: _self.getValue()\n        },\n        success : function() {\n            _self.originalValue = _self.getValue();\n            \n        },\n        failure : function() \n        {\n            //Roo.MessageBox.alert(\"Error\", \"autosave failed\");\n            Roo.log('tr body autosave failed?!');\n        }\n    });\n}"
1512            },
1513            "fieldLabel" : "Contents",
1514            "xtype" : "HtmlEditor",
1515            "$ xns" : "Roo.form",
1516            "resizable" : "s",
1517            "$ autosave" : "function() {\n    \n    var body = _this.trform.findField('body');\n    \n    if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){\n        Roo.log('tr body not dirty');\n        return;\n    }\n\n    Roo.log('tr body dirty, auto save!');\n    \n    body.fireEvent('autosave', body);\n}\n",
1518            "$ array white" : "[ 'iframe' ]",
1519            "name" : "body",
1520            "height" : 140,
1521            "items" : [
1522             {
1523              "xtype" : "ToolbarStandard",
1524              "$ xns" : "Roo.form.HtmlEditor",
1525              "* prop" : "toolbars[]",
1526              "items" : [
1527               {
1528                "listeners" : {
1529                 "render" : "function (_self)\n{\n    _this.trbodyimgselect = _self;\n}",
1530                 "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n \n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n}",
1531                 "select" : "function (combo, record, index)\n{\n    Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    \n    var editor = _this.trform.findField('body').editorcore;\n    \n    var curnode = editor.getSelectedNode();\n    \n    if (curnode && curnode.tagName == 'IMG') {\n        curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',\n                baseURL,  record.data.id, record.data.filename\n            );\n            // note -forces an update... hopefully...\n        editor.owner.fireEvent('editorevent', editor, false);\n    } else {\n    \n        editor.insertAtCursor(\n            String.format('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n            baseURL,  record.data.id, record.data.filename\n            )\n        );\n\n    }\n    \n}"
1532                },
1533                "alwaysQuery" : true,
1534                "listWidth" : 400,
1535                "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><b>{filename}</b> </div>'",
1536                "triggerAction" : "all",
1537                "fieldLabel" : "Images",
1538                "forceSelection" : true,
1539                "selectOnFocus" : true,
1540                "pageSize" : 20,
1541                "displayField" : "name",
1542                "emptyText" : "Add Image",
1543                "minChars" : 2,
1544                "valueField" : "id",
1545                "xtype" : "ComboBox",
1546                "typeAhead" : true,
1547                "editable" : false,
1548                "width" : 100,
1549                "$ xns" : "Roo.form",
1550                "* prop" : "btns[]",
1551                "qtip" : "Select Images",
1552                "loadingText" : "Searching...",
1553                "items" : [
1554                 {
1555                  "listeners" : {
1556                   "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    var id = _this.form.findField('id').getValue() * 1;    \n    if (!id) {\n        Roo.MessageBox.alert(\"Error\", \"Save press release first\");\n        return false;\n    }\n    o.params.onid = id;\n    o.params.ontable = 'cms_page';\n   // o.params.imgtype = 'PressRelease';\n    //o.params['query[imagesize]'] = '150x150';\n    // set more here\n}\n"
1557                  },
1558                  "xtype" : "Store",
1559                  "remoteSort" : true,
1560                  "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1561                  "$ xns" : "Roo.data",
1562                  "* prop" : "store",
1563                  "items" : [
1564                   {
1565                    "$ url" : "baseURL + '/Roo/Images.php'",
1566                    "xtype" : "HttpProxy",
1567                    "method" : "GET",
1568                    "$ xns" : "Roo.data",
1569                    "* prop" : "proxy"
1570                   },
1571                   {
1572                    "id" : "id",
1573                    "root" : "data",
1574                    "xtype" : "JsonReader",
1575                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
1576                    "$ xns" : "Roo.data",
1577                    "* prop" : "reader",
1578                    "totalProperty" : "total"
1579                   }
1580                  ]
1581                 }
1582                ]
1583               },
1584               {
1585                "listeners" : {
1586                 "select" : "function (combo, record, index)\n{\n  //  Roo.log(record);\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n    var editor = _this.form.findField('body');\n    editor.insertAtCursor(\n            String.format('<a href=\"#page-{0}\">{1}</a>',\n            record.data.page_link,  record.data.title\n            )\n     );\n\n    \n }"
1587                },
1588                "listWidth" : 200,
1589                "triggerAction" : "all",
1590                "forceSelection" : true,
1591                "selectOnFocus" : true,
1592                "pageSize" : 40,
1593                "displayField" : "page_link",
1594                "emptyText" : "Add Link",
1595                "hiddenName" : "add_link_id",
1596                "minChars" : 2,
1597                "valueField" : "id",
1598                "xtype" : "ComboBox",
1599                "allowBlank" : true,
1600                "typeAhead" : true,
1601                "editable" : true,
1602                "width" : 100,
1603                "$ xns" : "Roo.form",
1604                "* prop" : "btns[]",
1605                "name" : "add_link",
1606                "qtip" : "Select Category ",
1607                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
1608                "loadingText" : "Searching...",
1609                "items" : [
1610                 {
1611                  "listeners" : {
1612                   "beforeload" : "function (_self, options)\n{\n     options.params['search[page_link_no_empty]'] =1; \n     /*\n     options.params.is_element = 0;\n     options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;     \n     */\n}"
1613                  },
1614                  "xtype" : "Store",
1615                  "remoteSort" : true,
1616                  "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
1617                  "$ xns" : "Roo.data",
1618                  "* prop" : "store",
1619                  "items" : [
1620                   {
1621                    "$ url" : "baseURL + '/Roo/cms_page.php'",
1622                    "method" : "GET",
1623                    "xtype" : "HttpProxy",
1624                    "$ xns" : "Roo.data",
1625                    "* prop" : "proxy"
1626                   },
1627                   {
1628                    "id" : "id",
1629                    "root" : "data",
1630                    "xtype" : "JsonReader",
1631                    "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
1632                    "$ xns" : "Roo.data",
1633                    "* prop" : "reader",
1634                    "totalProperty" : "total"
1635                   }
1636                  ]
1637                 }
1638                ]
1639               },
1640               {
1641                "xtype" : "Separator",
1642                "$ xns" : "Roo.Toolbar",
1643                "* prop" : "btns[]"
1644               },
1645               {
1646                "listeners" : {
1647                 "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1648                },
1649                "text" : "Saved Version",
1650                "xtype" : "Button",
1651                "$ xns" : "Roo.Toolbar",
1652                "* prop" : "btns[]"
1653               }
1654              ]
1655             },
1656             {
1657              "xtype" : "ToolbarContext",
1658              "$ xns" : "Roo.form.HtmlEditor",
1659              "* prop" : "toolbars[]"
1660             }
1661            ]
1662           }
1663          ]
1664         },
1665         {
1666          "listeners" : {
1667           "render" : "function (_self)\n{\n  _this.trextendcol = _self;\n}"
1668          },
1669          "labelAlign" : "top",
1670          "xtype" : "Column",
1671          "$ xns" : "Roo.form",
1672          "items" : [
1673           {
1674            "listeners" : {
1675             "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
1676             "savedpreview" : "function (_self)\n{\n    var id = _this.trform.findField('id').getValue() * 1;\n    \n    var successFn = function(res){\n        return res.data.POST.source;\n    };\n    \n    var params = {\n        action : 'AUTOSAVE',\n        remarks : 'EXTENDED',\n        on_id : (id < 1) ? 0 : id,\n        on_table : 'cms_page',\n        successFn : successFn\n    };\n    \n    \n    Pman.Dialog.CoreAutoSavePreview.show(params, function(res){\n        _self.setValue(res);\n        _self.originalValue = res;\n    });\n}",
1677             "autosave" : "function (_self)\n{\n    var id = _this.trform.findField('id').getValue() * 1;\n    \n    /*\n    if(!_self.editorcore.sourceEditMode){\n        _self.syncValue();\n    }else{\n        _self.pushValue();\n    }\n    */\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Events.php',\n        method :'POST',\n        params : {\n            id : 0,\n            action : 'AUTOSAVE',\n            on_id : (id > 0) ? id : 0,\n            on_table : 'cms_page',\n            remarks : 'EXTENDED',\n            source: _self.getValue()\n        },\n        success : function() {\n            _self.originalValue = _self.getValue();\n            \n        },\n        failure : function() \n        {\n            //Roo.MessageBox.alert(\"Error\", \"autosave failed\");\n            Roo.log('tr extended autosave failed?!');\n        }\n    });\n}"
1678            },
1679            "fieldLabel" : "Extended Contents",
1680            "xtype" : "HtmlEditor",
1681            "$ xns" : "Roo.form",
1682            "resizable" : "s",
1683            "$ autosave" : "function() {\n    \n    var extended = _this.trform.findField('extended');\n    \n    if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){\n        Roo.log('tr extend not dirty');\n        return;\n    }\n\n    \n    Roo.log('tr extend dirty, auto save!');\n    \n    extended.fireEvent('autosave', extended);\n        \n   \n}\n",
1684            "$ array white" : "[ 'iframe' ]",
1685            "name" : "extended",
1686            "height" : 140,
1687            "items" : [
1688             {
1689              "xtype" : "ToolbarStandard",
1690              "$ xns" : "Roo.form.HtmlEditor",
1691              "* prop" : "toolbars[]",
1692              "items" : [
1693               {
1694                "xtype" : "Separator",
1695                "$ xns" : "Roo.Toolbar",
1696                "* prop" : "btns[]"
1697               },
1698               {
1699                "listeners" : {
1700                 "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1701                },
1702                "text" : "Saved Version",
1703                "xtype" : "Button",
1704                "$ xns" : "Roo.Toolbar",
1705                "* prop" : "btns[]"
1706               }
1707              ]
1708             },
1709             {
1710              "xtype" : "ToolbarContext",
1711              "$ xns" : "Roo.form.HtmlEditor",
1712              "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
1713              "* prop" : "toolbars[]"
1714             }
1715            ]
1716           }
1717          ]
1718         },
1719         {
1720          "listeners" : {
1721           "render" : "function (_self)\n{\n  _this.trkeywordscol = _self;\n}"
1722          },
1723          "labelAlign" : "top",
1724          "xtype" : "Column",
1725          "$ xns" : "Roo.form",
1726          "items" : [
1727           {
1728            "fieldLabel" : "Keywords",
1729            "xtype" : "TextArea",
1730            "width" : 450,
1731            "$ xns" : "Roo.form",
1732            "name" : "keywords",
1733            "height" : 150
1734           },
1735           {
1736            "fieldLabel" : "Descriptions",
1737            "xtype" : "TextArea",
1738            "width" : 450,
1739            "$ xns" : "Roo.form",
1740            "name" : "descriptions",
1741            "height" : 150
1742           }
1743          ]
1744         },
1745         {
1746          "xtype" : "Hidden",
1747          "$ xns" : "Roo.form",
1748          "name" : "id"
1749         },
1750         {
1751          "xtype" : "Hidden",
1752          "$ xns" : "Roo.form",
1753          "name" : "element_id"
1754         },
1755         {
1756          "xtype" : "Hidden",
1757          "$ xns" : "Roo.form",
1758          "name" : "menu_page_id"
1759         },
1760         {
1761          "xtype" : "Hidden",
1762          "$ xns" : "Roo.form",
1763          "name" : "is_menuitem"
1764         },
1765         {
1766          "xtype" : "Hidden",
1767          "value" : 0,
1768          "$ xns" : "Roo.form",
1769          "name" : "is_element"
1770         },
1771         {
1772          "xtype" : "Hidden",
1773          "$ xns" : "Roo.form",
1774          "name" : "translation_of_id"
1775         },
1776         {
1777          "xtype" : "Hidden",
1778          "$ xns" : "Roo.form",
1779          "name" : "parent_id"
1780         }
1781        ]
1782       }
1783      ]
1784     },
1785     {
1786      "listeners" : {
1787       "|click" : " function() {\n\n    _this.form.reset();\n\n    _this.dialog.hide();\n\n}\n"
1788      },
1789      "text" : "Cancel",
1790      "xtype" : "Button",
1791      "$ xns" : "Roo",
1792      "* prop" : "buttons[]"
1793     },
1794     {
1795      "listeners" : {
1796       "|click" : " function() {\n\n        _this.exit = false;\n        \n       _this.dialog.el.mask(\"Saving\");\n       \n       if(!_this.form.findField('body').editorcore.sourceEditMode){\n            _this.form.findField('body').syncValue();\n            _this.form.findField('extended').syncValue();\n        }else{\n            _this.form.findField('body').pushValue();\n            _this.form.findField('extended').pushValue();\n        }\n        \n        if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf(\"Crm\") == -1){\n            _this.interests.reset();\n        }\n        \n     _this.form.doAction(\"submit\");\n\n}\n"
1797      },
1798      "text" : "Save",
1799      "xtype" : "Button",
1800      "$ xns" : "Roo",
1801      "* prop" : "buttons[]"
1802     },
1803     {
1804      "listeners" : {
1805       "|click" : " function() {\n\n        _this.exit = true;\n        \n       _this.dialog.el.mask(\"Saving\");\n       \n       if(!_this.form.findField('body').editorcore.sourceEditMode){\n            _this.form.findField('body').syncValue();\n            _this.form.findField('extended').syncValue();\n        }else{\n            _this.form.findField('body').pushValue();\n            _this.form.findField('extended').pushValue();\n        }\n        \n        if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf(\"Crm\") == -1){\n            _this.interests.reset();\n        }\n        \n     _this.form.doAction(\"submit\");\n\n}\n"
1806      },
1807      "text" : "Save and close",
1808      "xtype" : "Button",
1809      "$ xns" : "Roo",
1810      "* prop" : "buttons[]"
1811     }
1812    ]
1813   }
1814  ]
1815 }