"name" : "Pman.Dialog.CmsBlog",
"parent" : "",
"title" : "Cms -Edit Blog Entry",
- "path" : "/home/alan/gitlive/Pman.Cms/Pman.Dialog.CmsBlog.bjs",
+ "path" : "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsBlog.bjs",
"permname" : "",
"modOrder" : "001",
"strings" : {
"|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",
"|rendered" : "function (_self)\n{\n _this.form = _self;\n}\n"
},
-<<<<<<< HEAD
"| 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",
"$ url" : "baseURL + '/Roo/cms_page.php'",
-=======
- "$ 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",
->>>>>>> 57b19330e0b2e6c740bee6ef17348d217bc5db35
"method" : "POST",
"style" : "margin: 5px",
"xtype" : "Form",
"name" : "target_url"
},
{
-<<<<<<< HEAD
"alwaysQuery" : true,
"listWidth" : 400,
"$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><b>{template_clean}</b></div>'\n",
-=======
- "$ tpl" : "'<div class=\"x-grid-cell-text x-btn button\"><b>{template_clean}</b></div>'\n",
- "alwaysQuery" : true,
- "listWidth" : 400,
->>>>>>> 57b19330e0b2e6c740bee6ef17348d217bc5db35
"triggerAction" : "all",
"fieldLabel" : "Layout",
"forceSelection" : true,
"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('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n baseURL, record.data.id, record.data.filename\n )\n );\n\n }\n \n}"
},
-<<<<<<< HEAD
"listWidth" : 400,
"$ 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>'",
"alwaysQuery" : true,
-=======
- "alwaysQuery" : true,
- "listWidth" : 400,
- "$ 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>'",
->>>>>>> 57b19330e0b2e6c740bee6ef17348d217bc5db35
"triggerAction" : "all",
"fieldLabel" : "Images",
"forceSelection" : true,
"listeners" : {
"|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
},
-<<<<<<< HEAD
"fitToframe" : true,
"background" : false,
"region" : "east",
-=======
- "region" : "east",
- "fitToframe" : true,
- "background" : false,
->>>>>>> 57b19330e0b2e6c740bee6ef17348d217bc5db35
"title" : "Images / Attachments",
"xtype" : "GridPanel",
"fitContainer" : true,
"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}",
+ "|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",
"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('<img src=\"{0}/Images/{1}/{2}#attachment-{1}\">',\n baseURL, record.data.id, record.data.filename\n )\n );\n\n }\n \n}"
},
-<<<<<<< HEAD
"alwaysQuery" : true,
"listWidth" : 400,
"$ 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>'",
-=======
- "$ 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>'",
- "alwaysQuery" : true,
- "listWidth" : 400,
->>>>>>> 57b19330e0b2e6c740bee6ef17348d217bc5db35
"triggerAction" : "all",
"fieldLabel" : "Images",
"forceSelection" : true,
},
{
"listeners" : {
- "|click" : " function() {\n\n _this.exit = false;\n \n \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 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 if (_this.form.findField('page_link').getValue().match(/ /)) {\n Roo.MessageBox.alert(\"Error\", \"Page link should not have a SPACE - use MINUS instead\");\n return;\n }\n \n \n \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}\n"
+ "|click" : " function() {\n\n _this.exit = false;\n \n \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 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 \n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}\n"
},
"text" : "Save",
"xtype" : "Button",
},
{
"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 if (_this.form.findField('page_link').getValue().match(/ /)) {\n Roo.MessageBox.alert(\"Error\", \"Page link should not have a SPACE - use MINUS instead\");\n return;\n }\n _this.dialog.el.mask(\"Saving\");\n _this.form.doAction(\"submit\");\n\n}\n"
+ "|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",