{ "name" : "Pman.Dialog.CmsBlog", "parent" : "", "title" : "Cms -Edit Blog Entry", "path" : "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsBlog.bjs", "permname" : "", "modOrder" : "001", "strings" : { "2f26e35d61be90501e099089dc533638" : "Select Images", "f3912172e6bf57f8979782f4a2342233" : "Appears in Block", "95cb4f45ab7ff3984f25ab8668499020" : "Select Parent", "c1df1da7a1ce305a3b60af9d5733ac1d" : "Contents", "f2a6c498fb90ee345d997f888fce3b18" : "Delete", "ebd9bec4d70abc789d439c1f136b0538" : "Layout", "20bec77364d863100a1f9325873a8504" : "Select Page Type", "a517747c3d12f99244ae598910d979c5" : "Author", "31fde7b05ac8952dacf4af8a704074ec" : "Preview", "779e2624ddf330fb05b51ae59faf212d" : "Select Status Type", "5834d26e96dbae06029496e5b111dca2" : "Has Extended content?", "6a5b847af3d97df722040debdbccfbed" : "Page Type", "30d1a216420426fcbd43ca70acd4aa48" : "Select interests", "f03ab16cd58372c77ba45a3d9a5a1cb9" : "Draft", "cc6892c9705afcfa61c53698756ba51b" : "Page Class", "e6b391a8d2c4d45902a23a8b6585703d" : "URL", "03368e3c1eb4d2a9048775874301b19f" : "Select category", "ec211f7c20af43e742bf2570c3cb84f9" : "Add", "778551900655782c5c7827332b08cf3f" : "Save and close", "77174410b72decfd0b259961f1f65a8f" : "Attributes:", "b28a711cf7e94ec793ef926633997529" : "Seq", "1243daf593fa297e07ab03bf06d925af" : "Searching...", "8a53accfc94c2500b00575ce0e0d786f" : "Primary Image", "580b21aac58f1b73cece26e272cdfbee" : "Add Link", "8bc84316c4078bf66723fd019616d920" : "Descriptions", "83dad8107f9459efe2b4fabcf5b63108" : "Select Language", "76729937a5eb6b0fd88c42581161facd" : "Select Category ", "0b8d92bc19b720bb1065649535463409" : "Translations", "14c21301c0faf9d5561b8a580be21a13" : "Select class", "d41d8cd98f00b204e9800998ecf8427e" : "", "867343577fa1f33caa632a19543bd252" : "Keywords", "340c2ee497b85d5954b01c64de7f44f6" : "Select Person", "69dd756ae9c23191a5bb9b61f0857432" : "Date to Publish", "3adbdb3ac060038aa0e6e6c138ef9873" : "Category", "57e195426892c5515935f21d97228814" : "Extended Contents", "d88aa1eee60ba140f07d5f81769cec74" : "<< Edit Translations", "b9c49611cfda3259a2b837b39489e650" : "Add Image", "ea4788705e6873b424c65e91c2846b19" : "Cancel", "cfcd208495d565ef66e7dff9f98764da" : "0", "d8e4d1f5e445107e505b2cf63a1fb65c" : "Extra CSS", "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version", "31bb2f6e9b8fb11cbb7fb63c6025223f" : "Select Template", "c02bd0c22c290ae599ee2f3ff2023fd3" : "Manage Images / Attachments >>", "b78a3223503896721cca1303f776159b" : "Title", "39f64cc9436cacfbceda3b7bdeb8e24c" : "Styles (CSS)", "e64df1d7c22b9638f084ce8a4aff3ff3" : "Target URL", "98e93e8f7adfe14832db6caed713d849" : "Meta Tags", "a240fa27925a635b08dc28c9e4f9216d" : "Order", "287234a1ff35a314b5b6bc4e5828e745" : "Attributes", "99e7707748ae048e17c5810fad119e0b" : "Select Page", "06933067aafd48425d67bcb01bba5cb6" : "Update", "8adedb6a6226807ba810215dd3b3c61b" : "Menu links to Page", "b5216c9b4e0ac0afd9c76eb1d12ad1b9" : "Select Section", "2ad41a2ff4f0dac97d63aff331d5e6e7" : "Downloads first Attachment", "308f2757bfc9ce92fb00ff93fdffd279" : "Images / Attachments", "76eb64a1725ee953c664e15c9213b2fd" : "Extended Content", "1351017ac6423911223bc19a8cb7c653" : "Filename", "c9cc8cce247e49bae79f15173ce97354" : "Save", "e659b52eba1f0299b2d8ca3483919e72" : "Type:", "c70952e4ab3806c049737cd7d2b8896b" : "Interests", "aa6356b678bc4fc78253c9edf65bff03" : "Edit Page / Blog Entry", "d52f80f80467bb575253a5a39ca016a7" : "Page link / Name / Order", "fff0d600f8a0b5e19e88bfb821dd1157" : "Images", "30269022e9d8f51beaabb52e5d0de2b7" : "Parent", "fb3f11443065d5f4d8303ad913db9680" : "Replaces (ignore)" }, "items" : [ { "listeners" : { "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 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);\n \n Pman.Cms.pageEditAddCustomFields();\n \n _this.dialog.getLayout().getRegion('east').collapse();\n _this.dialog.getLayout().getRegion('west').collapse();\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}" }, "modal" : true, "collapsible" : false, "background" : true, "title" : "Edit Page / Blog Entry", "xtype" : "LayoutDialog", "| 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}", "width" : 850, "$ xns" : "Roo", "closable" : true, "resizable" : false, "height" : 600, "items" : [ { "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center", "titlebar" : false }, { "listeners" : { "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}", "collapsed" : "function (_self)\n{\n if(_this.trform && _this.trform.isDirty()){\n _this.trform.reset();\n Roo.log('reset trform');\n }\n \n if(_this.trform1 && _this.trform1.isDirty()){\n _this.trform1.reset();\n Roo.log('reset trform1');\n }\n \n if(_this.trform2 && _this.trform2.isDirty()){\n _this.trform2.reset();\n Roo.log('reset trform2');\n }\n \n if(_this.trform3 && _this.trform3.isDirty()){\n _this.trform3.reset();\n Roo.log('reset trform3');\n }\n \n}", "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}" }, "collapsedTitle" : "Translations", "collapsible" : true, "fitToFrame" : true, "title" : "Translations", "xtype" : "LayoutRegion", "collapsed" : true, "$ xns" : "Roo", "split" : true, "* prop" : "west", "titlebar" : true }, { "listeners" : { "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}" }, "collapsedTitle" : "Images / Attachments", "collapsible" : true, "fitToFrame" : true, "title" : "Images / Attachments", "xtype" : "LayoutRegion", "collapsed" : true, "$ xns" : "Roo", "split" : true, "* prop" : "east", "titlebar" : true }, { "listeners" : { "render" : "function (_self)\n{\n _this.centerLayoutPanel = this;\n \n}" }, "Boolean fitContainer" : true, "xtype" : "NestedLayoutPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "center", "Boolean background" : false, "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "String tabPosition" : "top", "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "String tabPosition" : "top", "xtype" : "LayoutRegion", "Number height" : 250, "$ xns" : "Roo", "* prop" : "south", "Boolean split" : true }, { "listeners" : { "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}", "render" : "function (_self)\n{\n _this.cpanel = _self;\n}" }, "autoScroll" : true, "region" : "center", "fitToFrame" : true, "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "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}" }, "text" : "<< Edit Translations", "xtype" : "Button", "$ xns" : "Roo.Toolbar" }, { "xtype" : "Fill", "$ xns" : "Roo.Toolbar" }, { "listeners" : { "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}" }, "text" : "Manage Images / Attachments >>", "xtype" : "Button", "$ xns" : "Roo.Toolbar" } ] }, { "listeners" : { "|actionfailed" : "function (_self, action)\n{\n _this.dialog.el.unmask(); \n Pman.standardActionFailed(_self, action);\n}\n", "|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 _this.trform3.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", "|rendered" : "function (_self)\n{\n _this.form = _self;\n}\n" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "| 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}", "labelAlign" : "right", "method" : "POST", "style" : "margin: 5px", "xtype" : "Form", "labelWidth" : 120, "$ 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", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Column", "labelWidth" : 200, "width" : 750, "$ xns" : "Roo.form", "items" : [ { "labelAlign" : "right", "hideLabels" : false, "style" : "height:30px;overflow:hidden", "xtype" : "Row", "labelWidth" : 200, "width" : 850, "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Type:", "xtype" : "Hidden", "width" : 1, "$ xns" : "Roo.form" }, { "hideLabels" : true, "style" : "height:30px;overflow:hidden", "xtype" : "Row", "labelWidth" : 0, "width" : 600, "$ xns" : "Roo.form", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.page_type = _self;\n}", "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}" }, "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Page Type", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "display_name", "emptyText" : "Select Status Type", "hiddenName" : "page_type_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "typeAhead" : false, "editable" : false, "$ xns" : "Roo.form", "name" : "page_type_id_display_name", "qtip" : "Select Page Type", "tpl" : "
{display_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params.etype = 'cms_page_type'; \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/core_enum.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"display_name\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "style" : "padding-left: -70px;", "xtype" : "Column", "labelWidth" : 60, "width" : 200, "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Seq", "xtype" : "NumberField", "decimalPrecision" : 0, "width" : 50, "$ xns" : "Roo.form", "name" : "seq_id" } ] } ] } ] }, { "labelAlign" : "right", "hideLabels" : false, "style" : "height:30px;overflow:hidden", "xtype" : "Row", "labelWidth" : 200, "width" : 800, "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Attributes:", "xtype" : "Hidden", "width" : 1, "$ xns" : "Roo.form" }, { "hideLabels" : true, "style" : "height:30px;overflow:hidden", "xtype" : "Row", "labelWidth" : 0, "width" : 540, "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Attributes", "xtype" : "Checkbox", "boxLabel" : "Draft", "width" : 100, "$ xns" : "Roo.form", "name" : "is_draft" }, { "listeners" : { "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}" }, "inputValue" : 1, "xtype" : "Checkbox", "boxLabel" : "Has Extended content?", "width" : 180, "$ xns" : "Roo.form", "name" : "has_extended" }, { "listeners" : { "check" : "function (_self, checked)\n{ \n if (_this.form) { \n \n _this.form.showHide.defer(100, _this.form); \n }\n}" }, "inputValue" : 1, "xtype" : "Checkbox", "boxLabel" : "Downloads first Attachment", "width" : 180, "$ xns" : "Roo.form", "name" : "is_attachment" } ] } ] }, { "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Author", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "name", "emptyText" : "Select Person", "hiddenName" : "author_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : false, "editable" : true, "width" : 300, "$ xns" : "Roo.form", "name" : "author_id_name", "qtip" : "Select Person", "queryParam" : "query[name]", "tpl" : "
{name} - {company_id_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n\n o.params.active = 1;\n o.params['query[is_owner]'] = 1;\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/core_person'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Category", "xtype" : "ComboBoxArray", "hiddenName" : "category", "width" : 400, "$ xns" : "Roo.form", "name" : "category_name", "items" : [ { "alwaysQuery" : true, "listWidth" : 400, "Number pageSize" : 40, "triggerAction" : "all", "fieldLabel" : "Category", "forceSelection" : true, "selectOnFocus" : true, "displayField" : "display_fullpath", "emptyText" : "Select category", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : false, "editable" : true, "width" : 385, "$ xns" : "Roo.form", "* prop" : "combo", "queryParam" : "search[name]", "tpl" : "
{fullpath}
", "items" : [ { "listeners" : { "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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'tree_sequence', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"name\",\"type\":\"string\"},\n {\"name\":\"display_name\",\"type\":\"string\"}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] }, { "listeners" : { "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}" }, "listWidth" : 600, "triggerAction" : "all", "fieldLabel" : "Parent", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "page_link", "emptyText" : "Select Parent", "hiddenName" : "parent_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "Boolean alwaysQuery" : true, "editable" : true, "width" : 400, "$ xns" : "Roo.form", "name" : "parent_id_title", "qtip" : "Select Category ", "tpl" : "
{title} {page_link}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "xtype" : "Row", "labelWidth" : 200, "$ xns" : "Roo.form", "items" : [ { "format" : "Y-m-d", "fieldLabel" : "Date to Publish", "xtype" : "DateField", "width" : 200, "$ xns" : "Roo.form", "altFormats" : "Y-m-d H:i:s", "name" : "published" }, { "fieldLabel" : "Replaces (ignore)", "xtype" : "TextField", "width" : 75, "$ xns" : "Roo.form", "name" : "to_replace_id" } ] }, { "listeners" : { "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}" }, "fieldLabel" : "Title", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "title" }, { "fieldLabel" : "Page link / Name / Order", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "page_link" }, { "fieldLabel" : "Target URL", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "target_url" }, { "$ tpl" : "'
{template_clean}
'\n", "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Layout", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "template_clean", "emptyText" : "Select Template", "hiddenName" : "template_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 400, "$ xns" : "Roo.form", "name" : "template_id_template_clean", "qtip" : "Select Category ", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'template', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Cms_template'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Appears in Block", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "name", "emptyText" : "Select Section", "hiddenName" : "element_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 400, "$ xns" : "Roo.form", "name" : "element_id_name", "qtip" : "Select Category ", "tpl" : "
{name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'name', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Cms_template_element'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' }, {name: 'template', type: 'string'}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "alwaysQuery" : true, "listWidth" : 600, "triggerAction" : "all", "fieldLabel" : "Menu links to Page", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "page_link", "emptyText" : "Select Page", "hiddenName" : "menu_page_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 400, "$ xns" : "Roo.form", "name" : "menu_page_id_page_link", "qtip" : "Select Category ", "tpl" : "
[{page_type_id_display_name}] {title} {page_link}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'title', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\n \"name\":\"id\",\n \"type\":\"int\"\n },\n {\n \"name\":\"title\",\n \"type\":\"string\"\n },\n {\n \"name\":\"page_link\",\n \"type\":\"string\"\n },\n {\n \"name\":\"page_type_id_display_name\",\n \"type\":\"string\"\n }\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "fieldLabel" : "Page Class", "hiddenName" : "page_cls", "xtype" : "ComboBoxArray", "width" : 400, "$ xns" : "Roo.form", "name" : "page_cls_name", "items" : [ { "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Page Class", "forceSelection" : true, "selectOnFocus" : true, "displayField" : "display_name", "emptyText" : "Select class", "minChars" : 2, "valueField" : "name", "xtype" : "ComboBox", "allowBlank" : true, "editable" : true, "width" : 385, "$ xns" : "Roo.form", "* prop" : "combo", "queryParam" : "query[search]", "tpl" : "
{display_name}
", "items" : [ { "listeners" : { "beforeload" : "function (_self, o){\n o.params = o.params || {};\n\n o.params.etype = 'cms_page_class'; \n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'seqid' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/core_enum.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"name\",\"type\":\"string\"},\n {\"name\":\"display_name\",\"type\":\"string\"}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] } ] }, { "xtype" : "Column", "labelWidth" : 200, "width" : 250, "$ xns" : "Roo.form", "items" : [ { "xtype" : "FieldSet", "String labelAlign" : "top", "$ xns" : "Roo.form", "String legend" : "Primary Image", "String/Object/Function style" : "width: 165px;", "Boolean hideLabels" : true, "items" : [ { "xtype" : "DisplayField", "style" : "border: 1px solid #ccc;", "$ valueRenderer" : "function(v) {\n\n if (!v || v * 1 < 1) {\n return '
 
';\n }\n \n return String.format('', baseURL, v); \n}", "icon" : "rootURL + 'images/default/dd/drop-add.gif'", "width" : 150, "$ xns" : "Roo.form", "height" : 150, "name" : "primary_image_id" } ] } ] }, { "listeners" : { "render" : "function (_self)\n{\n _this.interestsCol = _self;\n}" }, "xtype" : "Column", "$ xns" : "Roo.form", "items" : [ { "listeners" : { "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}" }, "fieldLabel" : "Interests", "hiddenName" : "interest", "xtype" : "ComboBoxArray", "width" : 300, "$ xns" : "Roo.form", "name" : "interest_name", "items" : [ { "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Interests", "forceSelection" : true, "selectOnFocus" : true, "displayField" : "display_name", "emptyText" : "Select interests", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "editable" : true, "width" : 285, "$ xns" : "Roo.form", "* prop" : "combo", "queryParam" : "query[name]", "tpl" : "
{display_name}
", "items" : [ { "listeners" : { "beforeload" : "function (_self, o){\n o.params = o.params || {};\n o.params.etype = 'crm_interest';\n}\n" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'name' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Core_enum.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n {\"name\":\"id\",\"type\":\"int\"},\n {\"name\":\"name\",\"type\":\"string\"},\n {\"name\":\"display_name\",\"type\":\"string\"}\n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] } ] } ] }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "is_system_page" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "is_menuitem" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "page_type_id_name" }, { "listeners" : { "render" : "function (_self)\n{\n _this.user_defined_fields = _self;\n}" }, "xtype" : "Column", "$ xns" : "Roo.form" } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Contents", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.form1 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "Form", "method" : "POST", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "items" : [ { "listeners" : { "stylesheetsclick" : "function (_self)\n{\n Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n _this.dialog.setStylesheets();\n })\n \n}", "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}", "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}" }, "xtype" : "HtmlEditor", "$ xns" : "Roo.form", "width" : 550, "String fieldLabel" : "Contents", "resizable" : "s", "$ 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", "$ array white" : "[ 'iframe' ]", "name" : "body", "height" : 150, "items" : [ { "xtype" : "ToolbarStandard", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.bodyimgselect = _self;\n}", "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}", "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('',\n baseURL, record.data.id, record.data.filename\n )\n );\n\n }\n \n}" }, "alwaysQuery" : true, "listWidth" : 400, "$ tpl" : "'
{filename}
'", "triggerAction" : "all", "fieldLabel" : "Images", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "name", "emptyText" : "Add Image", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "typeAhead" : true, "editable" : false, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "qtip" : "Select Images", "queryParam" : "search", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listeners" : { "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('{1}',\n record.data.page_link, record.data.title\n )\n );\n\n \n }" }, "listWidth" : 200, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "page_link", "emptyText" : "Add Link", "hiddenName" : "add_link_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "name" : "add_link", "qtip" : "Select Category ", "tpl" : "
{title} {page_link}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "xtype" : "Separator", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}" }, "String cls" : "x-init-enable", "text" : "Saved Version", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" } ] }, { "xtype" : "ToolbarContext", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]" } ] } ] } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Extended Content", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.form2 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "Form", "method" : "POST", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "items" : [ { "listeners" : { "stylesheetsclick" : "function (_self)\n{\n Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n _this.dialog.setStylesheets();\n })\n \n}", "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}", "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}" }, "fieldLabel" : "Extended Contents", "xtype" : "HtmlEditor", "width" : 550, "$ xns" : "Roo.form", "resizable" : "s", "$ 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", "$ array white" : "[ 'iframe' ]", "name" : "extended", "height" : 150, "items" : [ { "xtype" : "ToolbarStandard", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.extendimgselect = _self;\n}", "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}", "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('',\n baseURL, record.data.id, record.data.filename\n )\n );\n\n }\n \n}" }, "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Images", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "name", "emptyText" : "Add Image", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "typeAhead" : true, "editable" : false, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "qtip" : "Select Images", "tpl" : "
{filename}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listeners" : { "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('{1}',\n record.data.page_link, record.data.title\n )\n );\n\n \n }" }, "listWidth" : 200, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "page_link", "emptyText" : "Add Link", "hiddenName" : "add_link_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "name" : "add_link", "qtip" : "Select Category ", "tpl" : "
{title} {page_link}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "xtype" : "Separator", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}" }, "text" : "Saved Version", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" } ] }, { "xtype" : "ToolbarContext", "$ xns" : "Roo.form.HtmlEditor", "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}", "* prop" : "toolbars[]" } ] } ] } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Extra CSS", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.form3 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "method" : "POST", "xtype" : "Form", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "items" : [ { "fieldLabel" : "Styles (CSS)", "xtype" : "TextArea", "width" : 700, "$ xns" : "Roo.form", "name" : "extra_css", "height" : 200 } ] } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Meta Tags", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.form4 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "Form", "method" : "POST", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Keywords", "xtype" : "TextArea", "width" : 340, "$ xns" : "Roo.form", "name" : "keywords", "height" : 100 }, { "fieldLabel" : "Descriptions", "xtype" : "TextArea", "width" : 340, "$ xns" : "Roo.form", "name" : "descriptions", "height" : 100 } ] } ] } ] } ] } ] }, { "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "region" : "east", "fitToframe" : true, "background" : false, "title" : "Images / Attachments", "xtype" : "GridPanel", "fitContainer" : true, "$ xns" : "Roo", "tableName" : "Images", "items" : [ { "listeners" : { "|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}", "|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}" }, "autoExpandColumn" : "title", "xtype" : "EditorGrid", "loadMask" : true, "clicksToEdit" : 1, "$ xns" : "Roo.grid", "* prop" : "grid", "items" : [ { "listeners" : { "|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}", "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}" }, "xtype" : "Store", "$ xns" : "Roo.data", "* prop" : "dataSource", "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", "$ 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]", "* prop" : "reader", "totalProperty" : "total" } ] }, { "xtype" : "Toolbar", "$ xns" : "Roo", "* prop" : "toolbar", "items" : [ { "listeners" : { "|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 " }, "text" : "Add", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", "$ xns" : "Roo" }, { "listeners" : { "|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 " }, "text" : "Delete", "xtype" : "Button", "cls" : "x-btn-text-icon", "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", "$ xns" : "Roo" } ] }, { "xtype" : "ColumnModel", "sortable" : false, "header" : "", "width" : 75, "$ renderer" : "function(v,x,r) { \n return String.format('', baseURL, v, r.data.filename); \n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "id" }, { "xtype" : "ColumnModel", "header" : "Filename", "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "filename" }, { "xtype" : "ColumnModel", "header" : "Order", "width" : 50, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "displayorder", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "listeners" : { "focus" : "function (_self)\n{\n if (this.value == 0) {\n this.el.dom.value = '';\n }\n}" }, "xtype" : "NumberField", "decimalPrecision" : 0, "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "header" : "Title", "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "title", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextField", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] }, { "xtype" : "ColumnModel", "header" : "URL", "width" : 300, "$ renderer" : "function(v)\n{\n return String.format('{0}', (v) ? v : '');\n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", "dataIndex" : "linkurl", "items" : [ { "xtype" : "GridEditor", "$ xns" : "Roo.grid", "* prop" : "editor", "items" : [ { "xtype" : "TextField", "$ xns" : "Roo.form", "* prop" : "field" } ] } ] } ] } ] }, { "listeners" : { "render" : "function (_self)\n{\n _this.westLayoutPanel = this;\n \n}" }, "Boolean fitContainer" : true, "xtype" : "NestedLayoutPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "west", "Boolean background" : false, "items" : [ { "xtype" : "BorderLayout", "$ xns" : "Roo", "* prop" : "layout", "items" : [ { "String tabPosition" : "top", "xtype" : "LayoutRegion", "$ xns" : "Roo", "* prop" : "center" }, { "String tabPosition" : "top", "xtype" : "LayoutRegion", "Number height" : 250, "$ xns" : "Roo", "* prop" : "south", "Boolean split" : true }, { "listeners" : { "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}", "render" : "function (_self)\n{\n _this.trpanel = _self;\n}" }, "autoScroll" : true, "region" : "center", "fitToFrame" : true, "xtype" : "ContentPanel", "$ xns" : "Roo", "items" : [ { "listeners" : { "|actionfailed" : "function (_self, action)\n{\n _this.dialog.el.unmask();\n \n Pman.standardActionFailed(_self, action);\n}\n", "|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", "|rendered" : "function (_self)\n{\n _this.trform = _self;\n}\n" }, "labelAlign" : "right", "$ url" : "baseURL + '/Roo/cms_page.php'", "Boolean trackResetOnLoad" : true, "method" : "POST", "style" : "margin: 5px", "xtype" : "Form", "labelWidth" : 120, "$ 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", "$ xns" : "Roo.form", "items" : [ { "labelAlign" : "top", "xtype" : "Column", "width" : 500, "$ xns" : "Roo.form", "items" : [ { "labelAlign" : "top", "xtype" : "Row", "width" : 400, "$ xns" : "Roo.form", "items" : [ { "listeners" : { "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}", "render" : "function (_self)\n{\n _this.language = _self;\n}", "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}" }, "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Select Language", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "language_name", "emptyText" : "Select Language", "hiddenName" : "language", "minChars" : 2, "valueField" : "language", "xtype" : "ComboBox", "typeAhead" : false, "editable" : false, "$ xns" : "Roo.form", "name" : "language_name", "qtip" : "Select Language", "tpl" : "
{language_name}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'language' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Cms_page.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"language\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listeners" : { "render" : "function (_self)\n{\n_this.updateRow = _self;\n}" }, "xtype" : "Row", "style" : "padding-top:12px;padding-left:30px;float:left", "width" : 100, "$ xns" : "Roo.form", "items" : [ { "listeners" : { "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" }, "text" : "Update", "xtype" : "Button", "$ xns" : "Roo" } ] } ] }, { "fieldLabel" : "Title", "xtype" : "TextField", "width" : 400, "$ xns" : "Roo.form", "name" : "title" } ] }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "element_id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "menu_page_id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "is_menuitem" }, { "xtype" : "Hidden", "value" : 0, "$ xns" : "Roo.form", "name" : "is_element" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "translation_of_id" }, { "xtype" : "Hidden", "$ xns" : "Roo.form", "name" : "parent_id" } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Contents", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.trform1 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "method" : "POST", "xtype" : "Form", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "items" : [ { "listeners" : { "stylesheetsclick" : "function (_self)\n{\n Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n _this.dialog.setStylesheets();\n })\n \n}", "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}", "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}" }, "fieldLabel" : "Contents", "xtype" : "HtmlEditor", "$ xns" : "Roo.form", "resizable" : "s", "$ 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", "$ array white" : "[ 'iframe' ]", "name" : "body", "height" : 140, "items" : [ { "xtype" : "ToolbarStandard", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]", "items" : [ { "listeners" : { "render" : "function (_self)\n{\n _this.trbodyimgselect = _self;\n}", "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}", "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('',\n baseURL, record.data.id, record.data.filename\n )\n );\n\n }\n \n}" }, "$ tpl" : "'
{filename}
'", "alwaysQuery" : true, "listWidth" : 400, "triggerAction" : "all", "fieldLabel" : "Images", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 20, "displayField" : "name", "emptyText" : "Add Image", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "typeAhead" : true, "editable" : false, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "qtip" : "Select Images", "loadingText" : "Searching...", "items" : [ { "listeners" : { "|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" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ direction : 'ASC', field: 'id' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/Images.php'", "method" : "GET", "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"filename\",\"type\":\"string\"},{\"name\":\"url_thumb\",\"type\":\"string\"}]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "listeners" : { "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('{1}',\n record.data.page_link, record.data.title\n )\n );\n\n \n }" }, "listWidth" : 200, "triggerAction" : "all", "forceSelection" : true, "selectOnFocus" : true, "pageSize" : 40, "displayField" : "page_link", "emptyText" : "Add Link", "hiddenName" : "add_link_id", "minChars" : 2, "valueField" : "id", "xtype" : "ComboBox", "allowBlank" : true, "typeAhead" : true, "editable" : true, "width" : 100, "$ xns" : "Roo.form", "* prop" : "btns[]", "name" : "add_link", "qtip" : "Select Category ", "tpl" : "
{title} {page_link}
", "loadingText" : "Searching...", "items" : [ { "listeners" : { "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}" }, "xtype" : "Store", "remoteSort" : true, "$ sortInfo" : "{ field: 'page_link', direction: 'ASC' }", "$ xns" : "Roo.data", "* prop" : "store", "items" : [ { "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "HttpProxy", "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, { "id" : "id", "root" : "data", "xtype" : "JsonReader", "$ fields" : "[\n { name: 'id', type: 'int' },\n 'title',\n 'page_link' \n]", "$ xns" : "Roo.data", "* prop" : "reader", "totalProperty" : "total" } ] } ] }, { "xtype" : "Separator", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}" }, "text" : "Saved Version", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" } ] }, { "xtype" : "ToolbarContext", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]" } ] } ] } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Extended Content", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.trform2 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "method" : "POST", "xtype" : "Form", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "Boolean hideLabels" : true, "items" : [ { "listeners" : { "stylesheetsclick" : "function (_self)\n{\n Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){\n _this.dialog.setStylesheets();\n })\n \n}", "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}", "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}" }, "fieldLabel" : "Extended Contents", "xtype" : "HtmlEditor", "$ xns" : "Roo.form", "resizable" : "s", "$ 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", "$ array white" : "[ 'iframe' ]", "name" : "extended", "height" : 140, "items" : [ { "xtype" : "ToolbarStandard", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]", "items" : [ { "xtype" : "Separator", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" }, { "listeners" : { "click" : "function (_self, e)\n{\n this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}" }, "text" : "Saved Version", "xtype" : "Button", "$ xns" : "Roo.Toolbar", "* prop" : "btns[]" } ] }, { "xtype" : "ToolbarContext", "$ styles" : "typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {}", "$ xns" : "Roo.form.HtmlEditor", "* prop" : "toolbars[]" } ] } ] } ] } ] }, { "Boolean fitContainer" : true, "xtype" : "ContentPanel", "Boolean fitToFrame" : true, "$ xns" : "Roo", "String region" : "south", "String title" : "Meta Tags", "Boolean background" : false, "items" : [ { "listeners" : { "rendered" : "function (form)\n{\n _this.trform3 = form;\n}" }, "$ url" : "baseURL + '/Roo/cms_page.php'", "xtype" : "Form", "method" : "POST", "labelWidth" : 80, "String labelAlign" : "top", "$ xns" : "Roo.form", "items" : [ { "xtype" : "Row", "$ xns" : "Roo.form", "items" : [ { "fieldLabel" : "Keywords", "xtype" : "TextArea", "width" : 340, "$ xns" : "Roo.form", "name" : "keywords", "height" : 100 }, { "fieldLabel" : "Descriptions", "xtype" : "TextArea", "width" : 340, "$ xns" : "Roo.form", "name" : "descriptions", "height" : 100 } ] } ] } ] } ] } ] }, { "listeners" : { "|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" }, "text" : "Preview", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "|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 _this.dialog.hide();\n return;\n }\n \n }\n );\n \n return;\n }\n \n _this.form.reset();\n _this.dialog.hide();\n\n}\n" }, "text" : "Cancel", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "|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" }, "text" : "Save", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" }, { "listeners" : { "|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" }, "text" : "Save and close", "xtype" : "Button", "$ xns" : "Roo", "* prop" : "buttons[]" } ] } ] }