e64f68da1a3da74496476d184ac4a6ce75a7ca4d
[Pman.Cms] / Pman.Dialog.CmsBlog.bjs
1 {
2  "name" : "Pman.Dialog.CmsBlog",
3  "parent" : "",
4  "title" : "Cms -Edit Blog Entry",
5  "path" : "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsBlog.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   "31fde7b05ac8952dacf4af8a704074ec" : "Preview",
18   "779e2624ddf330fb05b51ae59faf212d" : "Select Status Type",
19   "6a5b847af3d97df722040debdbccfbed" : "Page Type",
20   "30d1a216420426fcbd43ca70acd4aa48" : "Select interests",
21   "cc6892c9705afcfa61c53698756ba51b" : "Page Class",
22   "e6b391a8d2c4d45902a23a8b6585703d" : "URL",
23   "03368e3c1eb4d2a9048775874301b19f" : "Select category",
24   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
25   "778551900655782c5c7827332b08cf3f" : "Save and close",
26   "77174410b72decfd0b259961f1f65a8f" : "Attributes:",
27   "b28a711cf7e94ec793ef926633997529" : "Seq",
28   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
29   "8a53accfc94c2500b00575ce0e0d786f" : "Primary Image",
30   "580b21aac58f1b73cece26e272cdfbee" : "Add Link",
31   "8bc84316c4078bf66723fd019616d920" : "Descriptions",
32   "83dad8107f9459efe2b4fabcf5b63108" : "Select Language",
33   "76729937a5eb6b0fd88c42581161facd" : "Select Category ",
34   "14c21301c0faf9d5561b8a580be21a13" : "Select class",
35   "0b8d92bc19b720bb1065649535463409" : "Translations",
36   "d41d8cd98f00b204e9800998ecf8427e" : "",
37   "867343577fa1f33caa632a19543bd252" : "Keywords",
38   "340c2ee497b85d5954b01c64de7f44f6" : "Select Person",
39   "69dd756ae9c23191a5bb9b61f0857432" : "Date to Publish",
40   "3adbdb3ac060038aa0e6e6c138ef9873" : "Category",
41   "57e195426892c5515935f21d97228814" : "Extended Contents",
42   "d88aa1eee60ba140f07d5f81769cec74" : "<< Edit Translations",
43   "b9c49611cfda3259a2b837b39489e650" : "Add Image",
44   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
45   "cfcd208495d565ef66e7dff9f98764da" : "0",
46   "d8e4d1f5e445107e505b2cf63a1fb65c" : "Extra CSS",
47   "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
48   "31bb2f6e9b8fb11cbb7fb63c6025223f" : "Select Template",
49   "c02bd0c22c290ae599ee2f3ff2023fd3" : "Manage Images / Attachments >>",
50   "b78a3223503896721cca1303f776159b" : "Title",
51   "39f64cc9436cacfbceda3b7bdeb8e24c" : "Styles (CSS)",
52   "e64df1d7c22b9638f084ce8a4aff3ff3" : "Target URL",
53   "98e93e8f7adfe14832db6caed713d849" : "Meta Tags",
54   "a240fa27925a635b08dc28c9e4f9216d" : "Order",
55   "287234a1ff35a314b5b6bc4e5828e745" : "Attributes",
56   "99e7707748ae048e17c5810fad119e0b" : "Select Page",
57   "06933067aafd48425d67bcb01bba5cb6" : "Update",
58   "8adedb6a6226807ba810215dd3b3c61b" : "Menu links to Page",
59   "b5216c9b4e0ac0afd9c76eb1d12ad1b9" : "Select Section",
60   "308f2757bfc9ce92fb00ff93fdffd279" : "Images / Attachments",
61   "76eb64a1725ee953c664e15c9213b2fd" : "Extended Content",
62   "1351017ac6423911223bc19a8cb7c653" : "Filename",
63   "c9cc8cce247e49bae79f15173ce97354" : "Save",
64   "e659b52eba1f0299b2d8ca3483919e72" : "Type:",
65   "c70952e4ab3806c049737cd7d2b8896b" : "Interests",
66   "aa6356b678bc4fc78253c9edf65bff03" : "Edit Page / Blog Entry",
67   "d52f80f80467bb575253a5a39ca016a7" : "Page link /  Name / Order",
68   "fff0d600f8a0b5e19e88bfb821dd1157" : "Images",
69   "30269022e9d8f51beaabb52e5d0de2b7" : "Parent",
70   "fb3f11443065d5f4d8303ad913db9680" : "Replaces (ignore)"
71  },
72  "items" : [
73   {
74    "listeners" : {
75     "show" : "function (_self)\n{\n    // @see the contentpanel - center - resize handler.\n\n    _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);\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    _this.centerLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);\n    \n    _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);\n    \n    Pman.Cms.pageEditAddCustomFields();\n    \n    /*\n    var ew = Math.max(250, w-150); // was 350?/ why?\n    //var eh = Math.max(250, h-350) ;\n    var eh = 200;\n    \n    var bd = _this.form1.findField('body');\n    \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.form2.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.form3.findField('extra_css');\n    if (bd) { \n        bd.el.setWidth(ew);\n       //_this.keywordscol.el.setWidth(ew+20);\n    }\n    \n    // fix messed up scroll.\n    _this.dialog.layout.el.dom.scrollTop = 0;\n    \n    */\n}"
76    },
77    "modal" : true,
78    "collapsible" : false,
79    "background" : true,
80    "title" : "Edit Page / Blog Entry",
81    "xtype" : "LayoutDialog",
82    "| 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\n            _this.form1.findField('body').removeStylesheets();\n            _this.form2.findField('extended').removeStylesheets();\n\n            _this.form1.findField('body').setStylesheets(sheets);\n            _this.form2.findField('extended').setStylesheets(sheets);\n\n            _this.trform1.findField('body').removeStylesheets();\n            _this.trform2.findField('extended').removeStylesheets();\n            \n            _this.trform1.findField('body').setStylesheets(sheets);\n            _this.trform2.findField('extended').setStylesheets(sheets);\n       }\n   });\n\n}",
83    "width" : 850,
84    "$ xns" : "Roo",
85    "closable" : true,
86    "resizable" : false,
87    "height" : 600,
88    "items" : [
89     {
90      "xtype" : "LayoutRegion",
91      "$ xns" : "Roo",
92      "* prop" : "center",
93      "titlebar" : false
94     },
95     {
96      "listeners" : {
97       "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}",
98       "beforecollapse" : "function (_self)\n{\n    if(!_this.trform || !_this.trform1 || !_this.trform2){\n        return true;\n    }\n    \n    if(\n        !_this.trform.isDirty() &&\n        !_this.trform1.isDirty() &&\n        !_this.trform2.isDirty() &&\n        !_this.trform3.isDirty()\n    ) {\n        return true;\n    }\n    \n    Roo.MessageBox.confirm(\n        \"Confirm\", \n        \"Do you want to save the translation\",\n        function(res) {\n            if(res != 'yes') {\n                _self.collapse(true, true);\n                return true;\n            }\n            \n            return false;\n        }\n    );\n    \n    return false;\n}"
99      },
100      "collapsedTitle" : "Translations",
101      "collapsible" : true,
102      "fitToFrame" : true,
103      "title" : "Translations",
104      "xtype" : "LayoutRegion",
105      "collapsed" : true,
106      "$ xns" : "Roo",
107      "split" : true,
108      "* prop" : "west",
109      "titlebar" : true
110     },
111     {
112      "listeners" : {
113       "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.dialog.getLayout().getRegion('west').collapse();\n}"
114      },
115      "collapsedTitle" : "Images / Attachments",
116      "collapsible" : true,
117      "fitToFrame" : true,
118      "title" : "Images / Attachments",
119      "xtype" : "LayoutRegion",
120      "collapsed" : true,
121      "$ xns" : "Roo",
122      "split" : true,
123      "* prop" : "east",
124      "titlebar" : true
125     },
126     {
127      "listeners" : {
128       "render" : "function (_self)\n{\n    _this.centerLayoutPanel = this;\n    \n}"
129      },
130      "Boolean fitContainer" : true,
131      "xtype" : "NestedLayoutPanel",
132      "Boolean fitToFrame" : true,
133      "$ xns" : "Roo",
134      "String region" : "center",
135      "Boolean background" : false,
136      "items" : [
137       {
138        "xtype" : "BorderLayout",
139        "$ xns" : "Roo",
140        "* prop" : "layout",
141        "items" : [
142         {
143          "String tabPosition" : "top",
144          "xtype" : "LayoutRegion",
145          "$ xns" : "Roo",
146          "* prop" : "center"
147         },
148         {
149          "String tabPosition" : "top",
150          "xtype" : "LayoutRegion",
151          "Number height" : 250,
152          "$ xns" : "Roo",
153          "* prop" : "south",
154          "Boolean split" : true
155         },
156         {
157          "listeners" : {
158           "resize" : "function (_self, width, height)\n{\n    Roo.log(\"RESIZE, \" + width + ',' + height);\n    \n    var ew = Math.max(250, width - 10);\n    var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;\n    \n    if (!_this.form) {\n        return;\n    }\n    var bd;\n    if (_this.form1) {\n        bd = _this.form1.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    if (_this.form2) {\n        bd = _this.form2.findField('extended');\n        \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    }\n    if (_this.form3) {\n        \n        bd = _this.form3.findField('extra_css');\n        if (bd) { \n            bd.el.setWidth(ew);\n            bd.el.setHeight(eh);\n       //    _this.keywordscol.el.setWidth(ew+20);\n        }\n    // fix for messed up rendering of dialog?\n    }\n    \n    try { \n        _this.dialog.layout.el.dom.scrollTop = 0;\n    } catch (e) { \n        // noop... - the above sometimes fails...\n    }\n}",
159           "render" : "function (_self)\n{\n  _this.cpanel = _self;\n}"
160          },
161          "autoScroll" : true,
162          "fitToFrame" : true,
163          "region" : "center",
164          "xtype" : "ContentPanel",
165          "$ xns" : "Roo",
166          "items" : [
167           {
168            "xtype" : "Toolbar",
169            "$ xns" : "Roo",
170            "* prop" : "toolbar",
171            "items" : [
172             {
173              "listeners" : {
174               "click" : "function (_self, e)\n{\n    if (_this.dialog.getLayout().getRegion('west').collapsed) {\n        _this.dialog.getLayout().getRegion('west').expand();\n    } else {\n        _this.dialog.getLayout().getRegion('west').collapse();\n    }\n    \n}"
175              },
176              "text" : "<< Edit Translations",
177              "xtype" : "Button",
178              "$ xns" : "Roo.Toolbar"
179             },
180             {
181              "xtype" : "Fill",
182              "$ xns" : "Roo.Toolbar"
183             },
184             {
185              "listeners" : {
186               "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}"
187              },
188              "text" : "Manage Images / Attachments >>",
189              "xtype" : "Button",
190              "$ xns" : "Roo.Toolbar"
191             }
192            ]
193           },
194           {
195            "listeners" : {
196             "|actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask(); \n    Pman.standardActionFailed(_self, action);\n}\n",
197             "|actioncomplete" : "function (_self, action)\n{\n\n   if (action.type == 'setdata') {\n\n        _this.form.addForm(_this.form1);\n        _this.form.addForm(_this.form2);\n        _this.form.addForm(_this.form3);\n        _this.form.addForm(_this.form4);\n        \n        _this.dialog.setStylesheets();\n        \n        _this.dialog.getLayout().getRegion('west').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, '_with_primary_image' : 1 }});\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            _this.form.showHide();\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            \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            \n        }\n        \n        if(_this.data._is_copy){\n            _this.form.is_copy();\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       \n       _this.trform.reset();\n       _this.trform1.reset();\n       _this.trform2.reset();\n       \n       _this.trform.addForm(_this.trform1);\n       _this.trform.addForm(_this.trform2);\n        \n       _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();\n       _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();\n       _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();\n       _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();\n       _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').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        \n        if(typeof(d['interests']) != 'undefined'){\n            _this.form.findField('interest').setValue(Roo.decode(d['interests']));\n        }\n        \n        if(typeof(d['categories']) != 'undefined'){\n            _this.form.findField('category').setValue(Roo.decode(d['categories']));\n        }\n        \n        if(typeof(d['page_classes']) != 'undefined'){\n            _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));\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        \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",
198             "|rendered" : "function (_self)\n{\n    _this.form = _self;\n}\n"
199            },
200            "| function is_copy" : "function() \n{ \n    _this.form.setValues(_this.data);\n    \n    var d = _this.data;\n\n    _this.dialog.el.unmask();\n   _this.grid.getDataSource().load();\n   \n   _this.trform.reset();\n   _this.trform1.reset();\n   _this.trform2.reset();\n   \n   _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();\n   _this.form2.findField('extended').originalValue = _this.form2.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    \n    if(typeof(d['interests']) != 'undefined'){\n        _this.form.findField('interest').setValue(Roo.decode(d['interests']));\n    }\n    \n    if(typeof(d['categories']) != 'undefined'){\n        _this.form.findField('category').setValue(Roo.decode(d['categories']));\n    }\n    \n    if(typeof(d['page_classes']) != 'undefined'){\n        _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));\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}",
201            "labelAlign" : "right",
202            "$ url" : "baseURL + '/Roo/cms_page.php'",
203            "method" : "POST",
204            "style" : "margin: 5px",
205            "xtype" : "Form",
206            "labelWidth" : 120,
207            "$ showHide" : "function()\n{\n    var in_rss= 0;\n    var is_menu= 0;\n    var is_element  = 0;\n    var is_category = 0;\n    \n    var page_type_name = _this.form.findField('page_type_id_name').getValue();\n    \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 : !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        page_cls : is_element\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        \n        if (!el) {\n            Roo.log(\"missing field \" + k);\n            continue;\n        }\n        \n        el.actionMode = 'fieldEl';\n        \n        if (vis[k]) {\n            el.show();\n        } else{\n            el.hide();\n        }\n        \n    }\n    \n    _this.centerLayoutPanel.getLayout().getRegion('south').show();\n    _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);\n    _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);\n    _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);\n    _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);\n    \n    if(is_attachment || is_menu){\n    \n        _this.centerLayoutPanel.getLayout().getRegion('south').hide();\n        \n    }\n    \n    if(!has_extended && !is_attachment && !is_menu){\n        _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);\n        _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);\n    }\n    \n    \n    _this.trform.showHide();\n    \n    if(typeof(_this.form.editors) == 'undefined'){\n        _this.form.editors = {\n            body : _this.form1.findField('body').wrap.isVisible(),\n            extended : _this.form2.findField('extended').wrap.isVisible()\n       };\n       \n       if(_this.form.editors.body){\n            setInterval(_this.form1.findField('body').autosave, 60000);\n       }\n       \n       if(_this.form.editors.extended){\n            setInterval(_this.form2.findField('extended').autosave, 60000);\n       }\n   }\n   \n   if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){\n        setInterval(_this.form1.findField('body').autosave, 60000);\n        _this.form.editors.body = true;\n   }\n   \n   if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){\n        setInterval(_this.form2.findField('extended').autosave, 60000);\n        _this.form.editors.extended = true;\n   }\n    \n    \n    \n}\n",
208            "$ xns" : "Roo.form",
209            "items" : [
210             {
211              "xtype" : "Column",
212              "labelWidth" : 200,
213              "width" : 750,
214              "$ xns" : "Roo.form",
215              "items" : [
216               {
217                "labelAlign" : "right",
218                "hideLabels" : false,
219                "style" : "height:30px;overflow:hidden",
220                "xtype" : "Row",
221                "labelWidth" : 200,
222                "width" : 850,
223                "$ xns" : "Roo.form",
224                "items" : [
225                 {
226                  "fieldLabel" : "Type:",
227                  "xtype" : "Hidden",
228                  "width" : 1,
229                  "$ xns" : "Roo.form"
230                 },
231                 {
232                  "hideLabels" : true,
233                  "xtype" : "Row",
234                  "style" : "height:30px;overflow:hidden",
235                  "labelWidth" : 0,
236                  "width" : 600,
237                  "$ xns" : "Roo.form",
238                  "items" : [
239                   {
240                    "listeners" : {
241                     "render" : "function (_self)\n{\n    _this.page_type = _self;\n}",
242                     "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}"
243                    },
244                    "alwaysQuery" : true,
245                    "listWidth" : 400,
246                    "triggerAction" : "all",
247                    "fieldLabel" : "Page Type",
248                    "forceSelection" : true,
249                    "selectOnFocus" : true,
250                    "pageSize" : 20,
251                    "displayField" : "display_name",
252                    "emptyText" : "Select Status Type",
253                    "hiddenName" : "page_type_id",
254                    "minChars" : 2,
255                    "valueField" : "id",
256                    "xtype" : "ComboBox",
257                    "typeAhead" : false,
258                    "editable" : false,
259                    "$ xns" : "Roo.form",
260                    "name" : "page_type_id_display_name",
261                    "qtip" : "Select Page Type",
262                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
263                    "loadingText" : "Searching...",
264                    "items" : [
265                     {
266                      "listeners" : {
267                       "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n    o.params.etype = 'cms_page_type'; \n}\n"
268                      },
269                      "xtype" : "Store",
270                      "remoteSort" : true,
271                      "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }",
272                      "$ xns" : "Roo.data",
273                      "* prop" : "store",
274                      "items" : [
275                       {
276                        "$ url" : "baseURL + '/Roo/core_enum.php'",
277                        "xtype" : "HttpProxy",
278                        "method" : "GET",
279                        "$ xns" : "Roo.data",
280                        "* prop" : "proxy"
281                       },
282                       {
283                        "id" : "id",
284                        "root" : "data",
285                        "xtype" : "JsonReader",
286                        "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"display_name\",\"type\":\"string\"}]",
287                        "$ xns" : "Roo.data",
288                        "* prop" : "reader",
289                        "totalProperty" : "total"
290                       }
291                      ]
292                     }
293                    ]
294                   },
295                   {
296                    "style" : "padding-left:  -70px;",
297                    "xtype" : "Column",
298                    "labelWidth" : 60,
299                    "width" : 200,
300                    "$ xns" : "Roo.form",
301                    "items" : [
302                     {
303                      "fieldLabel" : "Seq",
304                      "xtype" : "NumberField",
305                      "decimalPrecision" : 0,
306                      "width" : 50,
307                      "$ xns" : "Roo.form",
308                      "name" : "seq_id"
309                     }
310                    ]
311                   }
312                  ]
313                 }
314                ]
315               },
316               {
317                "labelAlign" : "right",
318                "hideLabels" : false,
319                "style" : "height:30px;overflow:hidden",
320                "xtype" : "Row",
321                "labelWidth" : 200,
322                "width" : 800,
323                "$ xns" : "Roo.form",
324                "items" : [
325                 {
326                  "fieldLabel" : "Attributes:",
327                  "xtype" : "Hidden",
328                  "width" : 1,
329                  "$ xns" : "Roo.form"
330                 },
331                 {
332                  "hideLabels" : true,
333                  "xtype" : "Row",
334                  "style" : "height:30px;overflow:hidden",
335                  "labelWidth" : 0,
336                  "width" : 540,
337                  "$ xns" : "Roo.form",
338                  "items" : [
339                   {
340                    "fieldLabel" : "Attributes",
341                    "xtype" : "Checkbox",
342                    "boxLabel" : "Draft",
343                    "width" : 100,
344                    "$ xns" : "Roo.form",
345                    "name" : "is_draft"
346                   },
347                   {
348                    "listeners" : {
349                     "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}"
350                    },
351                    "inputValue" : 1,
352                    "xtype" : "Checkbox",
353                    "boxLabel" : "Has Extended content?",
354                    "width" : 180,
355                    "$ xns" : "Roo.form",
356                    "name" : "has_extended"
357                   },
358                   {
359                    "listeners" : {
360                     "check" : "function (_self, checked)\n{  \n   if (_this.form) { \n \n     _this.form.showHide.defer(100, _this.form);      \n   }\n}"
361                    },
362                    "inputValue" : 1,
363                    "xtype" : "Checkbox",
364                    "boxLabel" : "Downloads first Attachment",
365                    "width" : 180,
366                    "$ xns" : "Roo.form",
367                    "name" : "is_attachment"
368                   }
369                  ]
370                 }
371                ]
372               },
373               {
374                "listWidth" : 400,
375                "triggerAction" : "all",
376                "fieldLabel" : "Author",
377                "forceSelection" : true,
378                "selectOnFocus" : true,
379                "pageSize" : 40,
380                "displayField" : "name",
381                "emptyText" : "Select Person",
382                "hiddenName" : "author_id",
383                "minChars" : 2,
384                "valueField" : "id",
385                "xtype" : "ComboBox",
386                "allowBlank" : true,
387                "typeAhead" : false,
388                "editable" : true,
389                "width" : 300,
390                "$ xns" : "Roo.form",
391                "name" : "author_id_name",
392                "qtip" : "Select Person",
393                "queryParam" : "query[name]",
394                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b>  - {company_id_name}</div>",
395                "loadingText" : "Searching...",
396                "items" : [
397                 {
398                  "listeners" : {
399                   "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    o.params.active = 1;\n    o.params['query[is_owner]'] = 1;\n}\n"
400                  },
401                  "xtype" : "Store",
402                  "remoteSort" : true,
403                  "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
404                  "$ xns" : "Roo.data",
405                  "* prop" : "store",
406                  "items" : [
407                   {
408                    "$ url" : "baseURL + '/Roo/core_person'",
409                    "xtype" : "HttpProxy",
410                    "method" : "GET",
411                    "$ xns" : "Roo.data",
412                    "* prop" : "proxy"
413                   },
414                   {
415                    "id" : "id",
416                    "root" : "data",
417                    "xtype" : "JsonReader",
418                    "$ xns" : "Roo.data",
419                    "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
420                    "* prop" : "reader",
421                    "totalProperty" : "total"
422                   }
423                  ]
424                 }
425                ]
426               },
427               {
428                "fieldLabel" : "Category",
429                "hiddenName" : "category",
430                "xtype" : "ComboBoxArray",
431                "width" : 400,
432                "$ xns" : "Roo.form",
433                "name" : "category_name",
434                "items" : [
435                 {
436                  "listWidth" : 400,
437                  "Number pageSize" : 40,
438                  "alwaysQuery" : true,
439                  "triggerAction" : "all",
440                  "fieldLabel" : "Category",
441                  "forceSelection" : true,
442                  "selectOnFocus" : true,
443                  "displayField" : "display_fullpath",
444                  "emptyText" : "Select category",
445                  "minChars" : 2,
446                  "valueField" : "id",
447                  "xtype" : "ComboBox",
448                  "allowBlank" : false,
449                  "editable" : true,
450                  "width" : 385,
451                  "$ xns" : "Roo.form",
452                  "* prop" : "combo",
453                  "queryParam" : "search[name]",
454                  "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>",
455                  "items" : [
456                   {
457                    "listeners" : {
458                     "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params.page_type_id_name= 'CATEGORY';\n    \n    o.params._with_fullpath = 1;\n}\n"
459                    },
460                    "xtype" : "Store",
461                    "remoteSort" : true,
462                    "$ sortInfo" : "{ field: 'tree_sequence', direction: 'ASC' }",
463                    "$ xns" : "Roo.data",
464                    "* prop" : "store",
465                    "items" : [
466                     {
467                      "$ url" : "baseURL + '/Roo/cms_page.php'",
468                      "xtype" : "HttpProxy",
469                      "method" : "GET",
470                      "$ xns" : "Roo.data",
471                      "* prop" : "proxy"
472                     },
473                     {
474                      "id" : "id",
475                      "root" : "data",
476                      "xtype" : "JsonReader",
477                      "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"name\",\"type\":\"string\"},\n    {\"name\":\"display_name\",\"type\":\"string\"}\n]",
478                      "$ xns" : "Roo.data",
479                      "* prop" : "reader",
480                      "totalProperty" : "total"
481                     }
482                    ]
483                   }
484                  ]
485                 }
486                ]
487               },
488               {
489                "listeners" : {
490                 "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 || !(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}"
491                },
492                "listWidth" : 600,
493                "triggerAction" : "all",
494                "fieldLabel" : "Parent",
495                "forceSelection" : true,
496                "selectOnFocus" : true,
497                "pageSize" : 40,
498                "displayField" : "page_link",
499                "emptyText" : "Select Parent",
500                "hiddenName" : "parent_id",
501                "minChars" : 2,
502                "valueField" : "id",
503                "xtype" : "ComboBox",
504                "allowBlank" : true,
505                "typeAhead" : true,
506                "Boolean alwaysQuery" : true,
507                "editable" : true,
508                "width" : 400,
509                "$ xns" : "Roo.form",
510                "name" : "parent_id_title",
511                "qtip" : "Select Category ",
512                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
513                "loadingText" : "Searching...",
514                "items" : [
515                 {
516                  "listeners" : {
517                   "beforeload" : "function (_self, options)\n{\n     options.params['search[page_link_no_empty]'] =1;\n     \n     if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){\n        options.params._page_type = 'page,element';\n     } else {\n        options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;\n     }\n     \n     var id = _this.form.findField('id').getValue() * 1;\n     \n     if(id > 0){\n        options.params['!id'] = id;\n     }\n     \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}"
518                  },
519                  "xtype" : "Store",
520                  "remoteSort" : true,
521                  "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
522                  "$ xns" : "Roo.data",
523                  "* prop" : "store",
524                  "items" : [
525                   {
526                    "$ url" : "baseURL + '/Roo/cms_page.php'",
527                    "method" : "GET",
528                    "xtype" : "HttpProxy",
529                    "$ xns" : "Roo.data",
530                    "* prop" : "proxy"
531                   },
532                   {
533                    "id" : "id",
534                    "root" : "data",
535                    "xtype" : "JsonReader",
536                    "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
537                    "$ xns" : "Roo.data",
538                    "* prop" : "reader",
539                    "totalProperty" : "total"
540                   }
541                  ]
542                 }
543                ]
544               },
545               {
546                "xtype" : "Row",
547                "labelWidth" : 200,
548                "$ xns" : "Roo.form",
549                "items" : [
550                 {
551                  "format" : "Y-m-d",
552                  "fieldLabel" : "Date to Publish",
553                  "xtype" : "DateField",
554                  "width" : 200,
555                  "$ xns" : "Roo.form",
556                  "altFormats" : "Y-m-d H:i:s",
557                  "name" : "published"
558                 },
559                 {
560                  "fieldLabel" : "Replaces (ignore)",
561                  "xtype" : "TextField",
562                  "width" : 75,
563                  "$ xns" : "Roo.form",
564                  "name" : "to_replace_id"
565                 }
566                ]
567               },
568               {
569                "listeners" : {
570                 "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}"
571                },
572                "fieldLabel" : "Title",
573                "xtype" : "TextField",
574                "width" : 400,
575                "$ xns" : "Roo.form",
576                "name" : "title"
577               },
578               {
579                "fieldLabel" : "Page link /  Name / Order",
580                "xtype" : "TextField",
581                "width" : 400,
582                "$ xns" : "Roo.form",
583                "name" : "page_link"
584               },
585               {
586                "fieldLabel" : "Target URL",
587                "xtype" : "TextField",
588                "width" : 400,
589                "$ xns" : "Roo.form",
590                "name" : "target_url"
591               },
592               {
593                "alwaysQuery" : true,
594                "listWidth" : 400,
595                "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><b>{template_clean}</b></div>'\n",
596                "triggerAction" : "all",
597                "fieldLabel" : "Layout",
598                "forceSelection" : true,
599                "selectOnFocus" : true,
600                "pageSize" : 20,
601                "displayField" : "template_clean",
602                "emptyText" : "Select Template",
603                "hiddenName" : "template_id",
604                "minChars" : 2,
605                "valueField" : "id",
606                "xtype" : "ComboBox",
607                "allowBlank" : true,
608                "typeAhead" : true,
609                "editable" : true,
610                "width" : 400,
611                "$ xns" : "Roo.form",
612                "name" : "template_id_template_clean",
613                "qtip" : "Select Category ",
614                "loadingText" : "Searching...",
615                "items" : [
616                 {
617                  "listeners" : {
618                   "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}"
619                  },
620                  "xtype" : "Store",
621                  "remoteSort" : true,
622                  "$ sortInfo" : "{ field: 'template', direction: 'ASC' }",
623                  "$ xns" : "Roo.data",
624                  "* prop" : "store",
625                  "items" : [
626                   {
627                    "$ url" : "baseURL + '/Roo/Cms_template'",
628                    "method" : "GET",
629                    "xtype" : "HttpProxy",
630                    "$ xns" : "Roo.data",
631                    "* prop" : "proxy"
632                   },
633                   {
634                    "id" : "id",
635                    "root" : "data",
636                    "xtype" : "JsonReader",
637                    "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]",
638                    "$ xns" : "Roo.data",
639                    "* prop" : "reader",
640                    "totalProperty" : "total"
641                   }
642                  ]
643                 }
644                ]
645               },
646               {
647                "alwaysQuery" : true,
648                "listWidth" : 400,
649                "triggerAction" : "all",
650                "fieldLabel" : "Appears in Block",
651                "forceSelection" : true,
652                "selectOnFocus" : true,
653                "pageSize" : 20,
654                "displayField" : "name",
655                "emptyText" : "Select Section",
656                "hiddenName" : "element_id",
657                "minChars" : 2,
658                "valueField" : "id",
659                "xtype" : "ComboBox",
660                "allowBlank" : true,
661                "typeAhead" : true,
662                "editable" : true,
663                "width" : 400,
664                "$ xns" : "Roo.form",
665                "name" : "element_id_name",
666                "qtip" : "Select Category ",
667                "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>",
668                "loadingText" : "Searching...",
669                "items" : [
670                 {
671                  "listeners" : {
672                   "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}"
673                  },
674                  "xtype" : "Store",
675                  "remoteSort" : true,
676                  "$ sortInfo" : "{ field: 'name', direction: 'ASC' }",
677                  "$ xns" : "Roo.data",
678                  "* prop" : "store",
679                  "items" : [
680                   {
681                    "$ url" : "baseURL + '/Roo/Cms_template_element'",
682                    "method" : "GET",
683                    "xtype" : "HttpProxy",
684                    "$ xns" : "Roo.data",
685                    "* prop" : "proxy"
686                   },
687                   {
688                    "id" : "id",
689                    "root" : "data",
690                    "xtype" : "JsonReader",
691                    "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]",
692                    "$ xns" : "Roo.data",
693                    "* prop" : "reader",
694                    "totalProperty" : "total"
695                   }
696                  ]
697                 }
698                ]
699               },
700               {
701                "alwaysQuery" : true,
702                "listWidth" : 600,
703                "triggerAction" : "all",
704                "fieldLabel" : "Menu links to Page",
705                "forceSelection" : true,
706                "selectOnFocus" : true,
707                "pageSize" : 40,
708                "displayField" : "page_link",
709                "emptyText" : "Select Page",
710                "hiddenName" : "menu_page_id",
711                "minChars" : 2,
712                "valueField" : "id",
713                "xtype" : "ComboBox",
714                "allowBlank" : true,
715                "typeAhead" : true,
716                "editable" : true,
717                "width" : 400,
718                "$ xns" : "Roo.form",
719                "name" : "menu_page_id_page_link",
720                "qtip" : "Select Category ",
721                "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>",
722                "loadingText" : "Searching...",
723                "items" : [
724                 {
725                  "listeners" : {
726                   "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}"
727                  },
728                  "xtype" : "Store",
729                  "remoteSort" : true,
730                  "$ sortInfo" : "{ field: 'title', direction: 'ASC' }",
731                  "$ xns" : "Roo.data",
732                  "* prop" : "store",
733                  "items" : [
734                   {
735                    "$ url" : "baseURL + '/Roo/cms_page.php'",
736                    "method" : "GET",
737                    "xtype" : "HttpProxy",
738                    "$ xns" : "Roo.data",
739                    "* prop" : "proxy"
740                   },
741                   {
742                    "id" : "id",
743                    "root" : "data",
744                    "xtype" : "JsonReader",
745                    "$ 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]",
746                    "$ xns" : "Roo.data",
747                    "* prop" : "reader",
748                    "totalProperty" : "total"
749                   }
750                  ]
751                 }
752                ]
753               },
754               {
755                "fieldLabel" : "Page Class",
756                "xtype" : "ComboBoxArray",
757                "hiddenName" : "page_cls",
758                "width" : 400,
759                "$ xns" : "Roo.form",
760                "name" : "page_cls_name",
761                "items" : [
762                 {
763                  "alwaysQuery" : true,
764                  "listWidth" : 400,
765                  "triggerAction" : "all",
766                  "fieldLabel" : "Page Class",
767                  "forceSelection" : true,
768                  "selectOnFocus" : true,
769                  "displayField" : "display_name",
770                  "emptyText" : "Select class",
771                  "minChars" : 2,
772                  "valueField" : "name",
773                  "xtype" : "ComboBox",
774                  "allowBlank" : true,
775                  "editable" : true,
776                  "width" : 385,
777                  "$ xns" : "Roo.form",
778                  "* prop" : "combo",
779                  "queryParam" : "query[search]",
780                  "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
781                  "items" : [
782                   {
783                    "listeners" : {
784                     "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n\n    o.params.etype = 'cms_page_class'; \n}\n"
785                    },
786                    "xtype" : "Store",
787                    "remoteSort" : true,
788                    "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }",
789                    "$ xns" : "Roo.data",
790                    "* prop" : "store",
791                    "items" : [
792                     {
793                      "$ url" : "baseURL + '/Roo/core_enum.php'",
794                      "method" : "GET",
795                      "xtype" : "HttpProxy",
796                      "$ xns" : "Roo.data",
797                      "* prop" : "proxy"
798                     },
799                     {
800                      "id" : "id",
801                      "root" : "data",
802                      "xtype" : "JsonReader",
803                      "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"name\",\"type\":\"string\"},\n    {\"name\":\"display_name\",\"type\":\"string\"}\n]",
804                      "$ xns" : "Roo.data",
805                      "* prop" : "reader",
806                      "totalProperty" : "total"
807                     }
808                    ]
809                   }
810                  ]
811                 }
812                ]
813               }
814              ]
815             },
816             {
817              "xtype" : "Column",
818              "labelWidth" : 200,
819              "width" : 250,
820              "$ xns" : "Roo.form",
821              "items" : [
822               {
823                "xtype" : "FieldSet",
824                "String labelAlign" : "top",
825                "$ xns" : "Roo.form",
826                "String legend" : "Primary Image",
827                "String/Object/Function style" : "width: 165px;",
828                "Boolean hideLabels" : true,
829                "items" : [
830                 {
831                  "xtype" : "DisplayField",
832                  "style" : "border: 1px solid #ccc;",
833                  "$ valueRenderer" : "function(v) {\n\n    if (!v || v * 1 < 1) {\n        return '<div style=\"width: 150px; height: 150px; background-color: grey;\" title=\"Using zero order image\">&nbsp;</div>';\n    }\n    \n    return String.format('<img src=\"{0}/Images/Thumb/150/{1}\" width=\"150\" title=\"Using zero order image\">', baseURL, v); \n}",
834                  "icon" : "rootURL + 'images/default/dd/drop-add.gif'",
835                  "width" : 150,
836                  "$ xns" : "Roo.form",
837                  "height" : 150,
838                  "name" : "primary_image_id"
839                 }
840                ]
841               }
842              ]
843             },
844             {
845              "listeners" : {
846               "render" : "function (_self)\n{\n    _this.interestsCol = _self;\n}"
847              },
848              "xtype" : "Column",
849              "$ xns" : "Roo.form",
850              "items" : [
851               {
852                "listeners" : {
853                 "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}"
854                },
855                "fieldLabel" : "Interests",
856                "xtype" : "ComboBoxArray",
857                "hiddenName" : "interest",
858                "width" : 300,
859                "$ xns" : "Roo.form",
860                "name" : "interest_name",
861                "items" : [
862                 {
863                  "alwaysQuery" : true,
864                  "listWidth" : 400,
865                  "triggerAction" : "all",
866                  "fieldLabel" : "Interests",
867                  "forceSelection" : true,
868                  "selectOnFocus" : true,
869                  "displayField" : "display_name",
870                  "emptyText" : "Select interests",
871                  "minChars" : 2,
872                  "valueField" : "id",
873                  "xtype" : "ComboBox",
874                  "allowBlank" : true,
875                  "editable" : true,
876                  "width" : 285,
877                  "$ xns" : "Roo.form",
878                  "* prop" : "combo",
879                  "queryParam" : "query[name]",
880                  "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>",
881                  "items" : [
882                   {
883                    "listeners" : {
884                     "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    o.params.etype = 'crm_interest';\n}\n"
885                    },
886                    "xtype" : "Store",
887                    "remoteSort" : true,
888                    "$ sortInfo" : "{ direction : 'ASC', field: 'name' }",
889                    "$ xns" : "Roo.data",
890                    "* prop" : "store",
891                    "items" : [
892                     {
893                      "$ url" : "baseURL + '/Roo/Core_enum.php'",
894                      "method" : "GET",
895                      "xtype" : "HttpProxy",
896                      "$ xns" : "Roo.data",
897                      "* prop" : "proxy"
898                     },
899                     {
900                      "id" : "id",
901                      "root" : "data",
902                      "xtype" : "JsonReader",
903                      "$ fields" : "[\n    {\"name\":\"id\",\"type\":\"int\"},\n    {\"name\":\"name\",\"type\":\"string\"},\n    {\"name\":\"display_name\",\"type\":\"string\"}\n]",
904                      "$ xns" : "Roo.data",
905                      "* prop" : "reader",
906                      "totalProperty" : "total"
907                     }
908                    ]
909                   }
910                  ]
911                 }
912                ]
913               }
914              ]
915             },
916             {
917              "xtype" : "Hidden",
918              "$ xns" : "Roo.form",
919              "name" : "id"
920             },
921             {
922              "xtype" : "Hidden",
923              "$ xns" : "Roo.form",
924              "name" : "is_system_page"
925             },
926             {
927              "xtype" : "Hidden",
928              "$ xns" : "Roo.form",
929              "name" : "is_menuitem"
930             },
931             {
932              "xtype" : "Hidden",
933              "$ xns" : "Roo.form",
934              "name" : "page_type_id_name"
935             },
936             {
937              "listeners" : {
938               "render" : "function (_self)\n{\n    _this.user_defined_fields = _self;\n}"
939              },
940              "xtype" : "Column",
941              "$ xns" : "Roo.form"
942             }
943            ]
944           }
945          ]
946         },
947         {
948          "Boolean fitContainer" : true,
949          "xtype" : "ContentPanel",
950          "Boolean fitToFrame" : true,
951          "$ xns" : "Roo",
952          "String region" : "south",
953          "String title" : "Contents",
954          "Boolean background" : false,
955          "items" : [
956           {
957            "listeners" : {
958             "rendered" : "function (form)\n{\n    _this.form1 = form;\n}"
959            },
960            "$ url" : "baseURL + '/Roo/cms_page.php'",
961            "method" : "POST",
962            "xtype" : "Form",
963            "labelWidth" : 80,
964            "String labelAlign" : "top",
965            "$ xns" : "Roo.form",
966            "items" : [
967             {
968              "xtype" : "Row",
969              "$ xns" : "Roo.form",
970              "Boolean hideLabels" : true,
971              "items" : [
972               {
973                "listeners" : {
974                 "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
975                 "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}",
976                 "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}"
977                },
978                "xtype" : "HtmlEditor",
979                "width" : 550,
980                "$ xns" : "Roo.form",
981                "String fieldLabel" : "Contents",
982                "resizable" : "s",
983                "$ autosave" : "function() {\n    \n    var body = _this.form1.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",
984                "$ array white" : "[ 'iframe' ]",
985                "name" : "body",
986                "height" : 150,
987                "items" : [
988                 {
989                  "xtype" : "ToolbarStandard",
990                  "$ xns" : "Roo.form.HtmlEditor",
991                  "* prop" : "toolbars[]",
992                  "items" : [
993                   {
994                    "listeners" : {
995                     "render" : "function (_self)\n{\n    _this.bodyimgselect = _self;\n}",
996                     "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}",
997                     "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}"
998                    },
999                    "listWidth" : 400,
1000                    "$ 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>'",
1001                    "alwaysQuery" : true,
1002                    "triggerAction" : "all",
1003                    "fieldLabel" : "Images",
1004                    "forceSelection" : true,
1005                    "selectOnFocus" : true,
1006                    "pageSize" : 20,
1007                    "displayField" : "name",
1008                    "emptyText" : "Add Image",
1009                    "minChars" : 2,
1010                    "valueField" : "id",
1011                    "xtype" : "ComboBox",
1012                    "typeAhead" : true,
1013                    "editable" : false,
1014                    "width" : 100,
1015                    "$ xns" : "Roo.form",
1016                    "* prop" : "btns[]",
1017                    "qtip" : "Select Images",
1018                    "queryParam" : "search",
1019                    "loadingText" : "Searching...",
1020                    "items" : [
1021                     {
1022                      "listeners" : {
1023                       "|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"
1024                      },
1025                      "xtype" : "Store",
1026                      "remoteSort" : true,
1027                      "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1028                      "$ xns" : "Roo.data",
1029                      "* prop" : "store",
1030                      "items" : [
1031                       {
1032                        "$ url" : "baseURL + '/Roo/Images.php'",
1033                        "xtype" : "HttpProxy",
1034                        "method" : "GET",
1035                        "$ xns" : "Roo.data",
1036                        "* prop" : "proxy"
1037                       },
1038                       {
1039                        "id" : "id",
1040                        "root" : "data",
1041                        "xtype" : "JsonReader",
1042                        "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
1043                        "$ xns" : "Roo.data",
1044                        "* prop" : "reader",
1045                        "totalProperty" : "total"
1046                       }
1047                      ]
1048                     }
1049                    ]
1050                   },
1051                   {
1052                    "listeners" : {
1053                     "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 }"
1054                    },
1055                    "listWidth" : 200,
1056                    "triggerAction" : "all",
1057                    "forceSelection" : true,
1058                    "selectOnFocus" : true,
1059                    "pageSize" : 40,
1060                    "displayField" : "page_link",
1061                    "emptyText" : "Add Link",
1062                    "hiddenName" : "add_link_id",
1063                    "minChars" : 2,
1064                    "valueField" : "id",
1065                    "xtype" : "ComboBox",
1066                    "allowBlank" : true,
1067                    "typeAhead" : true,
1068                    "editable" : true,
1069                    "width" : 100,
1070                    "$ xns" : "Roo.form",
1071                    "* prop" : "btns[]",
1072                    "name" : "add_link",
1073                    "qtip" : "Select Category ",
1074                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
1075                    "loadingText" : "Searching...",
1076                    "items" : [
1077                     {
1078                      "listeners" : {
1079                       "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}"
1080                      },
1081                      "xtype" : "Store",
1082                      "remoteSort" : true,
1083                      "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
1084                      "$ xns" : "Roo.data",
1085                      "* prop" : "store",
1086                      "items" : [
1087                       {
1088                        "$ url" : "baseURL + '/Roo/cms_page.php'",
1089                        "method" : "GET",
1090                        "xtype" : "HttpProxy",
1091                        "$ xns" : "Roo.data",
1092                        "* prop" : "proxy"
1093                       },
1094                       {
1095                        "id" : "id",
1096                        "root" : "data",
1097                        "xtype" : "JsonReader",
1098                        "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
1099                        "$ xns" : "Roo.data",
1100                        "* prop" : "reader",
1101                        "totalProperty" : "total"
1102                       }
1103                      ]
1104                     }
1105                    ]
1106                   },
1107                   {
1108                    "xtype" : "Separator",
1109                    "$ xns" : "Roo.Toolbar",
1110                    "* prop" : "btns[]"
1111                   },
1112                   {
1113                    "listeners" : {
1114                     "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1115                    },
1116                    "String cls" : "x-init-enable",
1117                    "text" : "Saved Version",
1118                    "xtype" : "Button",
1119                    "$ xns" : "Roo.Toolbar",
1120                    "* prop" : "btns[]"
1121                   }
1122                  ]
1123                 },
1124                 {
1125                  "xtype" : "ToolbarContext",
1126                  "$ xns" : "Roo.form.HtmlEditor",
1127                  "* prop" : "toolbars[]"
1128                 }
1129                ]
1130               }
1131              ]
1132             }
1133            ]
1134           }
1135          ]
1136         },
1137         {
1138          "Boolean fitContainer" : true,
1139          "xtype" : "ContentPanel",
1140          "Boolean fitToFrame" : true,
1141          "$ xns" : "Roo",
1142          "String region" : "south",
1143          "String title" : "Extended Content",
1144          "Boolean background" : false,
1145          "items" : [
1146           {
1147            "listeners" : {
1148             "rendered" : "function (form)\n{\n    _this.form2 = form;\n}"
1149            },
1150            "$ url" : "baseURL + '/Roo/cms_page.php'",
1151            "method" : "POST",
1152            "xtype" : "Form",
1153            "labelWidth" : 80,
1154            "String labelAlign" : "top",
1155            "$ xns" : "Roo.form",
1156            "items" : [
1157             {
1158              "xtype" : "Row",
1159              "$ xns" : "Roo.form",
1160              "Boolean hideLabels" : true,
1161              "items" : [
1162               {
1163                "listeners" : {
1164                 "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
1165                 "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}",
1166                 "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}"
1167                },
1168                "fieldLabel" : "Extended Contents",
1169                "xtype" : "HtmlEditor",
1170                "width" : 550,
1171                "$ xns" : "Roo.form",
1172                "resizable" : "s",
1173                "$ autosave" : "function() {\n    \n    var extended = _this.form2.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",
1174                "$ array white" : "[ 'iframe' ]",
1175                "name" : "extended",
1176                "height" : 150,
1177                "items" : [
1178                 {
1179                  "xtype" : "ToolbarStandard",
1180                  "$ xns" : "Roo.form.HtmlEditor",
1181                  "* prop" : "toolbars[]",
1182                  "items" : [
1183                   {
1184                    "listeners" : {
1185                     "render" : "function (_self)\n{\n    _this.extendimgselect = _self;\n}",
1186                     "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}",
1187                     "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}"
1188                    },
1189                    "alwaysQuery" : true,
1190                    "listWidth" : 400,
1191                    "triggerAction" : "all",
1192                    "fieldLabel" : "Images",
1193                    "forceSelection" : true,
1194                    "selectOnFocus" : true,
1195                    "pageSize" : 20,
1196                    "displayField" : "name",
1197                    "emptyText" : "Add Image",
1198                    "minChars" : 2,
1199                    "valueField" : "id",
1200                    "xtype" : "ComboBox",
1201                    "typeAhead" : true,
1202                    "editable" : false,
1203                    "width" : 100,
1204                    "$ xns" : "Roo.form",
1205                    "* prop" : "btns[]",
1206                    "qtip" : "Select Images",
1207                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>",
1208                    "loadingText" : "Searching...",
1209                    "items" : [
1210                     {
1211                      "listeners" : {
1212                       "|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"
1213                      },
1214                      "xtype" : "Store",
1215                      "remoteSort" : true,
1216                      "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1217                      "$ xns" : "Roo.data",
1218                      "* prop" : "store",
1219                      "items" : [
1220                       {
1221                        "$ url" : "baseURL + '/Roo/Images.php'",
1222                        "method" : "GET",
1223                        "xtype" : "HttpProxy",
1224                        "$ xns" : "Roo.data",
1225                        "* prop" : "proxy"
1226                       },
1227                       {
1228                        "id" : "id",
1229                        "root" : "data",
1230                        "xtype" : "JsonReader",
1231                        "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
1232                        "$ xns" : "Roo.data",
1233                        "* prop" : "reader",
1234                        "totalProperty" : "total"
1235                       }
1236                      ]
1237                     }
1238                    ]
1239                   },
1240                   {
1241                    "listeners" : {
1242                     "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 }"
1243                    },
1244                    "listWidth" : 200,
1245                    "triggerAction" : "all",
1246                    "forceSelection" : true,
1247                    "selectOnFocus" : true,
1248                    "pageSize" : 40,
1249                    "displayField" : "page_link",
1250                    "emptyText" : "Add Link",
1251                    "hiddenName" : "add_link_id",
1252                    "minChars" : 2,
1253                    "valueField" : "id",
1254                    "xtype" : "ComboBox",
1255                    "allowBlank" : true,
1256                    "typeAhead" : true,
1257                    "editable" : true,
1258                    "width" : 100,
1259                    "$ xns" : "Roo.form",
1260                    "* prop" : "btns[]",
1261                    "name" : "add_link",
1262                    "qtip" : "Select Category ",
1263                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
1264                    "loadingText" : "Searching...",
1265                    "items" : [
1266                     {
1267                      "listeners" : {
1268                       "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}"
1269                      },
1270                      "xtype" : "Store",
1271                      "remoteSort" : true,
1272                      "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
1273                      "$ xns" : "Roo.data",
1274                      "* prop" : "store",
1275                      "items" : [
1276                       {
1277                        "$ url" : "baseURL + '/Roo/cms_page.php'",
1278                        "xtype" : "HttpProxy",
1279                        "method" : "GET",
1280                        "$ xns" : "Roo.data",
1281                        "* prop" : "proxy"
1282                       },
1283                       {
1284                        "id" : "id",
1285                        "root" : "data",
1286                        "xtype" : "JsonReader",
1287                        "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
1288                        "$ xns" : "Roo.data",
1289                        "* prop" : "reader",
1290                        "totalProperty" : "total"
1291                       }
1292                      ]
1293                     }
1294                    ]
1295                   },
1296                   {
1297                    "xtype" : "Separator",
1298                    "$ xns" : "Roo.Toolbar",
1299                    "* prop" : "btns[]"
1300                   },
1301                   {
1302                    "listeners" : {
1303                     "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1304                    },
1305                    "text" : "Saved Version",
1306                    "xtype" : "Button",
1307                    "$ xns" : "Roo.Toolbar",
1308                    "* prop" : "btns[]"
1309                   }
1310                  ]
1311                 },
1312                 {
1313                  "xtype" : "ToolbarContext",
1314                  "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
1315                  "$ xns" : "Roo.form.HtmlEditor",
1316                  "* prop" : "toolbars[]"
1317                 }
1318                ]
1319               }
1320              ]
1321             }
1322            ]
1323           }
1324          ]
1325         },
1326         {
1327          "Boolean fitContainer" : true,
1328          "xtype" : "ContentPanel",
1329          "Boolean fitToFrame" : true,
1330          "$ xns" : "Roo",
1331          "String region" : "south",
1332          "String title" : "Extra CSS",
1333          "Boolean background" : false,
1334          "items" : [
1335           {
1336            "listeners" : {
1337             "rendered" : "function (form)\n{\n    _this.form3 = form;\n}"
1338            },
1339            "$ url" : "baseURL + '/Roo/cms_page.php'",
1340            "xtype" : "Form",
1341            "method" : "POST",
1342            "labelWidth" : 80,
1343            "String labelAlign" : "top",
1344            "$ xns" : "Roo.form",
1345            "items" : [
1346             {
1347              "xtype" : "Row",
1348              "$ xns" : "Roo.form",
1349              "Boolean hideLabels" : true,
1350              "items" : [
1351               {
1352                "fieldLabel" : "Styles (CSS)",
1353                "xtype" : "TextArea",
1354                "width" : 700,
1355                "$ xns" : "Roo.form",
1356                "name" : "extra_css",
1357                "height" : 200
1358               }
1359              ]
1360             }
1361            ]
1362           }
1363          ]
1364         },
1365         {
1366          "Boolean fitContainer" : true,
1367          "xtype" : "ContentPanel",
1368          "Boolean fitToFrame" : true,
1369          "$ xns" : "Roo",
1370          "String region" : "south",
1371          "String title" : "Meta Tags",
1372          "Boolean background" : false,
1373          "items" : [
1374           {
1375            "listeners" : {
1376             "rendered" : "function (form)\n{\n    _this.form4 = form;\n}"
1377            },
1378            "$ url" : "baseURL + '/Roo/cms_page.php'",
1379            "method" : "POST",
1380            "xtype" : "Form",
1381            "labelWidth" : 80,
1382            "String labelAlign" : "top",
1383            "$ xns" : "Roo.form",
1384            "items" : [
1385             {
1386              "xtype" : "Row",
1387              "$ xns" : "Roo.form",
1388              "items" : [
1389               {
1390                "fieldLabel" : "Keywords",
1391                "xtype" : "TextArea",
1392                "width" : 340,
1393                "$ xns" : "Roo.form",
1394                "name" : "keywords",
1395                "height" : 100
1396               },
1397               {
1398                "fieldLabel" : "Descriptions",
1399                "xtype" : "TextArea",
1400                "width" : 340,
1401                "$ xns" : "Roo.form",
1402                "name" : "descriptions",
1403                "height" : 100
1404               }
1405              ]
1406             }
1407            ]
1408           }
1409          ]
1410         }
1411        ]
1412       }
1413      ]
1414     },
1415     {
1416      "listeners" : {
1417       "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
1418      },
1419      "fitToframe" : true,
1420      "background" : false,
1421      "region" : "east",
1422      "title" : "Images / Attachments",
1423      "xtype" : "GridPanel",
1424      "fitContainer" : true,
1425      "$ xns" : "Roo",
1426      "tableName" : "Images",
1427      "items" : [
1428       {
1429        "listeners" : {
1430         "|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}",
1431         "|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}"
1432        },
1433        "autoExpandColumn" : "title",
1434        "xtype" : "EditorGrid",
1435        "loadMask" : true,
1436        "clicksToEdit" : 1,
1437        "$ xns" : "Roo.grid",
1438        "* prop" : "grid",
1439        "items" : [
1440         {
1441          "listeners" : {
1442           "|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}",
1443           "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            Roo.MessageBox.alert('Error', res.errorMsg);\n            _this.grid.ds.load({});\n        }\n        \n        \n    });\n}"
1444          },
1445          "xtype" : "Store",
1446          "$ xns" : "Roo.data",
1447          "* prop" : "dataSource",
1448          "items" : [
1449           {
1450            "$ url" : "baseURL + '/Roo/Images.php'",
1451            "method" : "GET",
1452            "xtype" : "HttpProxy",
1453            "$ xns" : "Roo.data",
1454            "* prop" : "proxy"
1455           },
1456           {
1457            "id" : "id",
1458            "root" : "data",
1459            "xtype" : "JsonReader",
1460            "$ xns" : "Roo.data",
1461            "$ 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]",
1462            "* prop" : "reader",
1463            "totalProperty" : "total"
1464           }
1465          ]
1466         },
1467         {
1468          "xtype" : "Toolbar",
1469          "$ xns" : "Roo",
1470          "* prop" : "toolbar",
1471          "items" : [
1472           {
1473            "listeners" : {
1474             "|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        _this.grid.ds.load({});\n    }); \n\n}\n        "
1475            },
1476            "text" : "Add",
1477            "xtype" : "Button",
1478            "cls" : "x-btn-text-icon",
1479            "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
1480            "$ xns" : "Roo"
1481           },
1482           {
1483            "listeners" : {
1484             "|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        "
1485            },
1486            "text" : "Delete",
1487            "xtype" : "Button",
1488            "cls" : "x-btn-text-icon",
1489            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
1490            "$ xns" : "Roo"
1491           }
1492          ]
1493         },
1494         {
1495          "xtype" : "ColumnModel",
1496          "sortable" : false,
1497          "header" : "",
1498          "width" : 75,
1499          "$ 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}",
1500          "$ xns" : "Roo.grid",
1501          "* prop" : "colModel[]",
1502          "dataIndex" : "id"
1503         },
1504         {
1505          "xtype" : "ColumnModel",
1506          "width" : 200,
1507          "header" : "Filename",
1508          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1509          "$ xns" : "Roo.grid",
1510          "* prop" : "colModel[]",
1511          "dataIndex" : "filename"
1512         },
1513         {
1514          "xtype" : "ColumnModel",
1515          "width" : 50,
1516          "header" : "Order",
1517          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1518          "$ xns" : "Roo.grid",
1519          "* prop" : "colModel[]",
1520          "dataIndex" : "displayorder",
1521          "items" : [
1522           {
1523            "xtype" : "GridEditor",
1524            "$ xns" : "Roo.grid",
1525            "* prop" : "editor",
1526            "items" : [
1527             {
1528              "listeners" : {
1529               "focus" : "function (_self)\n{\n    if (this.value == 0) {\n        this.el.dom.value = '';\n    }\n}"
1530              },
1531              "xtype" : "NumberField",
1532              "$ xns" : "Roo.form",
1533              "decimalPrecision" : 0,
1534              "* prop" : "field"
1535             }
1536            ]
1537           }
1538          ]
1539         },
1540         {
1541          "xtype" : "ColumnModel",
1542          "width" : 100,
1543          "header" : "Title",
1544          "$ renderer" : "function(v) { return String.format('{0}', v); }",
1545          "$ xns" : "Roo.grid",
1546          "* prop" : "colModel[]",
1547          "dataIndex" : "title",
1548          "items" : [
1549           {
1550            "xtype" : "GridEditor",
1551            "$ xns" : "Roo.grid",
1552            "* prop" : "editor",
1553            "items" : [
1554             {
1555              "xtype" : "TextField",
1556              "$ xns" : "Roo.form",
1557              "* prop" : "field"
1558             }
1559            ]
1560           }
1561          ]
1562         },
1563         {
1564          "xtype" : "ColumnModel",
1565          "width" : 300,
1566          "header" : "URL",
1567          "$ renderer" : "function(v)\n{\n    return String.format('{0}', (v) ? v : '');\n}",
1568          "$ xns" : "Roo.grid",
1569          "* prop" : "colModel[]",
1570          "dataIndex" : "linkurl",
1571          "items" : [
1572           {
1573            "xtype" : "GridEditor",
1574            "$ xns" : "Roo.grid",
1575            "* prop" : "editor",
1576            "items" : [
1577             {
1578              "xtype" : "TextField",
1579              "$ xns" : "Roo.form",
1580              "* prop" : "field"
1581             }
1582            ]
1583           }
1584          ]
1585         }
1586        ]
1587       }
1588      ]
1589     },
1590     {
1591      "listeners" : {
1592       "render" : "function (_self)\n{\n    _this.westLayoutPanel = this;\n    \n}"
1593      },
1594      "Boolean fitContainer" : true,
1595      "xtype" : "NestedLayoutPanel",
1596      "Boolean fitToFrame" : true,
1597      "$ xns" : "Roo",
1598      "String region" : "west",
1599      "Boolean background" : false,
1600      "items" : [
1601       {
1602        "xtype" : "BorderLayout",
1603        "$ xns" : "Roo",
1604        "* prop" : "layout",
1605        "items" : [
1606         {
1607          "String tabPosition" : "top",
1608          "xtype" : "LayoutRegion",
1609          "$ xns" : "Roo",
1610          "* prop" : "center"
1611         },
1612         {
1613          "String tabPosition" : "top",
1614          "xtype" : "LayoutRegion",
1615          "Number height" : 250,
1616          "$ xns" : "Roo",
1617          "* prop" : "south",
1618          "Boolean split" : true
1619         },
1620         {
1621          "listeners" : {
1622           "resize" : "function (_self, width, height)\n{\n    Roo.log('resize called');\n    \n    var ew = Math.max(250, width - 10);\n    var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;\n    \n    \n    if (!_this.trform) {\n        return;\n    }\n    \n    var bd = _this.trform1.findField('body');\n    \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.trform2.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}",
1623           "render" : "function (_self)\n{\n  _this.trpanel = _self;\n}"
1624          },
1625          "autoScroll" : true,
1626          "fitToFrame" : true,
1627          "region" : "center",
1628          "xtype" : "ContentPanel",
1629          "$ xns" : "Roo",
1630          "items" : [
1631           {
1632            "listeners" : {
1633             "|actionfailed" : "function (_self, action)\n{\n    _this.dialog.el.unmask();\n \n    Pman.standardActionFailed(_self, action);\n}\n",
1634             "|actioncomplete" : "function (_self, action)\n{\n    if (action.type =='submit') {\n        return;\n    }\n    \n    if (action.type == 'setdata') {\n        _this.trform.addForm(_this.trform1);\n        _this.trform.addForm(_this.trform2);\n        _this.trform.addForm(_this.trform3);\n        \n        if ( _this.data.id) {\n            \n                this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n        } else {\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.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();\n       _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();\n       _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();\n       _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();\n        \n        return;\n    }\n}\n",
1635             "|rendered" : "function (_self)\n{\n    _this.trform = _self;\n}\n"
1636            },
1637            "labelAlign" : "right",
1638            "$ url" : "baseURL + '/Roo/cms_page.php'",
1639            "Boolean trackResetOnLoad" : true,
1640            "method" : "POST",
1641            "style" : "margin: 5px",
1642            "xtype" : "Form",
1643            "labelWidth" : 120,
1644            "$ 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    _this.westLayoutPanel.getLayout().getRegion('south').show();\n    _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);\n    _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);\n    _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);\n    \n    if(!has_lang){\n        _this.westLayoutPanel.getLayout().getRegion('south').hide();\n    }\n    \n    if(!has_extended && has_lang){\n        _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);\n        _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);\n    }\n    \n    var vis = {\n        title : has_lang\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    _this.updateRow.el[has_lang ? 'show' : 'hide']();\n   \n    \n    if(typeof(_this.trform.editors) == 'undefined'){\n        _this.trform.editors = {\n            body : _this.trform1.findField('body').wrap.isVisible(),\n            extended : _this.trform2.findField('extended').wrap.isVisible()\n       };\n       if(_this.trform.editors.body){\n            setInterval(_this.trform1.findField('body').autosave, 60000);\n       }\n       \n       if(_this.trform.editors.extended){\n            setInterval(_this.trform2.findField('extended').autosave, 60000);\n       }\n   }\n   \n   if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){\n        setInterval(_this.trform1.findField('body').autosave, 60000);\n        _this.trform.editors.body = true;\n   }\n   \n   if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){\n        setInterval(_this.trform2.findField('extended').autosave, 60000);\n        _this.trform.editors.extended = true;\n   }\n    \n    \n}\n",
1645            "$ xns" : "Roo.form",
1646            "items" : [
1647             {
1648              "labelAlign" : "top",
1649              "xtype" : "Column",
1650              "width" : 500,
1651              "$ xns" : "Roo.form",
1652              "items" : [
1653               {
1654                "labelAlign" : "top",
1655                "xtype" : "Row",
1656                "width" : 400,
1657                "$ xns" : "Roo.form",
1658                "items" : [
1659                 {
1660                  "listeners" : {
1661                   "add" : "function (combo)\n{\n    Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {\n       // Roo.log(res);\n       \n       _this.trform.reset();\n        _this.trform1.reset();\n        _this.trform2.reset();\n        \n        combo.setValue(res.lang);\n        combo.el.dom.value = res.lang_name;\n        (function() { \n            \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}",
1662                   "render" : "function (_self)\n{\n    _this.language = _self;\n}",
1663                   "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   _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}"
1664                  },
1665                  "alwaysQuery" : true,
1666                  "listWidth" : 400,
1667                  "triggerAction" : "all",
1668                  "fieldLabel" : "Select Language",
1669                  "forceSelection" : true,
1670                  "selectOnFocus" : true,
1671                  "pageSize" : 20,
1672                  "displayField" : "language_name",
1673                  "emptyText" : "Select Language",
1674                  "hiddenName" : "language",
1675                  "minChars" : 2,
1676                  "valueField" : "language",
1677                  "xtype" : "ComboBox",
1678                  "typeAhead" : false,
1679                  "editable" : false,
1680                  "$ xns" : "Roo.form",
1681                  "name" : "language_name",
1682                  "qtip" : "Select Language",
1683                  "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>",
1684                  "loadingText" : "Searching...",
1685                  "items" : [
1686                   {
1687                    "listeners" : {
1688                     "|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"
1689                    },
1690                    "xtype" : "Store",
1691                    "remoteSort" : true,
1692                    "$ sortInfo" : "{ direction : 'ASC', field: 'language' }",
1693                    "$ xns" : "Roo.data",
1694                    "* prop" : "store",
1695                    "items" : [
1696                     {
1697                      "$ url" : "baseURL + '/Roo/Cms_page.php'",
1698                      "method" : "GET",
1699                      "xtype" : "HttpProxy",
1700                      "$ xns" : "Roo.data",
1701                      "* prop" : "proxy"
1702                     },
1703                     {
1704                      "id" : "id",
1705                      "root" : "data",
1706                      "xtype" : "JsonReader",
1707                      "$ fields" : "[{\"name\":\"language\",\"type\":\"string\"}]",
1708                      "$ xns" : "Roo.data",
1709                      "* prop" : "reader",
1710                      "totalProperty" : "total"
1711                     }
1712                    ]
1713                   }
1714                  ]
1715                 },
1716                 {
1717                  "listeners" : {
1718                   "render" : "function (_self)\n{\n_this.updateRow = _self;\n}"
1719                  },
1720                  "xtype" : "Row",
1721                  "style" : "padding-top:12px;padding-left:30px;float:left",
1722                  "width" : 100,
1723                  "$ xns" : "Roo.form",
1724                  "items" : [
1725                   {
1726                    "listeners" : {
1727                     "click" : " function()\n {\n    //   _this.dialog.el.mask(\"Saving\");\n    if(!_this.trform1.findField('body').editorcore.sourceEditMode){\n        _this.trform1.findField('body').syncValue(); \n        _this.trform2.findField('extended').syncValue();\n    }else{\n        _this.trform1.findField('body').pushValue();\n        _this.trform2.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"
1728                    },
1729                    "text" : "Update",
1730                    "xtype" : "Button",
1731                    "$ xns" : "Roo"
1732                   }
1733                  ]
1734                 }
1735                ]
1736               },
1737               {
1738                "fieldLabel" : "Title",
1739                "xtype" : "TextField",
1740                "width" : 400,
1741                "$ xns" : "Roo.form",
1742                "name" : "title"
1743               }
1744              ]
1745             },
1746             {
1747              "xtype" : "Hidden",
1748              "$ xns" : "Roo.form",
1749              "name" : "id"
1750             },
1751             {
1752              "xtype" : "Hidden",
1753              "$ xns" : "Roo.form",
1754              "name" : "element_id"
1755             },
1756             {
1757              "xtype" : "Hidden",
1758              "$ xns" : "Roo.form",
1759              "name" : "menu_page_id"
1760             },
1761             {
1762              "xtype" : "Hidden",
1763              "$ xns" : "Roo.form",
1764              "name" : "is_menuitem"
1765             },
1766             {
1767              "xtype" : "Hidden",
1768              "value" : 0,
1769              "$ xns" : "Roo.form",
1770              "name" : "is_element"
1771             },
1772             {
1773              "xtype" : "Hidden",
1774              "$ xns" : "Roo.form",
1775              "name" : "translation_of_id"
1776             },
1777             {
1778              "xtype" : "Hidden",
1779              "$ xns" : "Roo.form",
1780              "name" : "parent_id"
1781             }
1782            ]
1783           }
1784          ]
1785         },
1786         {
1787          "Boolean fitContainer" : true,
1788          "xtype" : "ContentPanel",
1789          "Boolean fitToFrame" : true,
1790          "$ xns" : "Roo",
1791          "String region" : "south",
1792          "String title" : "Contents",
1793          "Boolean background" : false,
1794          "items" : [
1795           {
1796            "listeners" : {
1797             "rendered" : "function (form)\n{\n    _this.trform1 = form;\n}"
1798            },
1799            "$ url" : "baseURL + '/Roo/cms_page.php'",
1800            "xtype" : "Form",
1801            "method" : "POST",
1802            "labelWidth" : 80,
1803            "String labelAlign" : "top",
1804            "$ xns" : "Roo.form",
1805            "items" : [
1806             {
1807              "xtype" : "Row",
1808              "$ xns" : "Roo.form",
1809              "Boolean hideLabels" : true,
1810              "items" : [
1811               {
1812                "listeners" : {
1813                 "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
1814                 "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}",
1815                 "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}"
1816                },
1817                "fieldLabel" : "Contents",
1818                "xtype" : "HtmlEditor",
1819                "$ xns" : "Roo.form",
1820                "resizable" : "s",
1821                "$ autosave" : "function() {\n    \n    var body = _this.trform1.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",
1822                "$ array white" : "[ 'iframe' ]",
1823                "name" : "body",
1824                "height" : 140,
1825                "items" : [
1826                 {
1827                  "xtype" : "ToolbarStandard",
1828                  "$ xns" : "Roo.form.HtmlEditor",
1829                  "* prop" : "toolbars[]",
1830                  "items" : [
1831                   {
1832                    "listeners" : {
1833                     "render" : "function (_self)\n{\n    _this.trbodyimgselect = _self;\n}",
1834                     "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}",
1835                     "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}"
1836                    },
1837                    "alwaysQuery" : true,
1838                    "listWidth" : 400,
1839                    "$ 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>'",
1840                    "triggerAction" : "all",
1841                    "fieldLabel" : "Images",
1842                    "forceSelection" : true,
1843                    "selectOnFocus" : true,
1844                    "pageSize" : 20,
1845                    "displayField" : "name",
1846                    "emptyText" : "Add Image",
1847                    "minChars" : 2,
1848                    "valueField" : "id",
1849                    "xtype" : "ComboBox",
1850                    "typeAhead" : true,
1851                    "editable" : false,
1852                    "width" : 100,
1853                    "$ xns" : "Roo.form",
1854                    "* prop" : "btns[]",
1855                    "qtip" : "Select Images",
1856                    "loadingText" : "Searching...",
1857                    "items" : [
1858                     {
1859                      "listeners" : {
1860                       "|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"
1861                      },
1862                      "xtype" : "Store",
1863                      "remoteSort" : true,
1864                      "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
1865                      "$ xns" : "Roo.data",
1866                      "* prop" : "store",
1867                      "items" : [
1868                       {
1869                        "$ url" : "baseURL + '/Roo/Images.php'",
1870                        "xtype" : "HttpProxy",
1871                        "method" : "GET",
1872                        "$ xns" : "Roo.data",
1873                        "* prop" : "proxy"
1874                       },
1875                       {
1876                        "id" : "id",
1877                        "root" : "data",
1878                        "xtype" : "JsonReader",
1879                        "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]",
1880                        "$ xns" : "Roo.data",
1881                        "* prop" : "reader",
1882                        "totalProperty" : "total"
1883                       }
1884                      ]
1885                     }
1886                    ]
1887                   },
1888                   {
1889                    "listeners" : {
1890                     "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 }"
1891                    },
1892                    "listWidth" : 200,
1893                    "triggerAction" : "all",
1894                    "forceSelection" : true,
1895                    "selectOnFocus" : true,
1896                    "pageSize" : 40,
1897                    "displayField" : "page_link",
1898                    "emptyText" : "Add Link",
1899                    "hiddenName" : "add_link_id",
1900                    "minChars" : 2,
1901                    "valueField" : "id",
1902                    "xtype" : "ComboBox",
1903                    "allowBlank" : true,
1904                    "typeAhead" : true,
1905                    "editable" : true,
1906                    "width" : 100,
1907                    "$ xns" : "Roo.form",
1908                    "* prop" : "btns[]",
1909                    "name" : "add_link",
1910                    "qtip" : "Select Category ",
1911                    "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>",
1912                    "loadingText" : "Searching...",
1913                    "items" : [
1914                     {
1915                      "listeners" : {
1916                       "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}"
1917                      },
1918                      "xtype" : "Store",
1919                      "remoteSort" : true,
1920                      "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }",
1921                      "$ xns" : "Roo.data",
1922                      "* prop" : "store",
1923                      "items" : [
1924                       {
1925                        "$ url" : "baseURL + '/Roo/cms_page.php'",
1926                        "method" : "GET",
1927                        "xtype" : "HttpProxy",
1928                        "$ xns" : "Roo.data",
1929                        "* prop" : "proxy"
1930                       },
1931                       {
1932                        "id" : "id",
1933                        "root" : "data",
1934                        "xtype" : "JsonReader",
1935                        "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]",
1936                        "$ xns" : "Roo.data",
1937                        "* prop" : "reader",
1938                        "totalProperty" : "total"
1939                       }
1940                      ]
1941                     }
1942                    ]
1943                   },
1944                   {
1945                    "xtype" : "Separator",
1946                    "$ xns" : "Roo.Toolbar",
1947                    "* prop" : "btns[]"
1948                   },
1949                   {
1950                    "listeners" : {
1951                     "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
1952                    },
1953                    "text" : "Saved Version",
1954                    "xtype" : "Button",
1955                    "$ xns" : "Roo.Toolbar",
1956                    "* prop" : "btns[]"
1957                   }
1958                  ]
1959                 },
1960                 {
1961                  "xtype" : "ToolbarContext",
1962                  "$ xns" : "Roo.form.HtmlEditor",
1963                  "* prop" : "toolbars[]"
1964                 }
1965                ]
1966               }
1967              ]
1968             }
1969            ]
1970           }
1971          ]
1972         },
1973         {
1974          "Boolean fitContainer" : true,
1975          "xtype" : "ContentPanel",
1976          "Boolean fitToFrame" : true,
1977          "$ xns" : "Roo",
1978          "String region" : "south",
1979          "String title" : "Extended Content",
1980          "Boolean background" : false,
1981          "items" : [
1982           {
1983            "listeners" : {
1984             "rendered" : "function (form)\n{\n    _this.trform2 = form;\n}"
1985            },
1986            "$ url" : "baseURL + '/Roo/cms_page.php'",
1987            "xtype" : "Form",
1988            "method" : "POST",
1989            "labelWidth" : 80,
1990            "String labelAlign" : "top",
1991            "$ xns" : "Roo.form",
1992            "items" : [
1993             {
1994              "xtype" : "Row",
1995              "$ xns" : "Roo.form",
1996              "Boolean hideLabels" : true,
1997              "items" : [
1998               {
1999                "listeners" : {
2000                 "stylesheetsclick" : "function (_self)\n{\n    Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n        _this.dialog.setStylesheets();\n    })\n    \n}",
2001                 "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}",
2002                 "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}"
2003                },
2004                "fieldLabel" : "Extended Contents",
2005                "xtype" : "HtmlEditor",
2006                "$ xns" : "Roo.form",
2007                "resizable" : "s",
2008                "$ autosave" : "function() {\n    \n    var extended = _this.trform2.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",
2009                "$ array white" : "[ 'iframe' ]",
2010                "name" : "extended",
2011                "height" : 140,
2012                "items" : [
2013                 {
2014                  "xtype" : "ToolbarStandard",
2015                  "$ xns" : "Roo.form.HtmlEditor",
2016                  "* prop" : "toolbars[]",
2017                  "items" : [
2018                   {
2019                    "xtype" : "Separator",
2020                    "$ xns" : "Roo.Toolbar",
2021                    "* prop" : "btns[]"
2022                   },
2023                   {
2024                    "listeners" : {
2025                     "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
2026                    },
2027                    "text" : "Saved Version",
2028                    "xtype" : "Button",
2029                    "$ xns" : "Roo.Toolbar",
2030                    "* prop" : "btns[]"
2031                   }
2032                  ]
2033                 },
2034                 {
2035                  "xtype" : "ToolbarContext",
2036                  "$ xns" : "Roo.form.HtmlEditor",
2037                  "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}",
2038                  "* prop" : "toolbars[]"
2039                 }
2040                ]
2041               }
2042              ]
2043             }
2044            ]
2045           }
2046          ]
2047         },
2048         {
2049          "Boolean fitContainer" : true,
2050          "xtype" : "ContentPanel",
2051          "Boolean fitToFrame" : true,
2052          "$ xns" : "Roo",
2053          "String region" : "south",
2054          "String title" : "Meta Tags",
2055          "Boolean background" : false,
2056          "items" : [
2057           {
2058            "listeners" : {
2059             "rendered" : "function (form)\n{\n    _this.trform3 = form;\n}"
2060            },
2061            "$ url" : "baseURL + '/Roo/cms_page.php'",
2062            "method" : "POST",
2063            "xtype" : "Form",
2064            "labelWidth" : 80,
2065            "String labelAlign" : "top",
2066            "$ xns" : "Roo.form",
2067            "items" : [
2068             {
2069              "xtype" : "Row",
2070              "$ xns" : "Roo.form",
2071              "items" : [
2072               {
2073                "fieldLabel" : "Keywords",
2074                "xtype" : "TextArea",
2075                "width" : 340,
2076                "$ xns" : "Roo.form",
2077                "name" : "keywords",
2078                "height" : 100
2079               },
2080               {
2081                "fieldLabel" : "Descriptions",
2082                "xtype" : "TextArea",
2083                "width" : 340,
2084                "$ xns" : "Roo.form",
2085                "name" : "descriptions",
2086                "height" : 100
2087               }
2088              ]
2089             }
2090            ]
2091           }
2092          ]
2093         }
2094        ]
2095       }
2096      ]
2097     },
2098     {
2099      "listeners" : {
2100       "|click" : "function() {\n    \n    var page_link = _this.form.findField('page_link').getValue();\n    \n    if(!page_link.length){\n        Roo.MessageBox.alert('Error', 'Please fill in the page link');\n        return;\n    }\n    \n    if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){\n        Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');\n        return;\n    }\n    \n    var url = uiConfig.cms_page_preview_base + page_link;\n    \n    window.open(url);\n}\n"
2101      },
2102      "text" : "Preview",
2103      "xtype" : "Button",
2104      "$ xns" : "Roo",
2105      "* prop" : "buttons[]"
2106     },
2107     {
2108      "listeners" : {
2109       "|click" : " function() {\n\n    if(\n        _this.trform.isDirty() ||\n        _this.trform1.isDirty() ||\n        _this.trform2.isDirty() ||\n        _this.trform3.isDirty()\n    ) {\n        Roo.MessageBox.confirm(\n            \"Confirm\", \n            \"Do you want to save the translation\",\n            function(res) {\n                if(res != 'yes') {\n                    _this.form.reset();\n\n                    _this.dialog.hide();\n                    return;\n                }\n                \n            }\n        );\n        \n        return;\n    }\n    \n    _this.form.reset();\n\n    _this.dialog.hide();\n\n}\n"
2110      },
2111      "text" : "Cancel",
2112      "xtype" : "Button",
2113      "$ xns" : "Roo",
2114      "* prop" : "buttons[]"
2115     },
2116     {
2117      "listeners" : {
2118       "|click" : " function() {\n    _this.exit = false;\n    \n    if(!_this.form1.findField('body').editorcore.sourceEditMode){\n        _this.form1.findField('body').syncValue();\n        _this.form2.findField('extended').syncValue();\n        Roo.log('syncValue');\n    }else{\n        _this.form1.findField('body').pushValue();\n        _this.form2.findField('extended').pushValue();\n        Roo.log('pushValue');\n    }\n    \n    if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf(\"Crm\") == -1){\n        _this.interests.reset();\n    }\n        \n    if(\n        _this.trform.isDirty() ||\n        _this.trform1.isDirty() ||\n        _this.trform2.isDirty() ||\n        _this.trform3.isDirty()\n    ) {\n        Roo.MessageBox.confirm(\n            \"Confirm\", \n            \"Do you want to save the translation\",\n            function(res) {\n                if(res != 'yes') {\n                    _this.dialog.el.mask(\"Saving\");\n                    _this.form.doAction(\"submit\");\n                    return;\n                }\n                \n            }\n        );\n            \n        return;\n    }\n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}\n"
2119      },
2120      "text" : "Save",
2121      "xtype" : "Button",
2122      "$ xns" : "Roo",
2123      "* prop" : "buttons[]"
2124     },
2125     {
2126      "listeners" : {
2127       "|click" : " function() {\n\n        _this.exit = true;\n       \n       if(!_this.form1.findField('body').editorcore.sourceEditMode){\n            _this.form1.findField('body').syncValue();\n            _this.form2.findField('extended').syncValue();\n        }else{\n            _this.form1.findField('body').pushValue();\n            _this.form2.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        \n        if(\n            _this.trform.isDirty() ||\n            _this.trform1.isDirty() ||\n            _this.trform2.isDirty() ||\n            _this.trform3.isDirty()\n        ) {\n            Roo.MessageBox.confirm(\n                \"Confirm\", \n                \"Do you want to save the translation\",\n                function(res) {\n                    if(res != 'yes') {\n                        _this.dialog.el.mask(\"Saving\");\n                        _this.form.doAction(\"submit\");\n                        return;\n                    }\n                    \n                }\n            );\n            \n            return;\n        }\n        \n    _this.dialog.el.mask(\"Saving\");\n     _this.form.doAction(\"submit\");\n\n}\n"
2128      },
2129      "text" : "Save and close",
2130      "xtype" : "Button",
2131      "$ xns" : "Roo",
2132      "* prop" : "buttons[]"
2133     }
2134    ]
2135   }
2136  ]
2137 }