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();
357 expanded : function (_self)
359 var id = _this.form.findField('id').getValue() * 1;
362 Roo.MessageBox.alert('Error', 'Save first');
367 var w = Roo.lib.Dom.getViewWidth();
368 var h = Roo.lib.Dom.getViewHeight();
370 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
372 _this.panel.region.collapse();
382 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
386 var page_link = _this.form.findField('page_link').getValue();
388 if(!page_link.length){
389 Roo.MessageBox.alert('Error', 'Please fill in the page link');
393 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
394 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
398 var url = uiConfig.cms_page_preview_base + page_link;
408 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
413 _this.trform.isDirty() ||
414 _this.trform1.isDirty() ||
415 _this.trform2.isDirty() ||
416 _this.trform3.isDirty()
418 Roo.MessageBox.confirm(
420 "Do you want to save the translation",
444 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
449 if(!_this.form1.findField('body').editorcore.sourceEditMode){
450 _this.form1.findField('body').syncValue();
451 _this.form2.findField('extended').syncValue();
452 Roo.log('syncValue');
454 _this.form1.findField('body').pushValue();
455 _this.form2.findField('extended').pushValue();
456 Roo.log('pushValue');
459 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
460 _this.interests.reset();
464 _this.trform.isDirty() ||
465 _this.trform1.isDirty() ||
466 _this.trform2.isDirty() ||
467 _this.trform3.isDirty()
469 Roo.MessageBox.confirm(
471 "Do you want to save the translation",
474 _this.dialog.el.mask("Saving");
475 _this.form.doAction("submit");
485 _this.dialog.el.mask("Saving");
486 _this.form.doAction("submit");
495 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
501 if(!_this.form1.findField('body').editorcore.sourceEditMode){
502 _this.form1.findField('body').syncValue();
503 _this.form2.findField('extended').syncValue();
505 _this.form1.findField('body').pushValue();
506 _this.form2.findField('extended').pushValue();
509 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
510 _this.interests.reset();
515 _this.trform.isDirty() ||
516 _this.trform1.isDirty() ||
517 _this.trform2.isDirty() ||
518 _this.trform3.isDirty()
520 Roo.MessageBox.confirm(
522 "Do you want to save the translation",
525 _this.dialog.el.mask("Saving");
526 _this.form.doAction("submit");
536 _this.dialog.el.mask("Saving");
537 _this.form.doAction("submit");
547 xtype : 'NestedLayoutPanel',
553 render : function (_self)
555 _this.centerLayoutPanel = this;
562 xtype : 'BorderLayout',
566 xtype : 'LayoutRegion',
572 xtype : 'LayoutRegion',
581 xtype : 'ContentPanel',
586 render : function (_self)
588 _this.cpanel = _self;
590 resize : function (_self, width, height)
592 Roo.log("RESIZE, " + width + ',' + height);
594 var ew = Math.max(250, width - 10);
595 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
602 bd = _this.form1.findField('body');
606 // since render delays resize..
607 Roo.log('resizing body to ' + bd.width);
608 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
609 // _this.bodycol.el.setWidth(bd.width+20);
614 bd = _this.form2.findField('extended');
620 Roo.log('resizing extended to ' + bd.width);
621 // since render delays resize..
622 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
623 // _this.extendcol.el.setWidth(bd.width+20);
628 bd = _this.form3.findField('extra_css');
632 // _this.keywordscol.el.setWidth(ew+20);
634 // fix for messed up rendering of dialog?
638 _this.dialog.layout.el.dom.scrollTop = 0;
640 // noop... - the above sometimes fails...
653 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
655 click : function (_self, e)
657 if (_this.dialog.getLayout().getRegion('west').collapsed) {
658 _this.dialog.getLayout().getRegion('west').expand();
660 _this.dialog.getLayout().getRegion('west').collapse();
666 '|xns' : 'Roo.Toolbar'
671 '|xns' : 'Roo.Toolbar'
675 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
677 click : function (_self, e)
679 if (_this.panel.region.collapsed) {
680 _this.panel.region.expand();
682 _this.panel.region.collapse();
688 '|xns' : 'Roo.Toolbar'
697 _this.form.setValues(_this.data);
701 _this.dialog.el.unmask();
702 _this.grid.getDataSource().load();
704 _this.trform.reset();
705 _this.trform1.reset();
706 _this.trform2.reset();
708 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
709 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
712 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
713 catlabel.dom.innerHTML = 'Category';
715 if(_this.data.page_type_id_name == 'category'){
716 catlabel.dom.innerHTML = 'Parent Category';
720 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
721 catlabel.dom.innerHTML = 'Parent page';
722 if(_this.data.page_type_id_name == 'category'){
723 catlabel.dom.innerHTML = 'Parent';
726 // better if this was not here... - not sure which project uses it?
728 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
729 _this.interestsCol.show();
732 if(typeof(d['interests']) != 'undefined'){
733 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
736 if(typeof(d['categories']) != 'undefined'){
737 _this.form.findField('category').setValue(Roo.decode(d['categories']));
740 if(typeof(d['page_classes']) != 'undefined'){
741 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
744 _this.trpanel.el.unmask();
745 _this.panel.el.unmask();
748 _this.cpanel.el.dom.scrollTop = 0;
750 // fix messed up scroll.
751 _this.dialog.layout.el.dom.scrollTop = 0;
754 labelAlign : 'right',
757 showHide : function()
764 var page_type_name = _this.form.findField('page_type_id_name').getValue();
766 switch(page_type_name){
789 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
790 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
791 var has_extended = _this.form.findField('has_extended').getValue() * 1;
794 is_attachment : !in_rss,
796 category_type_id : in_rss && !is_menu,
797 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
798 target_url : is_menu,
800 category : !is_category,
802 parent_id : !in_rss || is_category ,
805 to_replace_id :false, // !in_rss, // is this used.
806 is_draft : !is_system_page,
807 author_id : in_rss && !is_menu && !is_attachment,
809 template_id : !is_attachment && !is_menu && !is_system_page,
810 element_id : is_element && !is_menu,
811 menu_page_id : is_menu,
812 page_cls : is_element
814 // has_extended : !is_menu && !is_attachment, // always shown.
815 // extended : has_extended && !is_menu && !is_attachment,
816 // body : !is_attachment && !is_menu,
817 //keywords : !is_attachment && !is_menu,
818 // descriptions : !is_attachment && !is_menu
819 // extra_css : !is_attachment && !is_menu
823 var el = _this.form.findField(k);
826 Roo.log("missing field " + k);
830 el.actionMode = 'fieldEl';
840 _this.centerLayoutPanel.getLayout().getRegion('south').show();
841 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
842 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
843 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
844 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
846 if(is_attachment || is_menu){
848 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
852 if(!has_extended && !is_attachment && !is_menu){
853 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
854 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
858 _this.trform.showHide();
860 if(typeof(_this.form.editors) == 'undefined'){
861 _this.form.editors = {
862 body : _this.form1.findField('body').wrap.isVisible(),
863 extended : _this.form2.findField('extended').wrap.isVisible()
866 if(_this.form.editors.body){
867 setInterval(_this.form1.findField('body').autosave, 60000);
870 if(_this.form.editors.extended){
871 setInterval(_this.form2.findField('extended').autosave, 60000);
875 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
876 setInterval(_this.form1.findField('body').autosave, 60000);
877 _this.form.editors.body = true;
880 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
881 setInterval(_this.form2.findField('extended').autosave, 60000);
882 _this.form.editors.extended = true;
888 style : 'margin: 5px',
889 url : baseURL + '/Roo/cms_page.php',
891 actioncomplete : function (_self, action)
894 if (action.type == 'setdata') {
896 _this.form.addForm(_this.form1);
897 _this.form.addForm(_this.form2);
898 _this.form.addForm(_this.form3);
899 _this.form.addForm(_this.form4);
901 _this.dialog.setStylesheets();
903 _this.dialog.getLayout().getRegion('west').collapse();
904 _this.panel.region.collapse();
906 _this.trpanel.el.mask('Save first');
907 _this.panel.el.mask('Save first');
909 _this.loaded = false;
910 _this.interestsCol.hide();
912 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
914 if ( _this.data.id) {
915 _this.dialog.el.mask("Loading");
916 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
920 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
921 this.findField('is_draft').setValue(is_draft);
922 _this.page_type.setValue(_this.data.page_type_id);
923 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
925 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
926 _this.interestsCol.show();
929 _this.form.showHide();
932 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
933 catlabel.dom.innerHTML = 'Category';
934 if(_this.data.page_type_id_name == 'category'){
935 catlabel.dom.innerHTML = 'Parent Category';
940 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
941 catlabel.dom.innerHTML = 'Parent page';
942 if(_this.data.page_type_id_name == 'category'){
943 catlabel.dom.innerHTML = 'Parent';
949 if(_this.data._is_copy){
950 _this.form.is_copy();
956 if (action.type == 'load') {
958 //_this.data = action.result.data;
960 var d = action.result.data;
962 _this.dialog.el.unmask();
963 _this.grid.getDataSource().load();
965 _this.trform.reset();
966 _this.trform1.reset();
967 _this.trform2.reset();
968 _this.trform3.reset();
970 _this.trform.addForm(_this.trform1);
971 _this.trform.addForm(_this.trform2);
973 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
974 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
975 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
976 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
977 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
980 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
981 catlabel.dom.innerHTML = 'Category';
983 if(_this.data.page_type_id_name == 'category'){
984 catlabel.dom.innerHTML = 'Parent Category';
988 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
989 catlabel.dom.innerHTML = 'Parent page';
990 if(_this.data.page_type_id_name == 'category'){
991 catlabel.dom.innerHTML = 'Parent';
994 // better if this was not here... - not sure which project uses it?
996 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
997 _this.interestsCol.show();
1000 if(typeof(d['interests']) != 'undefined'){
1001 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1004 if(typeof(d['categories']) != 'undefined'){
1005 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1008 if(typeof(d['page_classes']) != 'undefined'){
1009 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1012 _this.trpanel.el.unmask();
1013 _this.panel.el.unmask();
1016 _this.cpanel.el.dom.scrollTop = 0;
1018 // fix messed up scroll.
1019 _this.dialog.layout.el.dom.scrollTop = 0;
1023 if (action.type =='submit') {
1025 _this.dialog.el.unmask();
1028 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1032 _this.dialog.hide();
1035 if (_this.callback) {
1036 _this.callback.call(_this, action.result.data);
1042 actionfailed : function (_self, action)
1044 _this.dialog.el.unmask();
1045 Pman.standardActionFailed(_self, action);
1047 rendered : function (_self)
1053 '|xns' : 'Roo.form',
1060 '|xns' : 'Roo.form',
1065 labelAlign : 'right',
1067 style : 'height:30px;overflow:hidden',
1070 '|xns' : 'Roo.form',
1074 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1083 style : 'height:30px;overflow:hidden',
1086 '|xns' : 'Roo.form',
1091 displayField : 'display_name',
1093 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1094 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1095 forceSelection : true,
1096 hiddenName : 'page_type_id',
1098 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1100 name : 'page_type_id_display_name',
1102 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1103 selectOnFocus : true,
1104 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1105 triggerAction : 'all',
1109 render : function (_self)
1111 _this.page_type = _self;
1113 select : function (combo, record, index)
1115 // _this.grid.footer.onClick('first');
1116 var page_type_name = record.data.name;
1117 _this.form.findField('page_type_id_name').setValue(page_type_name);
1118 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1119 _this.form.findField('is_attachment').setValue(0);
1123 _this.form.showHide.defer(100, _this.form);
1129 '|xns' : 'Roo.form',
1133 sortInfo : { direction : 'ASC', field: 'seqid' },
1135 beforeload : function (_self, o){
1136 o.params = o.params || {};
1138 o.params.etype = 'cms_page_type';
1142 '|xns' : 'Roo.data',
1144 xtype : 'HttpProxy',
1146 url : baseURL + '/Roo/core_enum.php',
1151 xtype : 'JsonReader',
1152 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1155 totalProperty : 'total',
1164 style : 'padding-left: -70px;',
1167 '|xns' : 'Roo.form',
1170 xtype : 'NumberField',
1171 decimalPrecision : 0,
1172 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1187 labelAlign : 'right',
1189 style : 'height:30px;overflow:hidden',
1192 '|xns' : 'Roo.form',
1196 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1205 style : 'height:30px;overflow:hidden',
1208 '|xns' : 'Roo.form',
1212 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1213 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1221 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1223 name : 'has_extended',
1226 check : function (_self, checked)
1231 _this.form.showHide();
1232 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1243 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1245 name : 'is_attachment',
1248 check : function (_self, checked)
1252 _this.form.showHide.defer(100, _this.form);
1266 displayField : 'name',
1268 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1269 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1270 forceSelection : true,
1271 hiddenName : 'author_id',
1273 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1275 name : 'author_id_name',
1277 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1278 queryParam : 'query[name]',
1279 selectOnFocus : true,
1280 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1281 triggerAction : 'all',
1286 '|xns' : 'Roo.form',
1290 sortInfo : { direction : 'ASC', field: 'name' },
1292 beforeload : function (_self, o){
1293 o.params = o.params || {};
1295 o.params.active = 1;
1296 o.params['query[is_owner]'] = 1;
1300 '|xns' : 'Roo.data',
1302 xtype : 'HttpProxy',
1304 url : baseURL + '/Roo/core_person',
1309 xtype : 'JsonReader',
1310 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1313 totalProperty : 'total',
1320 xtype : 'ComboBoxArray',
1321 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1322 hiddenName : 'category',
1323 name : 'category_name',
1326 '|xns' : 'Roo.form',
1331 displayField : 'display_fullpath',
1333 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1334 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1335 forceSelection : true,
1339 queryParam : 'search[name]',
1340 selectOnFocus : true,
1341 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1342 triggerAction : 'all',
1346 '|xns' : 'Roo.form',
1350 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1352 beforeload : function (_self, o){
1353 o.params = o.params || {};
1355 o.params.page_type_id_name= 'CATEGORY';
1357 o.params._with_fullpath = 1;
1361 '|xns' : 'Roo.data',
1363 xtype : 'HttpProxy',
1365 url : baseURL + '/Roo/cms_page.php',
1370 xtype : 'JsonReader',
1372 {"name":"id","type":"int"},
1373 {"name":"name","type":"string"},
1374 {"name":"display_name","type":"string"}
1378 totalProperty : 'total',
1389 displayField : 'page_link',
1391 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1392 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1393 forceSelection : true,
1394 hiddenName : 'parent_id',
1396 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1398 name : 'parent_id_title',
1400 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1401 selectOnFocus : true,
1402 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1403 triggerAction : 'all',
1408 select : function (combo, record, index)
1410 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1411 if (page_type_name == 'page') { // page
1414 // do not default to put 'Home' at the beginning.
1415 if (!record || !(record.data.parent_id *1)) {
1418 var pl = _this.form.findField('page_link');
1419 var lk = pl.getValue();
1420 var new_link = record.data.page_link + '/';
1422 new_link += lk.split('/').pop();
1424 pl.setValue(new_link);
1429 '|xns' : 'Roo.form',
1433 sortInfo : { field: 'page_link', direction: 'ASC' },
1435 beforeload : function (_self, options)
1437 options.params['search[page_link_no_empty]'] =1;
1439 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1440 options.params._page_type = 'page,element';
1442 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1445 var id = _this.form.findField('id').getValue() * 1;
1448 options.params['!id'] = id;
1453 options.params.is_element = 0;
1454 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1455 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1460 '|xns' : 'Roo.data',
1462 xtype : 'HttpProxy',
1464 url : baseURL + '/Roo/cms_page.php',
1469 xtype : 'JsonReader',
1471 { name: 'id', type: 'int' },
1477 totalProperty : 'total',
1487 '|xns' : 'Roo.form',
1490 xtype : 'DateField',
1491 altFormats : 'Y-m-d H:i:s',
1492 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1500 xtype : 'TextField',
1501 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1502 name : 'to_replace_id',
1510 xtype : 'TextField',
1511 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1515 keyup : function (_self, e)
1517 if (_this.page_type.getRawValue() == 'Category') {
1519 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1528 xtype : 'TextField',
1529 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1536 xtype : 'TextField',
1537 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1538 name : 'target_url',
1547 displayField : 'template_clean',
1549 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1550 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1551 forceSelection : true,
1552 hiddenName : 'template_id',
1554 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1556 name : 'template_id_template_clean',
1558 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1559 selectOnFocus : true,
1560 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1561 triggerAction : 'all',
1566 '|xns' : 'Roo.form',
1570 sortInfo : { field: 'template', direction: 'ASC' },
1572 beforeload : function (_self, options)
1575 options.params._rescan = 1;
1576 options.params._clean_name = 1;
1577 // options.params.lang = 'en';
1578 options.params['!template[0]'] = 'master.html';
1579 //options.params['!template[1]'] = 'index.html';
1583 '|xns' : 'Roo.data',
1585 xtype : 'HttpProxy',
1587 url : baseURL + '/Roo/Cms_template',
1592 xtype : 'JsonReader',
1594 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1598 totalProperty : 'total',
1608 displayField : 'name',
1610 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1611 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1612 forceSelection : true,
1613 hiddenName : 'element_id',
1615 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1617 name : 'element_id_name',
1619 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1620 selectOnFocus : true,
1621 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1622 triggerAction : 'all',
1627 '|xns' : 'Roo.form',
1631 sortInfo : { field: 'name', direction: 'ASC' },
1633 beforeload : function (_self, options)
1635 var par = _this.form.findField('parent_id').getValue() * 1;
1637 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1641 options.params._cms_page_id = par;
1645 '|xns' : 'Roo.data',
1647 xtype : 'HttpProxy',
1649 url : baseURL + '/Roo/Cms_template_element',
1654 xtype : 'JsonReader',
1656 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1660 totalProperty : 'total',
1670 displayField : 'page_link',
1672 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1673 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1674 forceSelection : true,
1675 hiddenName : 'menu_page_id',
1677 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1679 name : 'menu_page_id_page_link',
1681 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1682 selectOnFocus : true,
1683 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>',
1684 triggerAction : 'all',
1689 '|xns' : 'Roo.form',
1693 sortInfo : { field: 'title', direction: 'ASC' },
1695 beforeload : function (_self, options)
1697 options.params = options.params || {};
1699 options.params['search[page_link_no_empty]'] =1;
1701 options.params['page_type_id_name[0]'] = 'page';
1702 options.params['page_type_id_name[1]'] = 'blog';
1704 options.params.is_element = 0;
1705 options.params.is_menuitem = 0;
1710 '|xns' : 'Roo.data',
1712 xtype : 'HttpProxy',
1714 url : baseURL + '/Roo/cms_page.php',
1719 xtype : 'JsonReader',
1734 "name":"page_type_id_display_name",
1740 totalProperty : 'total',
1747 xtype : 'ComboBoxArray',
1748 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1749 hiddenName : 'page_cls',
1750 name : 'page_cls_name',
1753 '|xns' : 'Roo.form',
1758 displayField : 'display_name',
1760 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1761 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1762 forceSelection : true,
1765 queryParam : 'query[search]',
1766 selectOnFocus : true,
1767 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1768 triggerAction : 'all',
1769 valueField : 'name',
1772 '|xns' : 'Roo.form',
1776 sortInfo : { direction : 'ASC', field: 'seqid' },
1778 beforeload : function (_self, o){
1779 o.params = o.params || {};
1781 o.params.etype = 'cms_page_class';
1785 '|xns' : 'Roo.data',
1787 xtype : 'HttpProxy',
1789 url : baseURL + '/Roo/core_enum.php',
1794 xtype : 'JsonReader',
1796 {"name":"id","type":"int"},
1797 {"name":"name","type":"string"},
1798 {"name":"display_name","type":"string"}
1802 totalProperty : 'total',
1816 '|xns' : 'Roo.form',
1822 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1823 style : 'width: 165px;',
1825 '|xns' : 'Roo.form',
1828 xtype : 'DisplayField',
1830 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1831 name : 'primary_image_id',
1832 style : 'border: 1px solid #ccc;',
1833 valueRenderer : function(v) {
1835 if (!v || v * 1 < 1) {
1836 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1839 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1852 render : function (_self)
1854 _this.interestsCol = _self;
1858 '|xns' : 'Roo.form',
1861 xtype : 'ComboBoxArray',
1862 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1863 hiddenName : 'interest',
1864 name : 'interest_name',
1867 render : function (_self)
1869 _this.interests = _self;
1871 _self.combo.addicon.setStyle( {
1872 position : 'absolute',
1881 '|xns' : 'Roo.form',
1886 displayField : 'display_name',
1888 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1889 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1890 forceSelection : true,
1893 queryParam : 'query[name]',
1894 selectOnFocus : true,
1895 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1896 triggerAction : 'all',
1900 '|xns' : 'Roo.form',
1904 sortInfo : { direction : 'ASC', field: 'name' },
1906 beforeload : function (_self, o){
1907 o.params = o.params || {};
1908 o.params.etype = 'crm_interest';
1912 '|xns' : 'Roo.data',
1914 xtype : 'HttpProxy',
1916 url : baseURL + '/Roo/Core_enum.php',
1921 xtype : 'JsonReader',
1923 {"name":"id","type":"int"},
1924 {"name":"name","type":"string"},
1925 {"name":"display_name","type":"string"}
1929 totalProperty : 'total',
1946 name : 'is_system_page',
1952 name : 'is_menuitem',
1958 name : 'page_type_id_name',
1965 render : function (_self)
1967 _this.user_defined_fields = _self;
1978 xtype : 'ContentPanel',
1980 fitContainer : true,
1983 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1992 url : baseURL + '/Roo/cms_page.php',
1994 rendered : function (form)
2000 '|xns' : 'Roo.form',
2006 '|xns' : 'Roo.form',
2009 xtype : 'HtmlEditor',
2010 autosave : function() {
2012 var body = _this.form1.findField('body');
2014 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2015 Roo.log('body not dirty');
2019 Roo.log('body dirty, auto save!');
2021 body.fireEvent('autosave', body);
2025 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2029 white : [ 'iframe' ],
2032 autosave : function (_self)
2034 Roo.log('autosave');
2036 var id = _this.form.findField('id').getValue() * 1;
2038 if(!_self.editorcore.sourceEditMode){
2045 url : baseURL + '/Roo/Events.php',
2049 action : 'AUTOSAVE',
2050 on_id : (id > 0) ? id : 0,
2051 on_table : 'cms_page',
2053 source: _self.getValue()
2055 success : function() {
2056 _self.originalValue = _self.getValue();
2059 failure : function()
2061 //Roo.MessageBox.alert("Error", "autosave failed");
2062 Roo.log('body autosave failed?!');
2067 savedpreview : function (_self)
2069 Roo.log('saved preview');
2071 var id = _this.form.findField('id').getValue() * 1;
2073 var successFn = function(res){
2074 return res.data.POST.source;
2078 action : 'AUTOSAVE',
2080 on_id : (id < 1) ? 0 : id,
2081 on_table : 'cms_page',
2082 successFn : successFn
2086 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2087 _self.setValue(res);
2088 _self.originalValue = res;
2091 stylesheetsclick : function (_self)
2093 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2094 _this.dialog.setStylesheets();
2100 '|xns' : 'Roo.form',
2103 xtype : 'ToolbarStandard',
2104 xns : Roo.form.HtmlEditor,
2105 '|xns' : 'Roo.form.HtmlEditor',
2110 displayField : 'name',
2112 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2113 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2114 forceSelection : true,
2116 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2119 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2120 queryParam : 'search',
2121 selectOnFocus : true,
2122 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>',
2123 triggerAction : 'all',
2128 beforequery : function (combo, query, forceAll, cancel, e)
2131 var id = _this.form.findField('id').getValue() * 1;
2133 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2137 render : function (_self)
2139 _this.bodyimgselect = _self;
2141 select : function (combo, record, index)
2148 var editor = _this.form.findField('body').editorcore;
2150 var curnode = editor.getSelectedNode();
2152 if (curnode && curnode.tagName == 'IMG') {
2153 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2154 baseURL, record.data.id, record.data.filename
2156 // note -forces an update... hopefully...
2157 editor.owner.fireEvent('editorevent', editor, false);
2160 editor.insertAtCursor(
2161 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2162 baseURL, record.data.id, record.data.filename
2171 '|xns' : 'Roo.form',
2175 sortInfo : { direction : 'ASC', field: 'id' },
2177 beforeload : function (_self, o){
2178 o.params = o.params || {};
2180 var id = _this.form.findField('id').getValue() * 1;
2182 Roo.MessageBox.alert("Error", "Save press release first");
2186 o.params.ontable = 'cms_page';
2187 // o.params.imgtype = 'PressRelease';
2188 //o.params['query[imagesize]'] = '150x150';
2193 '|xns' : 'Roo.data',
2195 xtype : 'HttpProxy',
2197 url : baseURL + '/Roo/Images.php',
2202 xtype : 'JsonReader',
2203 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2206 totalProperty : 'total',
2215 displayField : 'page_link',
2217 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2218 forceSelection : true,
2219 hiddenName : 'add_link_id',
2221 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2225 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2226 selectOnFocus : true,
2227 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2228 triggerAction : 'all',
2233 select : function (combo, record, index)
2239 var editor = _this.form.findField('body');
2240 editor.editorcore.insertAtCursor(
2241 String.format('<a href="#page-{0}">{1}</a>',
2242 record.data.page_link, record.data.title
2250 '|xns' : 'Roo.form',
2254 sortInfo : { field: 'page_link', direction: 'ASC' },
2256 beforeload : function (_self, options)
2258 options.params['search[page_link_no_empty]'] =1;
2260 options.params.is_element = 0;
2261 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2266 '|xns' : 'Roo.data',
2268 xtype : 'HttpProxy',
2270 url : baseURL + '/Roo/cms_page.php',
2275 xtype : 'JsonReader',
2277 { name: 'id', type: 'int' },
2283 totalProperty : 'total',
2290 xtype : 'Separator',
2292 '|xns' : 'Roo.Toolbar'
2296 cls : 'x-init-enable',
2297 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2299 click : function (_self, e)
2301 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2305 '|xns' : 'Roo.Toolbar'
2310 xtype : 'ToolbarContext',
2311 xns : Roo.form.HtmlEditor,
2312 '|xns' : 'Roo.form.HtmlEditor'
2323 xtype : 'ContentPanel',
2325 fitContainer : true,
2328 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2337 url : baseURL + '/Roo/cms_page.php',
2339 rendered : function (form)
2345 '|xns' : 'Roo.form',
2351 '|xns' : 'Roo.form',
2354 xtype : 'HtmlEditor',
2355 autosave : function() {
2357 var extended = _this.form2.findField('extended');
2359 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2360 Roo.log('extend not dirty');
2365 Roo.log('extend dirty, auto save!');
2367 extended.fireEvent('autosave', extended);
2369 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2373 white : [ 'iframe' ],
2376 autosave : function (_self)
2378 var id = _this.form.findField('id').getValue() * 1;
2381 if(!_self.editorcore.sourceEditMode){
2388 url : baseURL + '/Roo/Events.php',
2392 action : 'AUTOSAVE',
2393 on_id : (id > 0) ? id : 0,
2394 on_table : 'cms_page',
2395 remarks : 'EXTENDED',
2396 source: _self.getValue()
2398 success : function() {
2399 _self.originalValue = _self.getValue();
2402 failure : function()
2404 //Roo.MessageBox.alert("Error", "autosave failed");
2405 Roo.log('extended autosave failed?!');
2409 savedpreview : function (_self)
2411 var id = _this.form.findField('id').getValue() * 1;
2413 var successFn = function(res){
2414 return res.data.POST.source;
2418 action : 'AUTOSAVE',
2419 remarks : 'EXTENDED',
2420 on_id : (id < 1) ? 0 : id,
2421 on_table : 'cms_page',
2422 successFn : successFn
2426 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2427 _self.setValue(res);
2428 _self.originalValue = res;
2431 stylesheetsclick : function (_self)
2433 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2434 _this.dialog.setStylesheets();
2440 '|xns' : 'Roo.form',
2443 xtype : 'ToolbarStandard',
2444 xns : Roo.form.HtmlEditor,
2445 '|xns' : 'Roo.form.HtmlEditor',
2450 displayField : 'name',
2452 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2453 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2454 forceSelection : true,
2456 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2459 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2460 selectOnFocus : true,
2461 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2462 triggerAction : 'all',
2467 beforequery : function (combo, query, forceAll, cancel, e)
2470 var id = _this.form.findField('id').getValue() * 1;
2472 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2476 render : function (_self)
2478 _this.extendimgselect = _self;
2480 select : function (combo, record, index)
2487 var editor = _this.form.findField('extended').editorcore;
2489 var curnode = editor.getSelectedNode();
2491 if (curnode && curnode.tagName == 'IMG') {
2492 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2493 baseURL, record.data.id, record.data.filename
2495 // note -forces an update... hopefully...
2496 editor.owner.fireEvent('editorevent', editor, false);
2499 editor.insertAtCursor(
2500 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2501 baseURL, record.data.id, record.data.filename
2510 '|xns' : 'Roo.form',
2514 sortInfo : { direction : 'ASC', field: 'id' },
2516 beforeload : function (_self, o){
2517 o.params = o.params || {};
2519 var id = _this.form.findField('id').getValue() * 1;
2521 Roo.MessageBox.alert("Error", "Save press release first");
2525 o.params.ontable = 'cms_page';
2526 // o.params.imgtype = 'PressRelease';
2527 //o.params['query[imagesize]'] = '150x150';
2532 '|xns' : 'Roo.data',
2534 xtype : 'HttpProxy',
2536 url : baseURL + '/Roo/Images.php',
2541 xtype : 'JsonReader',
2542 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2545 totalProperty : 'total',
2554 displayField : 'page_link',
2556 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2557 forceSelection : true,
2558 hiddenName : 'add_link_id',
2560 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2564 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2565 selectOnFocus : true,
2566 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2567 triggerAction : 'all',
2572 select : function (combo, record, index)
2578 var editor = _this.form.findField('body');
2579 editor.editorcore.insertAtCursor(
2580 String.format('<a href="#page-{0}">{1}</a>',
2581 record.data.page_link, record.data.title
2589 '|xns' : 'Roo.form',
2593 sortInfo : { field: 'page_link', direction: 'ASC' },
2595 beforeload : function (_self, options)
2597 options.params['search[page_link_no_empty]'] =1;
2599 options.params.is_element = 0;
2600 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2605 '|xns' : 'Roo.data',
2607 xtype : 'HttpProxy',
2609 url : baseURL + '/Roo/cms_page.php',
2614 xtype : 'JsonReader',
2616 { name: 'id', type: 'int' },
2622 totalProperty : 'total',
2629 xtype : 'Separator',
2631 '|xns' : 'Roo.Toolbar'
2635 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2637 click : function (_self, e)
2639 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2643 '|xns' : 'Roo.Toolbar'
2648 xtype : 'ToolbarContext',
2649 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2650 xns : Roo.form.HtmlEditor,
2651 '|xns' : 'Roo.form.HtmlEditor'
2662 xtype : 'ContentPanel',
2664 fitContainer : true,
2667 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2676 url : baseURL + '/Roo/cms_page.php',
2678 rendered : function (form)
2684 '|xns' : 'Roo.form',
2690 '|xns' : 'Roo.form',
2694 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2708 xtype : 'ContentPanel',
2710 fitContainer : true,
2713 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2722 url : baseURL + '/Roo/cms_page.php',
2724 rendered : function (form)
2730 '|xns' : 'Roo.form',
2735 '|xns' : 'Roo.form',
2739 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2748 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2750 name : 'descriptions',
2765 xtype : 'GridPanel',
2767 fitContainer : true,
2770 tableName : 'Images',
2771 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2773 activate : function() {
2776 _this.grid.footer.onClick('first');
2783 xtype : 'EditorGrid',
2784 autoExpandColumn : 'title',
2788 render : function() {
2790 //_this.dialog = Pman.Dialog.FILL_IN
2791 if (_this.panel.active) {
2792 //this.footer.onClick('first');
2795 rowdblclick : function (_self, rowIndex, e)
2797 var rd = _this.grid.getDataSource().getAt(rowIndex);
2798 var id = rd.data.id;
2799 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2800 _this.form.findField('contents').execCmd('insertimage', url);
2805 '|xns' : 'Roo.grid',
2813 cls : 'x-btn-text-icon',
2814 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2815 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2819 var id = _this.form.findField('id').getValue() * 1;
2825 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2826 _this.grid.ds.load({});
2836 cls : 'x-btn-text-icon',
2837 icon : rootURL + '/Pman/templates/images/trash.gif',
2838 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2842 var selection = _this.grid.getSelectionModel().getSelectedCell();
2843 var sn = _this.grid.ds.getAt(selection[0]);
2844 if (!sn || isNaN(sn.id *1)) {
2845 Roo.MessageBox.alert("Error", "Select a image");
2848 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2854 url : baseURL + '/Roo/Images.php',
2859 success : function()
2861 Roo.log('Got Success!!');
2862 _this.grid.ds.load({});
2876 beforeload : function (_self, o)
2878 var id = _this.form.findField('id').getValue() * 1;
2884 o.params = o.params || {};
2885 o.params.limit = 9999;
2887 o.params.ontable = 'cms_page';
2889 update : function (_self, rec, operation)
2893 url : baseURL+'/Roo/Images.php',
2896 success: function(res)
2898 Roo.log("GOT success");
2899 // update the data...
2900 _this.grid.ds.load({});
2902 failure : function(res)
2904 Roo.MessageBox.alert('Error', res.errorMsg);
2905 _this.grid.ds.load({});
2913 '|xns' : 'Roo.data',
2915 xtype : 'HttpProxy',
2917 url : baseURL + '/Roo/Images.php',
2922 xtype : 'JsonReader',
2957 'name': 'displayorder',
2965 'name': 'parent_image_id',
2971 'dateFormat': 'Y-m-d'
2990 'name': 'parent_image_id_id',
2994 'name': 'parent_image_id_filename',
2998 'name': 'parent_image_id_ontable',
3002 'name': 'parent_image_id_onid',
3006 'name': 'parent_image_id_mimetype',
3010 'name': 'parent_image_id_width',
3014 'name': 'parent_image_id_height',
3018 'name': 'parent_image_id_filesize',
3022 'name': 'parent_image_id_displayorder',
3026 'name': 'parent_image_id_language',
3030 'name': 'parent_image_id_parent_image_id',
3034 'name': 'parent_image_id_created',
3038 'name': 'parent_image_id_imgtype',
3042 'name': 'parent_image_id_linkurl',
3046 'name': 'parent_image_id_descript',
3050 'name': 'parent_image_id_title',
3056 totalProperty : 'total',
3063 xtype : 'ColumnModel',
3065 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3066 renderer : function(v,x,r) {
3067 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3075 xtype : 'ColumnModel',
3076 dataIndex : 'filename',
3077 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3078 renderer : function(v) { return String.format('{0}', v); },
3084 xtype : 'ColumnModel',
3085 dataIndex : 'displayorder',
3086 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3087 renderer : function(v) { return String.format('{0}', v); },
3090 '|xns' : 'Roo.grid',
3092 xtype : 'GridEditor',
3094 '|xns' : 'Roo.grid',
3096 xtype : 'NumberField',
3097 decimalPrecision : 0,
3099 focus : function (_self)
3101 if (this.value == 0) {
3102 this.el.dom.value = '';
3112 xtype : 'ColumnModel',
3113 dataIndex : 'title',
3114 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3115 renderer : function(v) { return String.format('{0}', v); },
3118 '|xns' : 'Roo.grid',
3120 xtype : 'GridEditor',
3122 '|xns' : 'Roo.grid',
3124 xtype : 'TextField',
3131 xtype : 'ColumnModel',
3132 dataIndex : 'linkurl',
3133 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3134 renderer : function(v)
3136 return String.format('{0}', (v) ? v : '');
3140 '|xns' : 'Roo.grid',
3142 xtype : 'GridEditor',
3144 '|xns' : 'Roo.grid',
3146 xtype : 'TextField',
3156 xtype : 'NestedLayoutPanel',
3158 fitContainer : true,
3162 render : function (_self)
3164 _this.westLayoutPanel = this;
3171 xtype : 'BorderLayout',
3175 xtype : 'LayoutRegion',
3176 tabPosition : 'top',
3181 xtype : 'LayoutRegion',
3184 tabPosition : 'top',
3190 xtype : 'ContentPanel',
3195 render : function (_self)
3197 _this.trpanel = _self;
3199 resize : function (_self, width, height)
3201 Roo.log('resize called');
3203 var ew = Math.max(250, width - 10);
3204 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3207 if (!_this.trform) {
3211 var bd = _this.trform1.findField('body');
3216 // since render delays resize..
3217 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3218 // _this.trbodycol.el.setWidth(bd.width+20);
3220 var bd = _this.trform2.findField('extended');
3224 // since render delays resize..
3225 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3226 // _this.trextendcol.el.setWidth(bd.width+20);
3236 labelAlign : 'right',
3239 showHide : function() {
3241 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3242 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3243 var has_lang = _this.trform.findField('language').getValue().length;
3245 _this.westLayoutPanel.getLayout().getRegion('south').show();
3246 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3247 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3248 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3251 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3254 if(!has_extended && has_lang){
3255 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3256 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3264 var el = _this.trform.findField(k);
3265 el.actionMode = 'fieldEl';
3267 Roo.log("show: " + k);
3270 Roo.log("hide: " + k);
3275 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3278 if(typeof(_this.trform.editors) == 'undefined'){
3279 _this.trform.editors = {
3280 body : _this.trform1.findField('body').wrap.isVisible(),
3281 extended : _this.trform2.findField('extended').wrap.isVisible()
3283 if(_this.trform.editors.body){
3284 setInterval(_this.trform1.findField('body').autosave, 60000);
3287 if(_this.trform.editors.extended){
3288 setInterval(_this.trform2.findField('extended').autosave, 60000);
3292 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3293 setInterval(_this.trform1.findField('body').autosave, 60000);
3294 _this.trform.editors.body = true;
3297 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3298 setInterval(_this.trform2.findField('extended').autosave, 60000);
3299 _this.trform.editors.extended = true;
3304 style : 'margin: 5px',
3305 trackResetOnLoad : true,
3306 url : baseURL + '/Roo/cms_page.php',
3308 actioncomplete : function (_self, action)
3310 if (action.type =='submit') {
3314 if (action.type == 'setdata') {
3315 _this.trform.addForm(_this.trform1);
3316 _this.trform.addForm(_this.trform2);
3317 _this.trform.addForm(_this.trform3);
3319 if ( _this.data.id) {
3321 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3323 this.trpanel.el.mask("save first");
3330 if (action.type == 'load') {
3331 // _this.dialog.el.unmask();
3334 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3335 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3336 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3337 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3342 actionfailed : function (_self, action)
3344 _this.dialog.el.unmask();
3346 Pman.standardActionFailed(_self, action);
3348 rendered : function (_self)
3350 _this.trform = _self;
3354 '|xns' : 'Roo.form',
3361 '|xns' : 'Roo.form',
3368 '|xns' : 'Roo.form',
3373 displayField : 'language_name',
3375 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3376 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3377 forceSelection : true,
3378 hiddenName : 'language',
3380 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3382 name : 'language_name',
3384 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3385 selectOnFocus : true,
3386 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3387 triggerAction : 'all',
3389 valueField : 'language',
3391 add : function (combo)
3393 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3396 _this.trform.reset();
3397 _this.trform1.reset();
3398 _this.trform2.reset();
3400 combo.setValue(res.lang);
3401 combo.el.dom.value = res.lang_name;
3404 _this.trform.showHide();
3405 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3410 render : function (_self)
3412 _this.language = _self;
3414 select : function (combo, record, index)
3417 _this.trform.showHide();
3418 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3425 'lookup[language]' : record.data.language,
3426 'lookup[translation_of_id]' : _this.data.id,
3433 '|xns' : 'Roo.form',
3437 sortInfo : { direction : 'ASC', field: 'language' },
3439 beforeload : function (_self, o){
3440 o.params = o.params || {};
3442 o.params._distinct = 'language';
3443 o.params._columns ='language_name,language';
3444 o.params._with_name = true;
3446 if(_this.form.findField('id').getValue()*1 > 0){
3447 o.params.translation_of_id = _this.form.findField('id').getValue();
3453 '|xns' : 'Roo.data',
3455 xtype : 'HttpProxy',
3457 url : baseURL + '/Roo/Cms_page.php',
3462 xtype : 'JsonReader',
3463 fields : [{"name":"language","type":"string"}],
3466 totalProperty : 'total',
3474 style : 'padding-top:12px;padding-left:30px;float:left',
3477 render : function (_self)
3479 _this.updateRow = _self;
3483 '|xns' : 'Roo.form',
3487 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3491 // _this.dialog.el.mask("Saving");
3492 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3493 _this.trform1.findField('body').syncValue();
3494 _this.trform2.findField('extended').syncValue();
3496 _this.trform1.findField('body').pushValue();
3497 _this.trform2.findField('extended').pushValue();
3500 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3501 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3502 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3503 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3504 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3506 if(_this.trform.findField('element_id').getValue()*1 > 0){
3507 _this.trform.findField('is_element').setValue(1);
3510 _this.trform.doAction("submit");
3521 xtype : 'TextField',
3522 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3538 name : 'element_id',
3544 name : 'menu_page_id',
3550 name : 'is_menuitem',
3556 name : 'is_element',
3563 name : 'translation_of_id',
3578 xtype : 'ContentPanel',
3580 fitContainer : true,
3583 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3592 url : baseURL + '/Roo/cms_page.php',
3594 rendered : function (form)
3596 _this.trform1 = form;
3600 '|xns' : 'Roo.form',
3606 '|xns' : 'Roo.form',
3609 xtype : 'HtmlEditor',
3610 autosave : function() {
3612 var body = _this.trform1.findField('body');
3614 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3615 Roo.log('tr body not dirty');
3619 Roo.log('tr body dirty, auto save!');
3621 body.fireEvent('autosave', body);
3623 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3627 white : [ 'iframe' ],
3629 autosave : function (_self)
3631 var id = _this.trform.findField('id').getValue() * 1;
3634 if(!_self.editorcore.sourceEditMode){
3641 url : baseURL + '/Roo/Events.php',
3645 action : 'AUTOSAVE',
3646 on_id : (id > 0) ? id : 0,
3647 on_table : 'cms_page',
3649 source: _self.getValue()
3651 success : function() {
3652 _self.originalValue = _self.getValue();
3655 failure : function()
3657 //Roo.MessageBox.alert("Error", "autosave failed");
3658 Roo.log('tr body autosave failed?!');
3662 savedpreview : function (_self)
3664 var id = _this.trform.findField('id').getValue() * 1;
3666 var successFn = function(res){
3667 return res.data.POST.source;
3671 action : 'AUTOSAVE',
3673 on_id : (id < 1) ? 0 : id,
3674 on_table : 'cms_page',
3675 successFn : successFn
3679 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3680 _self.setValue(res);
3681 _self.originalValue = res;
3684 stylesheetsclick : function (_self)
3686 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3687 _this.dialog.setStylesheets();
3693 '|xns' : 'Roo.form',
3696 xtype : 'ToolbarStandard',
3697 xns : Roo.form.HtmlEditor,
3698 '|xns' : 'Roo.form.HtmlEditor',
3703 displayField : 'name',
3705 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3706 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3707 forceSelection : true,
3709 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3712 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3713 selectOnFocus : true,
3714 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>',
3715 triggerAction : 'all',
3720 beforequery : function (combo, query, forceAll, cancel, e)
3723 var id = _this.form.findField('id').getValue() * 1;
3725 Roo.MessageBox.alert("Error", "Save press release first");
3729 render : function (_self)
3731 _this.trbodyimgselect = _self;
3733 select : function (combo, record, index)
3740 var editor = _this.trform.findField('body').editorcore;
3742 var curnode = editor.getSelectedNode();
3744 if (curnode && curnode.tagName == 'IMG') {
3745 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3746 baseURL, record.data.id, record.data.filename
3748 // note -forces an update... hopefully...
3749 editor.owner.fireEvent('editorevent', editor, false);
3752 editor.insertAtCursor(
3753 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3754 baseURL, record.data.id, record.data.filename
3763 '|xns' : 'Roo.form',
3767 sortInfo : { direction : 'ASC', field: 'id' },
3769 beforeload : function (_self, o){
3770 o.params = o.params || {};
3772 var id = _this.form.findField('id').getValue() * 1;
3774 Roo.MessageBox.alert("Error", "Save press release first");
3778 o.params.ontable = 'cms_page';
3779 // o.params.imgtype = 'PressRelease';
3780 //o.params['query[imagesize]'] = '150x150';
3785 '|xns' : 'Roo.data',
3787 xtype : 'HttpProxy',
3789 url : baseURL + '/Roo/Images.php',
3794 xtype : 'JsonReader',
3795 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3798 totalProperty : 'total',
3807 displayField : 'page_link',
3809 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3810 forceSelection : true,
3811 hiddenName : 'add_link_id',
3813 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3817 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3818 selectOnFocus : true,
3819 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3820 triggerAction : 'all',
3825 select : function (combo, record, index)
3831 var editor = _this.form.findField('body');
3832 editor.insertAtCursor(
3833 String.format('<a href="#page-{0}">{1}</a>',
3834 record.data.page_link, record.data.title
3842 '|xns' : 'Roo.form',
3846 sortInfo : { field: 'page_link', direction: 'ASC' },
3848 beforeload : function (_self, options)
3850 options.params['search[page_link_no_empty]'] =1;
3852 options.params.is_element = 0;
3853 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3858 '|xns' : 'Roo.data',
3860 xtype : 'HttpProxy',
3862 url : baseURL + '/Roo/cms_page.php',
3867 xtype : 'JsonReader',
3869 { name: 'id', type: 'int' },
3875 totalProperty : 'total',
3882 xtype : 'Separator',
3884 '|xns' : 'Roo.Toolbar'
3888 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3890 click : function (_self, e)
3892 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3896 '|xns' : 'Roo.Toolbar'
3901 xtype : 'ToolbarContext',
3902 xns : Roo.form.HtmlEditor,
3903 '|xns' : 'Roo.form.HtmlEditor'
3914 xtype : 'ContentPanel',
3916 fitContainer : true,
3919 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3928 url : baseURL + '/Roo/cms_page.php',
3930 rendered : function (form)
3932 _this.trform2 = form;
3936 '|xns' : 'Roo.form',
3942 '|xns' : 'Roo.form',
3945 xtype : 'HtmlEditor',
3946 autosave : function() {
3948 var extended = _this.trform2.findField('extended');
3950 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3951 Roo.log('tr extend not dirty');
3956 Roo.log('tr extend dirty, auto save!');
3958 extended.fireEvent('autosave', extended);
3962 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3966 white : [ 'iframe' ],
3968 autosave : function (_self)
3970 var id = _this.trform.findField('id').getValue() * 1;
3973 if(!_self.editorcore.sourceEditMode){
3981 url : baseURL + '/Roo/Events.php',
3985 action : 'AUTOSAVE',
3986 on_id : (id > 0) ? id : 0,
3987 on_table : 'cms_page',
3988 remarks : 'EXTENDED',
3989 source: _self.getValue()
3991 success : function() {
3992 _self.originalValue = _self.getValue();
3995 failure : function()
3997 //Roo.MessageBox.alert("Error", "autosave failed");
3998 Roo.log('tr extended autosave failed?!');
4002 savedpreview : function (_self)
4004 var id = _this.trform.findField('id').getValue() * 1;
4006 var successFn = function(res){
4007 return res.data.POST.source;
4011 action : 'AUTOSAVE',
4012 remarks : 'EXTENDED',
4013 on_id : (id < 1) ? 0 : id,
4014 on_table : 'cms_page',
4015 successFn : successFn
4019 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4020 _self.setValue(res);
4021 _self.originalValue = res;
4024 stylesheetsclick : function (_self)
4026 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4027 _this.dialog.setStylesheets();
4033 '|xns' : 'Roo.form',
4036 xtype : 'ToolbarStandard',
4037 xns : Roo.form.HtmlEditor,
4038 '|xns' : 'Roo.form.HtmlEditor',
4041 xtype : 'Separator',
4043 '|xns' : 'Roo.Toolbar'
4047 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4049 click : function (_self, e)
4051 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4055 '|xns' : 'Roo.Toolbar'
4060 xtype : 'ToolbarContext',
4061 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4062 xns : Roo.form.HtmlEditor,
4063 '|xns' : 'Roo.form.HtmlEditor'
4074 xtype : 'ContentPanel',
4076 fitContainer : true,
4079 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4088 url : baseURL + '/Roo/cms_page.php',
4090 rendered : function (form)
4092 _this.trform3 = form;
4096 '|xns' : 'Roo.form',
4101 '|xns' : 'Roo.form',
4105 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4114 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4116 name : 'descriptions',