1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CmsBlog = {
10 '2f26e35d61be90501e099089dc533638' :"Select Images",
11 'f3912172e6bf57f8979782f4a2342233' :"Appears in Block",
12 '95cb4f45ab7ff3984f25ab8668499020' :"Select Parent",
13 'c1df1da7a1ce305a3b60af9d5733ac1d' :"Contents",
14 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
15 'ebd9bec4d70abc789d439c1f136b0538' :"Layout",
16 '20bec77364d863100a1f9325873a8504' :"Select Page Type",
17 'a517747c3d12f99244ae598910d979c5' :"Author",
18 '31fde7b05ac8952dacf4af8a704074ec' :"Preview",
19 '779e2624ddf330fb05b51ae59faf212d' :"Select Status Type",
20 '5834d26e96dbae06029496e5b111dca2' :"Has Extended content?",
21 '6a5b847af3d97df722040debdbccfbed' :"Page Type",
22 '30d1a216420426fcbd43ca70acd4aa48' :"Select interests",
23 'f03ab16cd58372c77ba45a3d9a5a1cb9' :"Draft",
24 'cc6892c9705afcfa61c53698756ba51b' :"Page Class",
25 'e6b391a8d2c4d45902a23a8b6585703d' :"URL",
26 '03368e3c1eb4d2a9048775874301b19f' :"Select category",
27 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
28 '778551900655782c5c7827332b08cf3f' :"Save and close",
29 '77174410b72decfd0b259961f1f65a8f' :"Attributes:",
30 'b28a711cf7e94ec793ef926633997529' :"Seq",
31 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
32 '8a53accfc94c2500b00575ce0e0d786f' :"Primary Image",
33 '580b21aac58f1b73cece26e272cdfbee' :"Add Link",
34 '8bc84316c4078bf66723fd019616d920' :"Descriptions",
35 '83dad8107f9459efe2b4fabcf5b63108' :"Select Language",
36 '76729937a5eb6b0fd88c42581161facd' :"Select Category ",
37 '0b8d92bc19b720bb1065649535463409' :"Translations",
38 '14c21301c0faf9d5561b8a580be21a13' :"Select class",
39 'd41d8cd98f00b204e9800998ecf8427e' :"",
40 '867343577fa1f33caa632a19543bd252' :"Keywords",
41 '340c2ee497b85d5954b01c64de7f44f6' :"Select Person",
42 '69dd756ae9c23191a5bb9b61f0857432' :"Date to Publish",
43 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
44 '57e195426892c5515935f21d97228814' :"Extended Contents",
45 'd88aa1eee60ba140f07d5f81769cec74' :"<< Edit Translations",
46 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
47 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
48 'cfcd208495d565ef66e7dff9f98764da' :"0",
49 'd8e4d1f5e445107e505b2cf63a1fb65c' :"Extra CSS",
50 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
51 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
52 'c02bd0c22c290ae599ee2f3ff2023fd3' :"Manage Images / Attachments >>",
53 'b78a3223503896721cca1303f776159b' :"Title",
54 '39f64cc9436cacfbceda3b7bdeb8e24c' :"Styles (CSS)",
55 'e64df1d7c22b9638f084ce8a4aff3ff3' :"Target URL",
56 '98e93e8f7adfe14832db6caed713d849' :"Meta Tags",
57 'a240fa27925a635b08dc28c9e4f9216d' :"Order",
58 '287234a1ff35a314b5b6bc4e5828e745' :"Attributes",
59 '99e7707748ae048e17c5810fad119e0b' :"Select Page",
60 '06933067aafd48425d67bcb01bba5cb6' :"Update",
61 '8adedb6a6226807ba810215dd3b3c61b' :"Menu links to Page",
62 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' :"Select Section",
63 '2ad41a2ff4f0dac97d63aff331d5e6e7' :"Downloads first Attachment",
64 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
65 '76eb64a1725ee953c664e15c9213b2fd' :"Extended Content",
66 '1351017ac6423911223bc19a8cb7c653' :"Filename",
67 'c9cc8cce247e49bae79f15173ce97354' :"Save",
68 'e659b52eba1f0299b2d8ca3483919e72' :"Type:",
69 'c70952e4ab3806c049737cd7d2b8896b' :"Interests",
70 'aa6356b678bc4fc78253c9edf65bff03' :"Edit Page / Blog Entry",
71 'd52f80f80467bb575253a5a39ca016a7' :"Page link / Name / Order",
72 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images",
73 '30269022e9d8f51beaabb52e5d0de2b7' :"Parent",
74 'fb3f11443065d5f4d8303ad913db9680' :"Replaces (ignore)"
77 'seq_id_fieldLabel' : 'b28a711cf7e94ec793ef926633997529' /* Seq */ ,
78 'to_replace_id_fieldLabel' : 'fb3f11443065d5f4d8303ad913db9680' /* Replaces (ignore) */ ,
79 'template_id_template_clean_fieldLabel' : 'ebd9bec4d70abc789d439c1f136b0538' /* Layout */ ,
80 'page_cls_name_fieldLabel' : 'cc6892c9705afcfa61c53698756ba51b' /* Page Class */ ,
81 'language_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
82 'template_id_template_clean_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
83 'author_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
84 'page_type_id_display_name_fieldLabel' : '6a5b847af3d97df722040debdbccfbed' /* Page Type */ ,
85 'has_extended_boxLabel' : '5834d26e96dbae06029496e5b111dca2' /* Has Extended content? */ ,
86 'language_name_emptyText' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
87 'author_id_name_qtip' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
88 'menu_page_id_page_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
89 'published_fieldLabel' : '69dd756ae9c23191a5bb9b61f0857432' /* Date to Publish */ ,
90 'author_id_name_fieldLabel' : 'a517747c3d12f99244ae598910d979c5' /* Author */ ,
91 'element_id_name_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
92 'parent_id_title_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
93 'element_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
94 'author_id_name_emptyText' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
95 'is_attachment_boxLabel' : '2ad41a2ff4f0dac97d63aff331d5e6e7' /* Downloads first Attachment */ ,
96 'extra_css_fieldLabel' : '39f64cc9436cacfbceda3b7bdeb8e24c' /* Styles (CSS) */ ,
97 'template_id_template_clean_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
98 'parent_id_title_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
99 'is_draft_fieldLabel' : '287234a1ff35a314b5b6bc4e5828e745' /* Attributes */ ,
100 'add_link_emptyText' : '580b21aac58f1b73cece26e272cdfbee' /* Add Link */ ,
101 'keywords_fieldLabel' : '867343577fa1f33caa632a19543bd252' /* Keywords */ ,
102 'descriptions_fieldLabel' : '8bc84316c4078bf66723fd019616d920' /* Descriptions */ ,
103 'add_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
104 'menu_page_id_page_link_emptyText' : '99e7707748ae048e17c5810fad119e0b' /* Select Page */ ,
105 'element_id_name_fieldLabel' : 'f3912172e6bf57f8979782f4a2342233' /* Appears in Block */ ,
106 'is_element_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ ,
107 'target_url_fieldLabel' : 'e64df1d7c22b9638f084ce8a4aff3ff3' /* Target URL */ ,
108 'interest_name_fieldLabel' : 'c70952e4ab3806c049737cd7d2b8896b' /* Interests */ ,
109 'language_name_qtip' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
110 'page_type_id_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
111 'language_name_fieldLabel' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
112 'element_id_name_emptyText' : 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' /* Select Section */ ,
113 'menu_page_id_page_link_fieldLabel' : '8adedb6a6226807ba810215dd3b3c61b' /* Menu links to Page */ ,
114 'page_type_id_display_name_emptyText' : '779e2624ddf330fb05b51ae59faf212d' /* Select Status Type */ ,
115 'template_id_template_clean_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
116 'menu_page_id_page_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
117 'extended_fieldLabel' : '57e195426892c5515935f21d97228814' /* Extended Contents */ ,
118 'add_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
119 'category_name_fieldLabel' : '3adbdb3ac060038aa0e6e6c138ef9873' /* Category */ ,
120 'page_type_id_display_name_qtip' : '20bec77364d863100a1f9325873a8504' /* Select Page Type */ ,
121 'body_fieldLabel' : 'c1df1da7a1ce305a3b60af9d5733ac1d' /* Contents */ ,
122 'parent_id_title_emptyText' : '95cb4f45ab7ff3984f25ab8668499020' /* Select Parent */ ,
123 'title_fieldLabel' : 'b78a3223503896721cca1303f776159b' /* Title */ ,
124 'is_draft_boxLabel' : 'f03ab16cd58372c77ba45a3d9a5a1cb9' /* Draft */ ,
125 'page_link_fieldLabel' : 'd52f80f80467bb575253a5a39ca016a7' /* Page link / Name / Order */ ,
126 'parent_id_title_fieldLabel' : '30269022e9d8f51beaabb52e5d0de2b7' /* Parent */
132 show : function(data, cb)
140 this.dialog.show(this.data._el);
143 this.form.setValues(data);
144 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
152 this.dialog = Roo.factory({
153 xtype : 'LayoutDialog',
160 setStylesheets : function() {
163 sheets.push(rootURL + '/Pman/Cms/templates/undoreset.css');
165 if(typeof(uiConfig) !== 'undefined' && typeof(uiConfig.cms_css) != 'undefined'){
166 Roo.each(uiConfig.cms_css, function(v){
167 sheets.push(rootURL + v);
172 url : baseURL + '/Roo/Cms_page.php',
177 success : function(res) {
179 if(res.data._stylesheets.length){
180 var setting = res.data._stylesheets.split("\n");
182 Roo.each(setting, function(s){
183 sheets.push(s.replace('{rootURL}', rootURL));
188 _this.form1.findField('body').removeStylesheets();
189 _this.form2.findField('extended').removeStylesheets();
191 _this.form1.findField('body').setStylesheets(sheets);
192 _this.form2.findField('extended').setStylesheets(sheets);
194 _this.trform1.findField('body').removeStylesheets();
195 _this.trform2.findField('extended').removeStylesheets();
197 _this.trform1.findField('body').setStylesheets(sheets);
198 _this.trform2.findField('extended').setStylesheets(sheets);
203 title : _this._strings['aa6356b678bc4fc78253c9edf65bff03'] /* Edit Page / Blog Entry */,
206 show : function (_self)
208 // @see the contentpanel - center - resize handler.
210 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
212 var w = Roo.lib.Dom.getViewWidth();
213 var h = Roo.lib.Dom.getViewHeight();
214 this.resizeTo(w-50, h-50);
217 _this.centerLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
218 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
220 Pman.Cms.pageEditAddCustomFields();
222 _this.dialog.getLayout().getRegion('east').collapse();
223 _this.dialog.getLayout().getRegion('west').collapse();
226 var ew = Math.max(250, w-150); // was 350?/ why?
227 //var eh = Math.max(250, h-350) ;
230 var bd = _this.form1.findField('body');
235 // since render delays resize..
236 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
237 //_this.bodycol.el.setWidth(bd.width+20);
239 var bd = _this.form2.findField('extended');
243 // since render delays resize..
244 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
245 // _this.extendcol.el.setWidth(bd.width+20);
247 var bd = _this.form3.findField('extra_css');
250 //_this.keywordscol.el.setWidth(ew+20);
253 // fix messed up scroll.
254 _this.dialog.layout.el.dom.scrollTop = 0;
262 xtype : 'LayoutRegion',
268 xtype : 'LayoutRegion',
270 collapsedTitle : 'Images / Attachments',
274 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
277 expanded : function (_self)
279 var id = _this.form.findField('id').getValue() * 1;
282 Roo.MessageBox.alert('Error', 'Save first');
287 var w = Roo.lib.Dom.getViewWidth();
288 var h = Roo.lib.Dom.getViewHeight();
290 _self.resizeTo.defer(110, _self,[ w-400, h] );
291 _this.dialog.getLayout().getRegion('west').collapse();
298 xtype : 'LayoutRegion',
300 collapsedTitle : 'Translations',
304 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
307 beforecollapse : function (_self)
309 if(!_this.trform || !_this.trform1 || !_this.trform2){
314 !_this.trform.isDirty() &&
315 !_this.trform1.isDirty() &&
316 !_this.trform2.isDirty() &&
317 !_this.trform3.isDirty()
322 Roo.MessageBox.confirm(
324 "Do you want to save the translation",
327 _self.collapse(true, true);
337 collapsed : function (_self)
339 if(_this.trform && _this.trform.isDirty()){
340 _this.trform.reset();
343 if(_this.trform1 && _this.trform1.isDirty()){
344 _this.trform1.reset();
347 if(_this.trform2 && _this.trform2.isDirty()){
348 _this.trform2.reset();
351 if(_this.trform3 && _this.trform3.isDirty()){
352 _this.trform3.reset();
356 expanded : function (_self)
358 var id = _this.form.findField('id').getValue() * 1;
361 Roo.MessageBox.alert('Error', 'Save first');
366 var w = Roo.lib.Dom.getViewWidth();
367 var h = Roo.lib.Dom.getViewHeight();
369 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
371 _this.panel.region.collapse();
381 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
385 var page_link = _this.form.findField('page_link').getValue();
387 if(!page_link.length){
388 Roo.MessageBox.alert('Error', 'Please fill in the page link');
392 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
393 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
397 var url = uiConfig.cms_page_preview_base + page_link;
407 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
412 _this.trform.isDirty() ||
413 _this.trform1.isDirty() ||
414 _this.trform2.isDirty() ||
415 _this.trform3.isDirty()
417 Roo.MessageBox.confirm(
419 "Do you want to save the translation",
443 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
448 if(!_this.form1.findField('body').editorcore.sourceEditMode){
449 _this.form1.findField('body').syncValue();
450 _this.form2.findField('extended').syncValue();
451 Roo.log('syncValue');
453 _this.form1.findField('body').pushValue();
454 _this.form2.findField('extended').pushValue();
455 Roo.log('pushValue');
458 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
459 _this.interests.reset();
463 _this.trform.isDirty() ||
464 _this.trform1.isDirty() ||
465 _this.trform2.isDirty() ||
466 _this.trform3.isDirty()
468 Roo.MessageBox.confirm(
470 "Do you want to save the translation",
473 _this.dialog.el.mask("Saving");
474 _this.form.doAction("submit");
484 _this.dialog.el.mask("Saving");
485 _this.form.doAction("submit");
494 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
500 if(!_this.form1.findField('body').editorcore.sourceEditMode){
501 _this.form1.findField('body').syncValue();
502 _this.form2.findField('extended').syncValue();
504 _this.form1.findField('body').pushValue();
505 _this.form2.findField('extended').pushValue();
508 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
509 _this.interests.reset();
514 _this.trform.isDirty() ||
515 _this.trform1.isDirty() ||
516 _this.trform2.isDirty() ||
517 _this.trform3.isDirty()
519 Roo.MessageBox.confirm(
521 "Do you want to save the translation",
524 _this.dialog.el.mask("Saving");
525 _this.form.doAction("submit");
535 _this.dialog.el.mask("Saving");
536 _this.form.doAction("submit");
546 xtype : 'NestedLayoutPanel',
552 render : function (_self)
554 _this.centerLayoutPanel = this;
561 xtype : 'BorderLayout',
565 xtype : 'LayoutRegion',
571 xtype : 'LayoutRegion',
580 xtype : 'ContentPanel',
585 render : function (_self)
587 _this.cpanel = _self;
589 resize : function (_self, width, height)
591 Roo.log("RESIZE, " + width + ',' + height);
593 var ew = Math.max(250, width - 10);
594 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
601 bd = _this.form1.findField('body');
605 // since render delays resize..
606 Roo.log('resizing body to ' + bd.width);
607 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
608 // _this.bodycol.el.setWidth(bd.width+20);
613 bd = _this.form2.findField('extended');
619 Roo.log('resizing extended to ' + bd.width);
620 // since render delays resize..
621 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
622 // _this.extendcol.el.setWidth(bd.width+20);
627 bd = _this.form3.findField('extra_css');
631 // _this.keywordscol.el.setWidth(ew+20);
633 // fix for messed up rendering of dialog?
637 _this.dialog.layout.el.dom.scrollTop = 0;
639 // noop... - the above sometimes fails...
652 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
654 click : function (_self, e)
656 if (_this.dialog.getLayout().getRegion('west').collapsed) {
657 _this.dialog.getLayout().getRegion('west').expand();
659 _this.dialog.getLayout().getRegion('west').collapse();
665 '|xns' : 'Roo.Toolbar'
670 '|xns' : 'Roo.Toolbar'
674 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
676 click : function (_self, e)
678 if (_this.panel.region.collapsed) {
679 _this.panel.region.expand();
681 _this.panel.region.collapse();
687 '|xns' : 'Roo.Toolbar'
696 _this.form.setValues(_this.data);
700 _this.dialog.el.unmask();
701 _this.grid.getDataSource().load();
703 _this.trform.reset();
704 _this.trform1.reset();
705 _this.trform2.reset();
707 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
708 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
711 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
712 catlabel.dom.innerHTML = 'Category';
714 if(_this.data.page_type_id_name == 'category'){
715 catlabel.dom.innerHTML = 'Parent Category';
719 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
720 catlabel.dom.innerHTML = 'Parent page';
721 if(_this.data.page_type_id_name == 'category'){
722 catlabel.dom.innerHTML = 'Parent';
725 // better if this was not here... - not sure which project uses it?
727 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
728 _this.interestsCol.show();
731 if(typeof(d['interests']) != 'undefined'){
732 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
735 if(typeof(d['categories']) != 'undefined'){
736 _this.form.findField('category').setValue(Roo.decode(d['categories']));
739 if(typeof(d['page_classes']) != 'undefined'){
740 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
743 _this.trpanel.el.unmask();
744 _this.panel.el.unmask();
747 _this.cpanel.el.dom.scrollTop = 0;
749 // fix messed up scroll.
750 _this.dialog.layout.el.dom.scrollTop = 0;
753 labelAlign : 'right',
756 showHide : function()
763 var page_type_name = _this.form.findField('page_type_id_name').getValue();
765 switch(page_type_name){
788 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
789 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
790 var has_extended = _this.form.findField('has_extended').getValue() * 1;
793 is_attachment : !in_rss,
795 category_type_id : in_rss && !is_menu,
796 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
797 target_url : is_menu,
799 category : !is_category,
801 parent_id : !in_rss || is_category ,
804 to_replace_id :false, // !in_rss, // is this used.
805 is_draft : !is_system_page,
806 author_id : in_rss && !is_menu && !is_attachment,
808 template_id : !is_attachment && !is_menu && !is_system_page,
809 element_id : is_element && !is_menu,
810 menu_page_id : is_menu,
811 page_cls : is_element
813 // has_extended : !is_menu && !is_attachment, // always shown.
814 // extended : has_extended && !is_menu && !is_attachment,
815 // body : !is_attachment && !is_menu,
816 //keywords : !is_attachment && !is_menu,
817 // descriptions : !is_attachment && !is_menu
818 // extra_css : !is_attachment && !is_menu
822 var el = _this.form.findField(k);
825 Roo.log("missing field " + k);
829 el.actionMode = 'fieldEl';
839 _this.centerLayoutPanel.getLayout().getRegion('south').show();
840 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
841 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
842 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
843 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
845 if(is_attachment || is_menu){
847 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
851 if(!has_extended && !is_attachment && !is_menu){
852 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
853 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
857 _this.trform.showHide();
859 if(typeof(_this.form.editors) == 'undefined'){
860 _this.form.editors = {
861 body : _this.form1.findField('body').wrap.isVisible(),
862 extended : _this.form2.findField('extended').wrap.isVisible()
865 if(_this.form.editors.body){
866 setInterval(_this.form1.findField('body').autosave, 60000);
869 if(_this.form.editors.extended){
870 setInterval(_this.form2.findField('extended').autosave, 60000);
874 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
875 setInterval(_this.form1.findField('body').autosave, 60000);
876 _this.form.editors.body = true;
879 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
880 setInterval(_this.form2.findField('extended').autosave, 60000);
881 _this.form.editors.extended = true;
887 style : 'margin: 5px',
888 url : baseURL + '/Roo/cms_page.php',
890 actioncomplete : function (_self, action)
893 if (action.type == 'setdata') {
895 _this.form.addForm(_this.form1);
896 _this.form.addForm(_this.form2);
897 _this.form.addForm(_this.form3);
898 _this.form.addForm(_this.form4);
900 _this.dialog.setStylesheets();
902 _this.dialog.getLayout().getRegion('west').collapse();
903 _this.panel.region.collapse();
905 _this.trpanel.el.mask('Save first');
906 _this.panel.el.mask('Save first');
908 _this.loaded = false;
909 _this.interestsCol.hide();
911 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
913 if ( _this.data.id) {
914 _this.dialog.el.mask("Loading");
915 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
919 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
920 this.findField('is_draft').setValue(is_draft);
921 _this.page_type.setValue(_this.data.page_type_id);
922 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
924 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
925 _this.interestsCol.show();
928 _this.form.showHide();
931 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
932 catlabel.dom.innerHTML = 'Category';
933 if(_this.data.page_type_id_name == 'category'){
934 catlabel.dom.innerHTML = 'Parent Category';
939 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
940 catlabel.dom.innerHTML = 'Parent page';
941 if(_this.data.page_type_id_name == 'category'){
942 catlabel.dom.innerHTML = 'Parent';
948 if(_this.data._is_copy){
949 _this.form.is_copy();
955 if (action.type == 'load') {
957 //_this.data = action.result.data;
959 var d = action.result.data;
961 _this.dialog.el.unmask();
962 _this.grid.getDataSource().load();
964 _this.trform.reset();
965 _this.trform1.reset();
966 _this.trform2.reset();
967 _this.trform3.reset();
969 _this.trform.addForm(_this.trform1);
970 _this.trform.addForm(_this.trform2);
972 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
973 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
974 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
975 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
976 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
979 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
980 catlabel.dom.innerHTML = 'Category';
982 if(_this.data.page_type_id_name == 'category'){
983 catlabel.dom.innerHTML = 'Parent Category';
987 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
988 catlabel.dom.innerHTML = 'Parent page';
989 if(_this.data.page_type_id_name == 'category'){
990 catlabel.dom.innerHTML = 'Parent';
993 // better if this was not here... - not sure which project uses it?
995 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
996 _this.interestsCol.show();
999 if(typeof(d['interests']) != 'undefined'){
1000 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1003 if(typeof(d['categories']) != 'undefined'){
1004 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1007 if(typeof(d['page_classes']) != 'undefined'){
1008 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1011 _this.trpanel.el.unmask();
1012 _this.panel.el.unmask();
1015 _this.cpanel.el.dom.scrollTop = 0;
1017 // fix messed up scroll.
1018 _this.dialog.layout.el.dom.scrollTop = 0;
1022 if (action.type =='submit') {
1024 _this.dialog.el.unmask();
1027 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1031 _this.dialog.hide();
1034 if (_this.callback) {
1035 _this.callback.call(_this, action.result.data);
1041 actionfailed : function (_self, action)
1043 _this.dialog.el.unmask();
1044 Pman.standardActionFailed(_self, action);
1046 rendered : function (_self)
1052 '|xns' : 'Roo.form',
1059 '|xns' : 'Roo.form',
1064 labelAlign : 'right',
1066 style : 'height:30px;overflow:hidden',
1069 '|xns' : 'Roo.form',
1073 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1082 style : 'height:30px;overflow:hidden',
1085 '|xns' : 'Roo.form',
1090 displayField : 'display_name',
1092 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1093 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1094 forceSelection : true,
1095 hiddenName : 'page_type_id',
1097 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1099 name : 'page_type_id_display_name',
1101 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1102 selectOnFocus : true,
1103 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1104 triggerAction : 'all',
1108 render : function (_self)
1110 _this.page_type = _self;
1112 select : function (combo, record, index)
1114 // _this.grid.footer.onClick('first');
1115 var page_type_name = record.data.name;
1116 _this.form.findField('page_type_id_name').setValue(page_type_name);
1117 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1118 _this.form.findField('is_attachment').setValue(0);
1122 _this.form.showHide.defer(100, _this.form);
1128 '|xns' : 'Roo.form',
1132 sortInfo : { direction : 'ASC', field: 'seqid' },
1134 beforeload : function (_self, o){
1135 o.params = o.params || {};
1137 o.params.etype = 'cms_page_type';
1141 '|xns' : 'Roo.data',
1143 xtype : 'HttpProxy',
1145 url : baseURL + '/Roo/core_enum.php',
1150 xtype : 'JsonReader',
1151 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1154 totalProperty : 'total',
1163 style : 'padding-left: -70px;',
1166 '|xns' : 'Roo.form',
1169 xtype : 'NumberField',
1170 decimalPrecision : 0,
1171 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1186 labelAlign : 'right',
1188 style : 'height:30px;overflow:hidden',
1191 '|xns' : 'Roo.form',
1195 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1204 style : 'height:30px;overflow:hidden',
1207 '|xns' : 'Roo.form',
1211 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1212 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1220 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1222 name : 'has_extended',
1225 check : function (_self, checked)
1230 _this.form.showHide();
1231 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1242 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1244 name : 'is_attachment',
1247 check : function (_self, checked)
1251 _this.form.showHide.defer(100, _this.form);
1265 displayField : 'name',
1267 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1268 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1269 forceSelection : true,
1270 hiddenName : 'author_id',
1272 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1274 name : 'author_id_name',
1276 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1277 queryParam : 'query[name]',
1278 selectOnFocus : true,
1279 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1280 triggerAction : 'all',
1285 '|xns' : 'Roo.form',
1289 sortInfo : { direction : 'ASC', field: 'name' },
1291 beforeload : function (_self, o){
1292 o.params = o.params || {};
1294 o.params.active = 1;
1295 o.params['query[is_owner]'] = 1;
1299 '|xns' : 'Roo.data',
1301 xtype : 'HttpProxy',
1303 url : baseURL + '/Roo/core_person',
1308 xtype : 'JsonReader',
1309 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1312 totalProperty : 'total',
1319 xtype : 'ComboBoxArray',
1320 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1321 hiddenName : 'category',
1322 name : 'category_name',
1325 '|xns' : 'Roo.form',
1330 displayField : 'display_fullpath',
1332 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1333 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1334 forceSelection : true,
1338 queryParam : 'search[name]',
1339 selectOnFocus : true,
1340 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1341 triggerAction : 'all',
1345 '|xns' : 'Roo.form',
1349 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1351 beforeload : function (_self, o){
1352 o.params = o.params || {};
1354 o.params.page_type_id_name= 'CATEGORY';
1356 o.params._with_fullpath = 1;
1360 '|xns' : 'Roo.data',
1362 xtype : 'HttpProxy',
1364 url : baseURL + '/Roo/cms_page.php',
1369 xtype : 'JsonReader',
1371 {"name":"id","type":"int"},
1372 {"name":"name","type":"string"},
1373 {"name":"display_name","type":"string"}
1377 totalProperty : 'total',
1388 displayField : 'page_link',
1390 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1391 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1392 forceSelection : true,
1393 hiddenName : 'parent_id',
1395 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1397 name : 'parent_id_title',
1399 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1400 selectOnFocus : true,
1401 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1402 triggerAction : 'all',
1407 select : function (combo, record, index)
1409 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1410 if (page_type_name == 'page') { // page
1413 // do not default to put 'Home' at the beginning.
1414 if (!record || !(record.data.parent_id *1)) {
1417 var pl = _this.form.findField('page_link');
1418 var lk = pl.getValue();
1419 var new_link = record.data.page_link + '/';
1421 new_link += lk.split('/').pop();
1423 pl.setValue(new_link);
1428 '|xns' : 'Roo.form',
1432 sortInfo : { field: 'page_link', direction: 'ASC' },
1434 beforeload : function (_self, options)
1436 options.params['search[page_link_no_empty]'] =1;
1438 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1439 options.params._page_type = 'page,element';
1441 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1444 var id = _this.form.findField('id').getValue() * 1;
1447 options.params['!id'] = id;
1452 options.params.is_element = 0;
1453 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1454 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1459 '|xns' : 'Roo.data',
1461 xtype : 'HttpProxy',
1463 url : baseURL + '/Roo/cms_page.php',
1468 xtype : 'JsonReader',
1470 { name: 'id', type: 'int' },
1476 totalProperty : 'total',
1486 '|xns' : 'Roo.form',
1489 xtype : 'DateField',
1490 altFormats : 'Y-m-d H:i:s',
1491 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1499 xtype : 'TextField',
1500 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1501 name : 'to_replace_id',
1509 xtype : 'TextField',
1510 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1514 keyup : function (_self, e)
1516 if (_this.page_type.getRawValue() == 'Category') {
1518 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1527 xtype : 'TextField',
1528 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1535 xtype : 'TextField',
1536 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1537 name : 'target_url',
1546 displayField : 'template_clean',
1548 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1549 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1550 forceSelection : true,
1551 hiddenName : 'template_id',
1553 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1555 name : 'template_id_template_clean',
1557 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1558 selectOnFocus : true,
1559 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1560 triggerAction : 'all',
1565 '|xns' : 'Roo.form',
1569 sortInfo : { field: 'template', direction: 'ASC' },
1571 beforeload : function (_self, options)
1574 options.params._rescan = 1;
1575 options.params._clean_name = 1;
1576 // options.params.lang = 'en';
1577 options.params['!template[0]'] = 'master.html';
1578 //options.params['!template[1]'] = 'index.html';
1582 '|xns' : 'Roo.data',
1584 xtype : 'HttpProxy',
1586 url : baseURL + '/Roo/Cms_template',
1591 xtype : 'JsonReader',
1593 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1597 totalProperty : 'total',
1607 displayField : 'name',
1609 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1610 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1611 forceSelection : true,
1612 hiddenName : 'element_id',
1614 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1616 name : 'element_id_name',
1618 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1619 selectOnFocus : true,
1620 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1621 triggerAction : 'all',
1626 '|xns' : 'Roo.form',
1630 sortInfo : { field: 'name', direction: 'ASC' },
1632 beforeload : function (_self, options)
1634 var par = _this.form.findField('parent_id').getValue() * 1;
1636 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1640 options.params._cms_page_id = par;
1644 '|xns' : 'Roo.data',
1646 xtype : 'HttpProxy',
1648 url : baseURL + '/Roo/Cms_template_element',
1653 xtype : 'JsonReader',
1655 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1659 totalProperty : 'total',
1669 displayField : 'page_link',
1671 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1672 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1673 forceSelection : true,
1674 hiddenName : 'menu_page_id',
1676 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1678 name : 'menu_page_id_page_link',
1680 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1681 selectOnFocus : true,
1682 tpl : '<div class=\"x-grid-cell-text x-btn button\"><span style=\"color:#1b809e\">[{page_type_id_display_name}] </span><b>{title} </b><i>{page_link}</i></div>',
1683 triggerAction : 'all',
1688 '|xns' : 'Roo.form',
1692 sortInfo : { field: 'title', direction: 'ASC' },
1694 beforeload : function (_self, options)
1696 options.params = options.params || {};
1698 options.params['search[page_link_no_empty]'] =1;
1700 options.params['page_type_id_name[0]'] = 'page';
1701 options.params['page_type_id_name[1]'] = 'blog';
1703 options.params.is_element = 0;
1704 options.params.is_menuitem = 0;
1709 '|xns' : 'Roo.data',
1711 xtype : 'HttpProxy',
1713 url : baseURL + '/Roo/cms_page.php',
1718 xtype : 'JsonReader',
1733 "name":"page_type_id_display_name",
1739 totalProperty : 'total',
1746 xtype : 'ComboBoxArray',
1747 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1748 hiddenName : 'page_cls',
1749 name : 'page_cls_name',
1752 '|xns' : 'Roo.form',
1757 displayField : 'display_name',
1759 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1760 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1761 forceSelection : true,
1764 queryParam : 'query[search]',
1765 selectOnFocus : true,
1766 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1767 triggerAction : 'all',
1768 valueField : 'name',
1771 '|xns' : 'Roo.form',
1775 sortInfo : { direction : 'ASC', field: 'seqid' },
1777 beforeload : function (_self, o){
1778 o.params = o.params || {};
1780 o.params.etype = 'cms_page_class';
1784 '|xns' : 'Roo.data',
1786 xtype : 'HttpProxy',
1788 url : baseURL + '/Roo/core_enum.php',
1793 xtype : 'JsonReader',
1795 {"name":"id","type":"int"},
1796 {"name":"name","type":"string"},
1797 {"name":"display_name","type":"string"}
1801 totalProperty : 'total',
1815 '|xns' : 'Roo.form',
1821 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1822 style : 'width: 165px;',
1824 '|xns' : 'Roo.form',
1827 xtype : 'DisplayField',
1829 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1830 name : 'primary_image_id',
1831 style : 'border: 1px solid #ccc;',
1832 valueRenderer : function(v) {
1834 if (!v || v * 1 < 1) {
1835 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1838 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1851 render : function (_self)
1853 _this.interestsCol = _self;
1857 '|xns' : 'Roo.form',
1860 xtype : 'ComboBoxArray',
1861 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1862 hiddenName : 'interest',
1863 name : 'interest_name',
1866 render : function (_self)
1868 _this.interests = _self;
1870 _self.combo.addicon.setStyle( {
1871 position : 'absolute',
1880 '|xns' : 'Roo.form',
1885 displayField : 'display_name',
1887 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1888 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1889 forceSelection : true,
1892 queryParam : 'query[name]',
1893 selectOnFocus : true,
1894 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1895 triggerAction : 'all',
1899 '|xns' : 'Roo.form',
1903 sortInfo : { direction : 'ASC', field: 'name' },
1905 beforeload : function (_self, o){
1906 o.params = o.params || {};
1907 o.params.etype = 'crm_interest';
1911 '|xns' : 'Roo.data',
1913 xtype : 'HttpProxy',
1915 url : baseURL + '/Roo/Core_enum.php',
1920 xtype : 'JsonReader',
1922 {"name":"id","type":"int"},
1923 {"name":"name","type":"string"},
1924 {"name":"display_name","type":"string"}
1928 totalProperty : 'total',
1945 name : 'is_system_page',
1951 name : 'is_menuitem',
1957 name : 'page_type_id_name',
1964 render : function (_self)
1966 _this.user_defined_fields = _self;
1977 xtype : 'ContentPanel',
1979 fitContainer : true,
1982 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1991 url : baseURL + '/Roo/cms_page.php',
1993 rendered : function (form)
1999 '|xns' : 'Roo.form',
2005 '|xns' : 'Roo.form',
2008 xtype : 'HtmlEditor',
2009 autosave : function() {
2011 var body = _this.form1.findField('body');
2013 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2014 Roo.log('body not dirty');
2018 Roo.log('body dirty, auto save!');
2020 body.fireEvent('autosave', body);
2024 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2028 white : [ 'iframe' ],
2031 autosave : function (_self)
2033 Roo.log('autosave');
2035 var id = _this.form.findField('id').getValue() * 1;
2037 if(!_self.editorcore.sourceEditMode){
2044 url : baseURL + '/Roo/Events.php',
2048 action : 'AUTOSAVE',
2049 on_id : (id > 0) ? id : 0,
2050 on_table : 'cms_page',
2052 source: _self.getValue()
2054 success : function() {
2055 _self.originalValue = _self.getValue();
2058 failure : function()
2060 //Roo.MessageBox.alert("Error", "autosave failed");
2061 Roo.log('body autosave failed?!');
2066 savedpreview : function (_self)
2068 Roo.log('saved preview');
2070 var id = _this.form.findField('id').getValue() * 1;
2072 var successFn = function(res){
2073 return res.data.POST.source;
2077 action : 'AUTOSAVE',
2079 on_id : (id < 1) ? 0 : id,
2080 on_table : 'cms_page',
2081 successFn : successFn
2085 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2086 _self.setValue(res);
2087 _self.originalValue = res;
2090 stylesheetsclick : function (_self)
2092 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2093 _this.dialog.setStylesheets();
2099 '|xns' : 'Roo.form',
2102 xtype : 'ToolbarStandard',
2103 xns : Roo.form.HtmlEditor,
2104 '|xns' : 'Roo.form.HtmlEditor',
2109 displayField : 'name',
2111 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2112 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2113 forceSelection : true,
2115 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2118 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2119 queryParam : 'search',
2120 selectOnFocus : true,
2121 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><br/><b>{filename}</b> </div>',
2122 triggerAction : 'all',
2127 beforequery : function (combo, query, forceAll, cancel, e)
2130 var id = _this.form.findField('id').getValue() * 1;
2132 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2136 render : function (_self)
2138 _this.bodyimgselect = _self;
2140 select : function (combo, record, index)
2147 var editor = _this.form1.findField('body').editorcore;
2149 var curnode = editor.getSelectedNode();
2151 if (curnode && curnode.tagName == 'IMG') {
2152 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2153 baseURL, record.data.id, record.data.filename
2155 // note -forces an update... hopefully...
2156 editor.owner.fireEvent('editorevent', editor, false);
2159 editor.insertAtCursor(
2160 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2161 baseURL, record.data.id, record.data.filename
2170 '|xns' : 'Roo.form',
2174 sortInfo : { direction : 'ASC', field: 'id' },
2176 beforeload : function (_self, o){
2177 o.params = o.params || {};
2179 var id = _this.form.findField('id').getValue() * 1;
2181 Roo.MessageBox.alert("Error", "Save press release first");
2185 o.params.ontable = 'cms_page';
2186 // o.params.imgtype = 'PressRelease';
2187 o.params['query[imagesize]'] = '150x150';
2192 '|xns' : 'Roo.data',
2194 xtype : 'HttpProxy',
2196 url : baseURL + '/Roo/Images.php',
2201 xtype : 'JsonReader',
2202 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2205 totalProperty : 'total',
2214 displayField : 'page_link',
2216 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2217 forceSelection : true,
2218 hiddenName : 'add_link_id',
2220 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2224 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2225 selectOnFocus : true,
2226 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2227 triggerAction : 'all',
2232 select : function (combo, record, index)
2238 var editor = _this.form.findField('body');
2239 editor.editorcore.insertAtCursor(
2240 String.format('<a href="#page-{0}">{1}</a>',
2241 record.data.page_link, record.data.title
2249 '|xns' : 'Roo.form',
2253 sortInfo : { field: 'page_link', direction: 'ASC' },
2255 beforeload : function (_self, options)
2257 options.params['search[page_link_no_empty]'] =1;
2259 options.params.is_element = 0;
2260 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2265 '|xns' : 'Roo.data',
2267 xtype : 'HttpProxy',
2269 url : baseURL + '/Roo/cms_page.php',
2274 xtype : 'JsonReader',
2276 { name: 'id', type: 'int' },
2282 totalProperty : 'total',
2289 xtype : 'Separator',
2291 '|xns' : 'Roo.Toolbar'
2295 cls : 'x-init-enable',
2296 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2298 click : function (_self, e)
2300 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2304 '|xns' : 'Roo.Toolbar'
2309 xtype : 'ToolbarContext',
2310 xns : Roo.form.HtmlEditor,
2311 '|xns' : 'Roo.form.HtmlEditor'
2322 xtype : 'ContentPanel',
2324 fitContainer : true,
2327 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2336 url : baseURL + '/Roo/cms_page.php',
2338 rendered : function (form)
2344 '|xns' : 'Roo.form',
2350 '|xns' : 'Roo.form',
2353 xtype : 'HtmlEditor',
2354 autosave : function() {
2356 var extended = _this.form2.findField('extended');
2358 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2359 Roo.log('extend not dirty');
2364 Roo.log('extend dirty, auto save!');
2366 extended.fireEvent('autosave', extended);
2368 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2372 white : [ 'iframe' ],
2375 autosave : function (_self)
2377 var id = _this.form.findField('id').getValue() * 1;
2380 if(!_self.editorcore.sourceEditMode){
2387 url : baseURL + '/Roo/Events.php',
2391 action : 'AUTOSAVE',
2392 on_id : (id > 0) ? id : 0,
2393 on_table : 'cms_page',
2394 remarks : 'EXTENDED',
2395 source: _self.getValue()
2397 success : function() {
2398 _self.originalValue = _self.getValue();
2401 failure : function()
2403 //Roo.MessageBox.alert("Error", "autosave failed");
2404 Roo.log('extended autosave failed?!');
2408 savedpreview : function (_self)
2410 var id = _this.form.findField('id').getValue() * 1;
2412 var successFn = function(res){
2413 return res.data.POST.source;
2417 action : 'AUTOSAVE',
2418 remarks : 'EXTENDED',
2419 on_id : (id < 1) ? 0 : id,
2420 on_table : 'cms_page',
2421 successFn : successFn
2425 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2426 _self.setValue(res);
2427 _self.originalValue = res;
2430 stylesheetsclick : function (_self)
2432 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2433 _this.dialog.setStylesheets();
2439 '|xns' : 'Roo.form',
2442 xtype : 'ToolbarStandard',
2443 xns : Roo.form.HtmlEditor,
2444 '|xns' : 'Roo.form.HtmlEditor',
2449 displayField : 'name',
2451 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2452 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2453 forceSelection : true,
2455 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2458 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2459 selectOnFocus : true,
2460 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"' + baseURL + '/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><br/><b>{filename}</b> </div>',
2461 triggerAction : 'all',
2466 beforequery : function (combo, query, forceAll, cancel, e)
2469 var id = _this.form.findField('id').getValue() * 1;
2471 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2475 render : function (_self)
2477 _this.extendimgselect = _self;
2479 select : function (combo, record, index)
2486 var editor = _this.form2.findField('extended').editorcore;
2488 var curnode = editor.getSelectedNode();
2490 if (curnode && curnode.tagName == 'IMG') {
2491 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2492 baseURL, record.data.id, record.data.filename
2494 // note -forces an update... hopefully...
2495 editor.owner.fireEvent('editorevent', editor, false);
2498 editor.insertAtCursor(
2499 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2500 baseURL, record.data.id, record.data.filename
2509 '|xns' : 'Roo.form',
2513 sortInfo : { direction : 'ASC', field: 'id' },
2515 beforeload : function (_self, o){
2516 o.params = o.params || {};
2518 var id = _this.form.findField('id').getValue() * 1;
2520 Roo.MessageBox.alert("Error", "Save press release first");
2524 o.params.ontable = 'cms_page';
2525 // o.params.imgtype = 'PressRelease';
2526 o.params['query[imagesize]'] = '150x150';
2531 '|xns' : 'Roo.data',
2533 xtype : 'HttpProxy',
2535 url : baseURL + '/Roo/Images.php',
2540 xtype : 'JsonReader',
2541 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2544 totalProperty : 'total',
2553 displayField : 'page_link',
2555 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2556 forceSelection : true,
2557 hiddenName : 'add_link_id',
2559 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2563 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2564 selectOnFocus : true,
2565 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2566 triggerAction : 'all',
2571 select : function (combo, record, index)
2577 var editor = _this.form.findField('body');
2578 editor.editorcore.insertAtCursor(
2579 String.format('<a href="#page-{0}">{1}</a>',
2580 record.data.page_link, record.data.title
2588 '|xns' : 'Roo.form',
2592 sortInfo : { field: 'page_link', direction: 'ASC' },
2594 beforeload : function (_self, options)
2596 options.params['search[page_link_no_empty]'] =1;
2598 options.params.is_element = 0;
2599 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2604 '|xns' : 'Roo.data',
2606 xtype : 'HttpProxy',
2608 url : baseURL + '/Roo/cms_page.php',
2613 xtype : 'JsonReader',
2615 { name: 'id', type: 'int' },
2621 totalProperty : 'total',
2628 xtype : 'Separator',
2630 '|xns' : 'Roo.Toolbar'
2634 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2636 click : function (_self, e)
2638 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2642 '|xns' : 'Roo.Toolbar'
2647 xtype : 'ToolbarContext',
2648 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2649 xns : Roo.form.HtmlEditor,
2650 '|xns' : 'Roo.form.HtmlEditor'
2661 xtype : 'ContentPanel',
2663 fitContainer : true,
2666 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2675 url : baseURL + '/Roo/cms_page.php',
2677 rendered : function (form)
2683 '|xns' : 'Roo.form',
2689 '|xns' : 'Roo.form',
2693 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2707 xtype : 'ContentPanel',
2709 fitContainer : true,
2712 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2721 url : baseURL + '/Roo/cms_page.php',
2723 rendered : function (form)
2729 '|xns' : 'Roo.form',
2734 '|xns' : 'Roo.form',
2738 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2747 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2749 name : 'descriptions',
2764 xtype : 'GridPanel',
2766 fitContainer : true,
2769 tableName : 'Images',
2770 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2772 activate : function() {
2775 _this.grid.footer.onClick('first');
2782 xtype : 'EditorGrid',
2783 autoExpandColumn : 'title',
2787 render : function() {
2789 //_this.dialog = Pman.Dialog.FILL_IN
2790 if (_this.panel.active) {
2791 //this.footer.onClick('first');
2794 rowdblclick : function (_self, rowIndex, e)
2796 var rd = _this.grid.getDataSource().getAt(rowIndex);
2797 var id = rd.data.id;
2798 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2799 _this.form.findField('contents').execCmd('insertimage', url);
2804 '|xns' : 'Roo.grid',
2812 cls : 'x-btn-text-icon',
2813 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2814 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2818 var id = _this.form.findField('id').getValue() * 1;
2824 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2825 _this.grid.ds.load({});
2835 cls : 'x-btn-text-icon',
2836 icon : rootURL + '/Pman/templates/images/trash.gif',
2837 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2841 var selection = _this.grid.getSelectionModel().getSelectedCell();
2842 var sn = _this.grid.ds.getAt(selection[0]);
2843 if (!sn || isNaN(sn.id *1)) {
2844 Roo.MessageBox.alert("Error", "Select a image");
2847 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2853 url : baseURL + '/Roo/Images.php',
2858 success : function()
2860 Roo.log('Got Success!!');
2861 _this.grid.ds.load({});
2875 beforeload : function (_self, o)
2877 var id = _this.form.findField('id').getValue() * 1;
2883 o.params = o.params || {};
2884 o.params.limit = 9999;
2886 o.params.ontable = 'cms_page';
2888 update : function (_self, rec, operation)
2892 url : baseURL+'/Roo/Images.php',
2895 success: function(res)
2897 Roo.log("GOT success");
2898 // update the data...
2899 _this.grid.ds.load({});
2901 failure : function(res)
2903 Roo.MessageBox.alert('Error', res.errorMsg);
2904 _this.grid.ds.load({});
2912 '|xns' : 'Roo.data',
2914 xtype : 'HttpProxy',
2916 url : baseURL + '/Roo/Images.php',
2921 xtype : 'JsonReader',
2956 'name': 'displayorder',
2964 'name': 'parent_image_id',
2970 'dateFormat': 'Y-m-d'
2989 'name': 'parent_image_id_id',
2993 'name': 'parent_image_id_filename',
2997 'name': 'parent_image_id_ontable',
3001 'name': 'parent_image_id_onid',
3005 'name': 'parent_image_id_mimetype',
3009 'name': 'parent_image_id_width',
3013 'name': 'parent_image_id_height',
3017 'name': 'parent_image_id_filesize',
3021 'name': 'parent_image_id_displayorder',
3025 'name': 'parent_image_id_language',
3029 'name': 'parent_image_id_parent_image_id',
3033 'name': 'parent_image_id_created',
3037 'name': 'parent_image_id_imgtype',
3041 'name': 'parent_image_id_linkurl',
3045 'name': 'parent_image_id_descript',
3049 'name': 'parent_image_id_title',
3055 totalProperty : 'total',
3062 xtype : 'ColumnModel',
3064 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3065 renderer : function(v,x,r) {
3066 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3074 xtype : 'ColumnModel',
3075 dataIndex : 'filename',
3076 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3077 renderer : function(v) { return String.format('{0}', v); },
3083 xtype : 'ColumnModel',
3084 dataIndex : 'displayorder',
3085 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3086 renderer : function(v) { return String.format('{0}', v); },
3089 '|xns' : 'Roo.grid',
3091 xtype : 'GridEditor',
3093 '|xns' : 'Roo.grid',
3095 xtype : 'NumberField',
3096 decimalPrecision : 0,
3098 focus : function (_self)
3100 if (this.value == 0) {
3101 this.el.dom.value = '';
3111 xtype : 'ColumnModel',
3112 dataIndex : 'title',
3113 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3114 renderer : function(v) { return String.format('{0}', v); },
3117 '|xns' : 'Roo.grid',
3119 xtype : 'GridEditor',
3121 '|xns' : 'Roo.grid',
3123 xtype : 'TextField',
3130 xtype : 'ColumnModel',
3131 dataIndex : 'linkurl',
3132 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3133 renderer : function(v)
3135 return String.format('{0}', (v) ? v : '');
3139 '|xns' : 'Roo.grid',
3141 xtype : 'GridEditor',
3143 '|xns' : 'Roo.grid',
3145 xtype : 'TextField',
3155 xtype : 'NestedLayoutPanel',
3157 fitContainer : true,
3161 render : function (_self)
3163 _this.westLayoutPanel = this;
3170 xtype : 'BorderLayout',
3174 xtype : 'LayoutRegion',
3175 tabPosition : 'top',
3180 xtype : 'LayoutRegion',
3183 tabPosition : 'top',
3189 xtype : 'ContentPanel',
3194 render : function (_self)
3196 _this.trpanel = _self;
3198 resize : function (_self, width, height)
3200 Roo.log('resize called');
3202 var ew = Math.max(250, width - 10);
3203 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3206 if (!_this.trform) {
3210 var bd = _this.trform1.findField('body');
3215 // since render delays resize..
3216 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3217 // _this.trbodycol.el.setWidth(bd.width+20);
3219 var bd = _this.trform2.findField('extended');
3223 // since render delays resize..
3224 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3225 // _this.trextendcol.el.setWidth(bd.width+20);
3235 labelAlign : 'right',
3238 showHide : function() {
3240 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3241 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3242 var has_lang = _this.trform.findField('language').getValue().length;
3244 _this.westLayoutPanel.getLayout().getRegion('south').show();
3245 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3246 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3247 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3250 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3253 if(!has_extended && has_lang){
3254 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3255 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3263 var el = _this.trform.findField(k);
3264 el.actionMode = 'fieldEl';
3266 Roo.log("show: " + k);
3269 Roo.log("hide: " + k);
3274 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3277 if(typeof(_this.trform.editors) == 'undefined'){
3278 _this.trform.editors = {
3279 body : _this.trform1.findField('body').wrap.isVisible(),
3280 extended : _this.trform2.findField('extended').wrap.isVisible()
3282 if(_this.trform.editors.body){
3283 setInterval(_this.trform1.findField('body').autosave, 60000);
3286 if(_this.trform.editors.extended){
3287 setInterval(_this.trform2.findField('extended').autosave, 60000);
3291 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3292 setInterval(_this.trform1.findField('body').autosave, 60000);
3293 _this.trform.editors.body = true;
3296 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3297 setInterval(_this.trform2.findField('extended').autosave, 60000);
3298 _this.trform.editors.extended = true;
3303 style : 'margin: 5px',
3304 trackResetOnLoad : true,
3305 url : baseURL + '/Roo/cms_page.php',
3307 actioncomplete : function (_self, action)
3309 if (action.type =='submit') {
3313 if (action.type == 'setdata') {
3314 _this.trform.addForm(_this.trform1);
3315 _this.trform.addForm(_this.trform2);
3316 _this.trform.addForm(_this.trform3);
3318 if ( _this.data.id) {
3320 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3322 this.trpanel.el.mask("save first");
3329 if (action.type == 'load') {
3330 // _this.dialog.el.unmask();
3333 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3334 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3335 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3336 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3341 actionfailed : function (_self, action)
3343 _this.dialog.el.unmask();
3345 Pman.standardActionFailed(_self, action);
3347 rendered : function (_self)
3349 _this.trform = _self;
3353 '|xns' : 'Roo.form',
3360 '|xns' : 'Roo.form',
3367 '|xns' : 'Roo.form',
3372 displayField : 'language_name',
3374 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3375 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3376 forceSelection : true,
3377 hiddenName : 'language',
3379 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3381 name : 'language_name',
3383 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3384 selectOnFocus : true,
3385 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3386 triggerAction : 'all',
3388 valueField : 'language',
3390 add : function (combo)
3392 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3395 _this.trform.reset();
3396 _this.trform1.reset();
3397 _this.trform2.reset();
3399 combo.setValue(res.lang);
3400 combo.el.dom.value = res.lang_name;
3403 _this.trform.showHide();
3404 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3409 render : function (_self)
3411 _this.language = _self;
3413 select : function (combo, record, index)
3416 _this.trform.showHide();
3417 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3424 'lookup[language]' : record.data.language,
3425 'lookup[translation_of_id]' : _this.data.id,
3432 '|xns' : 'Roo.form',
3436 sortInfo : { direction : 'ASC', field: 'language' },
3438 beforeload : function (_self, o){
3439 o.params = o.params || {};
3441 o.params._distinct = 'language';
3442 o.params._columns ='language_name,language';
3443 o.params._with_name = true;
3445 if(_this.form.findField('id').getValue()*1 > 0){
3446 o.params.translation_of_id = _this.form.findField('id').getValue();
3452 '|xns' : 'Roo.data',
3454 xtype : 'HttpProxy',
3456 url : baseURL + '/Roo/Cms_page.php',
3461 xtype : 'JsonReader',
3462 fields : [{"name":"language","type":"string"}],
3465 totalProperty : 'total',
3473 style : 'padding-top:12px;padding-left:30px;float:left',
3476 render : function (_self)
3478 _this.updateRow = _self;
3482 '|xns' : 'Roo.form',
3486 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3490 // _this.dialog.el.mask("Saving");
3491 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3492 _this.trform1.findField('body').syncValue();
3493 _this.trform2.findField('extended').syncValue();
3495 _this.trform1.findField('body').pushValue();
3496 _this.trform2.findField('extended').pushValue();
3499 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3500 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3501 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3502 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3503 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3505 if(_this.trform.findField('element_id').getValue()*1 > 0){
3506 _this.trform.findField('is_element').setValue(1);
3509 _this.trform.doAction("submit");
3520 xtype : 'TextField',
3521 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3537 name : 'element_id',
3543 name : 'menu_page_id',
3549 name : 'is_menuitem',
3555 name : 'is_element',
3562 name : 'translation_of_id',
3577 xtype : 'ContentPanel',
3579 fitContainer : true,
3582 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3591 url : baseURL + '/Roo/cms_page.php',
3593 rendered : function (form)
3595 _this.trform1 = form;
3599 '|xns' : 'Roo.form',
3605 '|xns' : 'Roo.form',
3608 xtype : 'HtmlEditor',
3609 autosave : function() {
3611 var body = _this.trform1.findField('body');
3613 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3614 Roo.log('tr body not dirty');
3618 Roo.log('tr body dirty, auto save!');
3620 body.fireEvent('autosave', body);
3622 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3626 white : [ 'iframe' ],
3628 autosave : function (_self)
3630 var id = _this.trform.findField('id').getValue() * 1;
3633 if(!_self.editorcore.sourceEditMode){
3640 url : baseURL + '/Roo/Events.php',
3644 action : 'AUTOSAVE',
3645 on_id : (id > 0) ? id : 0,
3646 on_table : 'cms_page',
3648 source: _self.getValue()
3650 success : function() {
3651 _self.originalValue = _self.getValue();
3654 failure : function()
3656 //Roo.MessageBox.alert("Error", "autosave failed");
3657 Roo.log('tr body autosave failed?!');
3661 savedpreview : function (_self)
3663 var id = _this.trform.findField('id').getValue() * 1;
3665 var successFn = function(res){
3666 return res.data.POST.source;
3670 action : 'AUTOSAVE',
3672 on_id : (id < 1) ? 0 : id,
3673 on_table : 'cms_page',
3674 successFn : successFn
3678 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3679 _self.setValue(res);
3680 _self.originalValue = res;
3683 stylesheetsclick : function (_self)
3685 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3686 _this.dialog.setStylesheets();
3692 '|xns' : 'Roo.form',
3695 xtype : 'ToolbarStandard',
3696 xns : Roo.form.HtmlEditor,
3697 '|xns' : 'Roo.form.HtmlEditor',
3702 displayField : 'name',
3704 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3705 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3706 forceSelection : true,
3708 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3711 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3712 selectOnFocus : true,
3713 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>',
3714 triggerAction : 'all',
3719 beforequery : function (combo, query, forceAll, cancel, e)
3722 var id = _this.form.findField('id').getValue() * 1;
3724 Roo.MessageBox.alert("Error", "Save press release first");
3728 render : function (_self)
3730 _this.trbodyimgselect = _self;
3732 select : function (combo, record, index)
3739 var editor = _this.trform.findField('body').editorcore;
3741 var curnode = editor.getSelectedNode();
3743 if (curnode && curnode.tagName == 'IMG') {
3744 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3745 baseURL, record.data.id, record.data.filename
3747 // note -forces an update... hopefully...
3748 editor.owner.fireEvent('editorevent', editor, false);
3751 editor.insertAtCursor(
3752 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3753 baseURL, record.data.id, record.data.filename
3762 '|xns' : 'Roo.form',
3766 sortInfo : { direction : 'ASC', field: 'id' },
3768 beforeload : function (_self, o){
3769 o.params = o.params || {};
3771 var id = _this.form.findField('id').getValue() * 1;
3773 Roo.MessageBox.alert("Error", "Save press release first");
3777 o.params.ontable = 'cms_page';
3778 // o.params.imgtype = 'PressRelease';
3779 //o.params['query[imagesize]'] = '150x150';
3784 '|xns' : 'Roo.data',
3786 xtype : 'HttpProxy',
3788 url : baseURL + '/Roo/Images.php',
3793 xtype : 'JsonReader',
3794 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3797 totalProperty : 'total',
3806 displayField : 'page_link',
3808 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3809 forceSelection : true,
3810 hiddenName : 'add_link_id',
3812 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3816 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3817 selectOnFocus : true,
3818 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3819 triggerAction : 'all',
3824 select : function (combo, record, index)
3830 var editor = _this.form.findField('body');
3831 editor.insertAtCursor(
3832 String.format('<a href="#page-{0}">{1}</a>',
3833 record.data.page_link, record.data.title
3841 '|xns' : 'Roo.form',
3845 sortInfo : { field: 'page_link', direction: 'ASC' },
3847 beforeload : function (_self, options)
3849 options.params['search[page_link_no_empty]'] =1;
3851 options.params.is_element = 0;
3852 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3857 '|xns' : 'Roo.data',
3859 xtype : 'HttpProxy',
3861 url : baseURL + '/Roo/cms_page.php',
3866 xtype : 'JsonReader',
3868 { name: 'id', type: 'int' },
3874 totalProperty : 'total',
3881 xtype : 'Separator',
3883 '|xns' : 'Roo.Toolbar'
3887 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3889 click : function (_self, e)
3891 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3895 '|xns' : 'Roo.Toolbar'
3900 xtype : 'ToolbarContext',
3901 xns : Roo.form.HtmlEditor,
3902 '|xns' : 'Roo.form.HtmlEditor'
3913 xtype : 'ContentPanel',
3915 fitContainer : true,
3918 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3927 url : baseURL + '/Roo/cms_page.php',
3929 rendered : function (form)
3931 _this.trform2 = form;
3935 '|xns' : 'Roo.form',
3941 '|xns' : 'Roo.form',
3944 xtype : 'HtmlEditor',
3945 autosave : function() {
3947 var extended = _this.trform2.findField('extended');
3949 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3950 Roo.log('tr extend not dirty');
3955 Roo.log('tr extend dirty, auto save!');
3957 extended.fireEvent('autosave', extended);
3961 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3965 white : [ 'iframe' ],
3967 autosave : function (_self)
3969 var id = _this.trform.findField('id').getValue() * 1;
3972 if(!_self.editorcore.sourceEditMode){
3980 url : baseURL + '/Roo/Events.php',
3984 action : 'AUTOSAVE',
3985 on_id : (id > 0) ? id : 0,
3986 on_table : 'cms_page',
3987 remarks : 'EXTENDED',
3988 source: _self.getValue()
3990 success : function() {
3991 _self.originalValue = _self.getValue();
3994 failure : function()
3996 //Roo.MessageBox.alert("Error", "autosave failed");
3997 Roo.log('tr extended autosave failed?!');
4001 savedpreview : function (_self)
4003 var id = _this.trform.findField('id').getValue() * 1;
4005 var successFn = function(res){
4006 return res.data.POST.source;
4010 action : 'AUTOSAVE',
4011 remarks : 'EXTENDED',
4012 on_id : (id < 1) ? 0 : id,
4013 on_table : 'cms_page',
4014 successFn : successFn
4018 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4019 _self.setValue(res);
4020 _self.originalValue = res;
4023 stylesheetsclick : function (_self)
4025 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4026 _this.dialog.setStylesheets();
4032 '|xns' : 'Roo.form',
4035 xtype : 'ToolbarStandard',
4036 xns : Roo.form.HtmlEditor,
4037 '|xns' : 'Roo.form.HtmlEditor',
4040 xtype : 'Separator',
4042 '|xns' : 'Roo.Toolbar'
4046 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4048 click : function (_self, e)
4050 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4054 '|xns' : 'Roo.Toolbar'
4059 xtype : 'ToolbarContext',
4060 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4061 xns : Roo.form.HtmlEditor,
4062 '|xns' : 'Roo.form.HtmlEditor'
4073 xtype : 'ContentPanel',
4075 fitContainer : true,
4078 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4087 url : baseURL + '/Roo/cms_page.php',
4089 rendered : function (form)
4091 _this.trform3 = form;
4095 '|xns' : 'Roo.form',
4100 '|xns' : 'Roo.form',
4104 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4113 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4115 name : 'descriptions',