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);
219 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
221 Pman.Cms.pageEditAddCustomFields();
223 _this.dialog.getLayout().getRegion('east').collapse();
224 _this.dialog.getLayout().getRegion('west').collapse();
228 var ew = Math.max(250, w-150); // was 350?/ why?
229 //var eh = Math.max(250, h-350) ;
232 var bd = _this.form1.findField('body');
237 // since render delays resize..
238 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
239 //_this.bodycol.el.setWidth(bd.width+20);
241 var bd = _this.form2.findField('extended');
245 // since render delays resize..
246 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
247 // _this.extendcol.el.setWidth(bd.width+20);
249 var bd = _this.form3.findField('extra_css');
252 //_this.keywordscol.el.setWidth(ew+20);
255 // fix messed up scroll.
256 _this.dialog.layout.el.dom.scrollTop = 0;
264 xtype : 'LayoutRegion',
270 xtype : 'LayoutRegion',
272 collapsedTitle : 'Images / Attachments',
276 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
279 expanded : function (_self)
281 var id = _this.form.findField('id').getValue() * 1;
284 Roo.MessageBox.alert('Error', 'Save first');
289 var w = Roo.lib.Dom.getViewWidth();
290 var h = Roo.lib.Dom.getViewHeight();
292 _self.resizeTo.defer(110, _self,[ w-400, h] );
293 _this.dialog.getLayout().getRegion('west').collapse();
300 xtype : 'LayoutRegion',
302 collapsedTitle : 'Translations',
306 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
309 beforecollapse : function (_self)
311 if(!_this.trform || !_this.trform1 || !_this.trform2){
316 !_this.trform.isDirty() &&
317 !_this.trform1.isDirty() &&
318 !_this.trform2.isDirty() &&
319 !_this.trform3.isDirty()
324 Roo.MessageBox.confirm(
326 "Do you want to save the translation",
329 _self.collapse(true, true);
339 collapsed : function (_self)
342 _this.trform.reset();
343 Roo.log('reset trform');
347 _this.trform1.reset();
348 Roo.log('reset trform1');
352 _this.trform2.reset();
353 Roo.log('reset trform2');
357 _this.trform3.reset();
358 Roo.log('reset trform3');
362 expanded : function (_self)
364 var id = _this.form.findField('id').getValue() * 1;
367 Roo.MessageBox.alert('Error', 'Save first');
372 var w = Roo.lib.Dom.getViewWidth();
373 var h = Roo.lib.Dom.getViewHeight();
375 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
377 _this.panel.region.collapse();
387 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
391 var page_link = _this.form.findField('page_link').getValue();
393 if(!page_link.length){
394 Roo.MessageBox.alert('Error', 'Please fill in the page link');
398 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
399 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
403 var url = uiConfig.cms_page_preview_base + page_link;
413 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
418 _this.trform.isDirty() ||
419 _this.trform1.isDirty() ||
420 _this.trform2.isDirty() ||
421 _this.trform3.isDirty()
423 Roo.MessageBox.confirm(
425 "Do you want to save the translation",
451 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
456 if(!_this.form1.findField('body').editorcore.sourceEditMode){
457 _this.form1.findField('body').syncValue();
458 _this.form2.findField('extended').syncValue();
459 Roo.log('syncValue');
461 _this.form1.findField('body').pushValue();
462 _this.form2.findField('extended').pushValue();
463 Roo.log('pushValue');
466 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
467 _this.interests.reset();
471 _this.trform.isDirty() ||
472 _this.trform1.isDirty() ||
473 _this.trform2.isDirty() ||
474 _this.trform3.isDirty()
476 Roo.MessageBox.confirm(
478 "Do you want to save the translation",
481 _this.dialog.el.mask("Saving");
482 _this.form.doAction("submit");
492 _this.dialog.el.mask("Saving");
493 _this.form.doAction("submit");
502 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
508 if(!_this.form1.findField('body').editorcore.sourceEditMode){
509 _this.form1.findField('body').syncValue();
510 _this.form2.findField('extended').syncValue();
512 _this.form1.findField('body').pushValue();
513 _this.form2.findField('extended').pushValue();
516 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
517 _this.interests.reset();
522 _this.trform.isDirty() ||
523 _this.trform1.isDirty() ||
524 _this.trform2.isDirty() ||
525 _this.trform3.isDirty()
527 Roo.MessageBox.confirm(
529 "Do you want to save the translation",
532 _this.dialog.el.mask("Saving");
533 _this.form.doAction("submit");
543 _this.dialog.el.mask("Saving");
544 _this.form.doAction("submit");
554 xtype : 'NestedLayoutPanel',
560 render : function (_self)
562 _this.centerLayoutPanel = this;
569 xtype : 'BorderLayout',
573 xtype : 'LayoutRegion',
579 xtype : 'LayoutRegion',
588 xtype : 'ContentPanel',
593 render : function (_self)
595 _this.cpanel = _self;
597 resize : function (_self, width, height)
599 Roo.log("RESIZE, " + width + ',' + height);
601 var ew = Math.max(250, width - 10);
602 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
609 bd = _this.form1.findField('body');
613 // since render delays resize..
614 Roo.log('resizing body to ' + bd.width);
615 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
616 // _this.bodycol.el.setWidth(bd.width+20);
621 bd = _this.form2.findField('extended');
627 Roo.log('resizing extended to ' + bd.width);
628 // since render delays resize..
629 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
630 // _this.extendcol.el.setWidth(bd.width+20);
635 bd = _this.form3.findField('extra_css');
639 // _this.keywordscol.el.setWidth(ew+20);
641 // fix for messed up rendering of dialog?
645 _this.dialog.layout.el.dom.scrollTop = 0;
647 // noop... - the above sometimes fails...
660 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
662 click : function (_self, e)
664 if (_this.dialog.getLayout().getRegion('west').collapsed) {
665 _this.dialog.getLayout().getRegion('west').expand();
667 _this.dialog.getLayout().getRegion('west').collapse();
673 '|xns' : 'Roo.Toolbar'
678 '|xns' : 'Roo.Toolbar'
682 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
684 click : function (_self, e)
686 if (_this.panel.region.collapsed) {
687 _this.panel.region.expand();
689 _this.panel.region.collapse();
695 '|xns' : 'Roo.Toolbar'
704 _this.form.setValues(_this.data);
708 _this.dialog.el.unmask();
709 _this.grid.getDataSource().load();
711 _this.trform.reset();
712 _this.trform1.reset();
713 _this.trform2.reset();
715 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
716 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
719 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
720 catlabel.dom.innerHTML = 'Category';
722 if(_this.data.page_type_id_name == 'category'){
723 catlabel.dom.innerHTML = 'Parent Category';
727 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
728 catlabel.dom.innerHTML = 'Parent page';
729 if(_this.data.page_type_id_name == 'category'){
730 catlabel.dom.innerHTML = 'Parent';
733 // better if this was not here... - not sure which project uses it?
735 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
736 _this.interestsCol.show();
739 if(typeof(d['interests']) != 'undefined'){
740 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
743 if(typeof(d['categories']) != 'undefined'){
744 _this.form.findField('category').setValue(Roo.decode(d['categories']));
747 if(typeof(d['page_classes']) != 'undefined'){
748 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
751 _this.trpanel.el.unmask();
752 _this.panel.el.unmask();
755 _this.cpanel.el.dom.scrollTop = 0;
757 // fix messed up scroll.
758 _this.dialog.layout.el.dom.scrollTop = 0;
761 labelAlign : 'right',
764 showHide : function()
771 var page_type_name = _this.form.findField('page_type_id_name').getValue();
773 switch(page_type_name){
796 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
797 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
798 var has_extended = _this.form.findField('has_extended').getValue() * 1;
801 is_attachment : !in_rss,
803 category_type_id : in_rss && !is_menu,
804 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
805 target_url : is_menu,
807 category : !is_category,
809 parent_id : !in_rss || is_category ,
812 to_replace_id :false, // !in_rss, // is this used.
813 is_draft : !is_system_page,
814 author_id : in_rss && !is_menu && !is_attachment,
816 template_id : !is_attachment && !is_menu && !is_system_page,
817 element_id : is_element && !is_menu,
818 menu_page_id : is_menu,
819 page_cls : is_element
821 // has_extended : !is_menu && !is_attachment, // always shown.
822 // extended : has_extended && !is_menu && !is_attachment,
823 // body : !is_attachment && !is_menu,
824 //keywords : !is_attachment && !is_menu,
825 // descriptions : !is_attachment && !is_menu
826 // extra_css : !is_attachment && !is_menu
830 var el = _this.form.findField(k);
833 Roo.log("missing field " + k);
837 el.actionMode = 'fieldEl';
847 _this.centerLayoutPanel.getLayout().getRegion('south').show();
848 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
849 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
850 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
851 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
853 if(is_attachment || is_menu){
855 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
859 if(!has_extended && !is_attachment && !is_menu){
860 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
861 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
865 _this.trform.showHide();
867 if(typeof(_this.form.editors) == 'undefined'){
868 _this.form.editors = {
869 body : _this.form1.findField('body').wrap.isVisible(),
870 extended : _this.form2.findField('extended').wrap.isVisible()
873 if(_this.form.editors.body){
874 setInterval(_this.form1.findField('body').autosave, 60000);
877 if(_this.form.editors.extended){
878 setInterval(_this.form2.findField('extended').autosave, 60000);
882 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
883 setInterval(_this.form1.findField('body').autosave, 60000);
884 _this.form.editors.body = true;
887 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
888 setInterval(_this.form2.findField('extended').autosave, 60000);
889 _this.form.editors.extended = true;
895 style : 'margin: 5px',
896 url : baseURL + '/Roo/cms_page.php',
898 actioncomplete : function (_self, action)
901 if (action.type == 'setdata') {
903 _this.form.addForm(_this.form1);
904 _this.form.addForm(_this.form2);
905 _this.form.addForm(_this.form3);
906 _this.form.addForm(_this.form4);
908 _this.dialog.setStylesheets();
910 _this.dialog.getLayout().getRegion('west').collapse();
911 _this.panel.region.collapse();
913 _this.trpanel.el.mask('Save first');
914 _this.panel.el.mask('Save first');
916 _this.loaded = false;
917 _this.interestsCol.hide();
919 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
921 if ( _this.data.id) {
922 _this.dialog.el.mask("Loading");
923 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
927 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
928 this.findField('is_draft').setValue(is_draft);
929 _this.page_type.setValue(_this.data.page_type_id);
930 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
932 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
933 _this.interestsCol.show();
936 _this.form.showHide();
939 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
940 catlabel.dom.innerHTML = 'Category';
941 if(_this.data.page_type_id_name == 'category'){
942 catlabel.dom.innerHTML = 'Parent Category';
947 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
948 catlabel.dom.innerHTML = 'Parent page';
949 if(_this.data.page_type_id_name == 'category'){
950 catlabel.dom.innerHTML = 'Parent';
956 if(_this.data._is_copy){
957 _this.form.is_copy();
963 if (action.type == 'load') {
965 //_this.data = action.result.data;
967 var d = action.result.data;
969 _this.dialog.el.unmask();
970 _this.grid.getDataSource().load();
972 _this.trform.reset();
973 _this.trform1.reset();
974 _this.trform2.reset();
976 _this.trform.addForm(_this.trform1);
977 _this.trform.addForm(_this.trform2);
979 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
980 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
981 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
982 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
983 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
986 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
987 catlabel.dom.innerHTML = 'Category';
989 if(_this.data.page_type_id_name == 'category'){
990 catlabel.dom.innerHTML = 'Parent Category';
994 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
995 catlabel.dom.innerHTML = 'Parent page';
996 if(_this.data.page_type_id_name == 'category'){
997 catlabel.dom.innerHTML = 'Parent';
1000 // better if this was not here... - not sure which project uses it?
1002 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
1003 _this.interestsCol.show();
1006 if(typeof(d['interests']) != 'undefined'){
1007 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1010 if(typeof(d['categories']) != 'undefined'){
1011 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1014 if(typeof(d['page_classes']) != 'undefined'){
1015 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1018 _this.trpanel.el.unmask();
1019 _this.panel.el.unmask();
1022 _this.cpanel.el.dom.scrollTop = 0;
1024 // fix messed up scroll.
1025 _this.dialog.layout.el.dom.scrollTop = 0;
1029 if (action.type =='submit') {
1031 _this.dialog.el.unmask();
1034 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1038 _this.dialog.hide();
1041 if (_this.callback) {
1042 _this.callback.call(_this, action.result.data);
1048 actionfailed : function (_self, action)
1050 _this.dialog.el.unmask();
1051 Pman.standardActionFailed(_self, action);
1053 rendered : function (_self)
1059 '|xns' : 'Roo.form',
1066 '|xns' : 'Roo.form',
1071 labelAlign : 'right',
1073 style : 'height:30px;overflow:hidden',
1076 '|xns' : 'Roo.form',
1080 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1089 style : 'height:30px;overflow:hidden',
1092 '|xns' : 'Roo.form',
1097 displayField : 'display_name',
1099 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1100 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1101 forceSelection : true,
1102 hiddenName : 'page_type_id',
1104 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1106 name : 'page_type_id_display_name',
1108 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1109 selectOnFocus : true,
1110 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1111 triggerAction : 'all',
1115 render : function (_self)
1117 _this.page_type = _self;
1119 select : function (combo, record, index)
1121 // _this.grid.footer.onClick('first');
1122 var page_type_name = record.data.name;
1123 _this.form.findField('page_type_id_name').setValue(page_type_name);
1124 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1125 _this.form.findField('is_attachment').setValue(0);
1129 _this.form.showHide.defer(100, _this.form);
1135 '|xns' : 'Roo.form',
1139 sortInfo : { direction : 'ASC', field: 'seqid' },
1141 beforeload : function (_self, o){
1142 o.params = o.params || {};
1144 o.params.etype = 'cms_page_type';
1148 '|xns' : 'Roo.data',
1150 xtype : 'HttpProxy',
1152 url : baseURL + '/Roo/core_enum.php',
1157 xtype : 'JsonReader',
1158 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1161 totalProperty : 'total',
1170 style : 'padding-left: -70px;',
1173 '|xns' : 'Roo.form',
1176 xtype : 'NumberField',
1177 decimalPrecision : 0,
1178 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1193 labelAlign : 'right',
1195 style : 'height:30px;overflow:hidden',
1198 '|xns' : 'Roo.form',
1202 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1211 style : 'height:30px;overflow:hidden',
1214 '|xns' : 'Roo.form',
1218 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1219 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1227 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1229 name : 'has_extended',
1232 check : function (_self, checked)
1237 _this.form.showHide();
1238 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1249 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1251 name : 'is_attachment',
1254 check : function (_self, checked)
1258 _this.form.showHide.defer(100, _this.form);
1272 displayField : 'name',
1274 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1275 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1276 forceSelection : true,
1277 hiddenName : 'author_id',
1279 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1281 name : 'author_id_name',
1283 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1284 queryParam : 'query[name]',
1285 selectOnFocus : true,
1286 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1287 triggerAction : 'all',
1292 '|xns' : 'Roo.form',
1296 sortInfo : { direction : 'ASC', field: 'name' },
1298 beforeload : function (_self, o){
1299 o.params = o.params || {};
1301 o.params.active = 1;
1302 o.params['query[is_owner]'] = 1;
1306 '|xns' : 'Roo.data',
1308 xtype : 'HttpProxy',
1310 url : baseURL + '/Roo/core_person',
1315 xtype : 'JsonReader',
1316 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1319 totalProperty : 'total',
1326 xtype : 'ComboBoxArray',
1327 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1328 hiddenName : 'category',
1329 name : 'category_name',
1332 '|xns' : 'Roo.form',
1337 displayField : 'display_fullpath',
1339 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1340 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1341 forceSelection : true,
1345 queryParam : 'search[name]',
1346 selectOnFocus : true,
1347 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1348 triggerAction : 'all',
1352 '|xns' : 'Roo.form',
1356 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1358 beforeload : function (_self, o){
1359 o.params = o.params || {};
1361 o.params.page_type_id_name= 'CATEGORY';
1363 o.params._with_fullpath = 1;
1367 '|xns' : 'Roo.data',
1369 xtype : 'HttpProxy',
1371 url : baseURL + '/Roo/cms_page.php',
1376 xtype : 'JsonReader',
1378 {"name":"id","type":"int"},
1379 {"name":"name","type":"string"},
1380 {"name":"display_name","type":"string"}
1384 totalProperty : 'total',
1395 displayField : 'page_link',
1397 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1398 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1399 forceSelection : true,
1400 hiddenName : 'parent_id',
1402 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1404 name : 'parent_id_title',
1406 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1407 selectOnFocus : true,
1408 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1409 triggerAction : 'all',
1414 select : function (combo, record, index)
1416 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1417 if (page_type_name == 'page') { // page
1420 // do not default to put 'Home' at the beginning.
1421 if (!record || !(record.data.parent_id *1)) {
1424 var pl = _this.form.findField('page_link');
1425 var lk = pl.getValue();
1426 var new_link = record.data.page_link + '/';
1428 new_link += lk.split('/').pop();
1430 pl.setValue(new_link);
1435 '|xns' : 'Roo.form',
1439 sortInfo : { field: 'page_link', direction: 'ASC' },
1441 beforeload : function (_self, options)
1443 options.params['search[page_link_no_empty]'] =1;
1445 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1446 options.params._page_type = 'page,element';
1448 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1451 var id = _this.form.findField('id').getValue() * 1;
1454 options.params['!id'] = id;
1459 options.params.is_element = 0;
1460 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1461 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1466 '|xns' : 'Roo.data',
1468 xtype : 'HttpProxy',
1470 url : baseURL + '/Roo/cms_page.php',
1475 xtype : 'JsonReader',
1477 { name: 'id', type: 'int' },
1483 totalProperty : 'total',
1493 '|xns' : 'Roo.form',
1496 xtype : 'DateField',
1497 altFormats : 'Y-m-d H:i:s',
1498 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1506 xtype : 'TextField',
1507 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1508 name : 'to_replace_id',
1516 xtype : 'TextField',
1517 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1521 keyup : function (_self, e)
1523 if (_this.page_type.getRawValue() == 'Category') {
1525 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1534 xtype : 'TextField',
1535 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1542 xtype : 'TextField',
1543 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1544 name : 'target_url',
1553 displayField : 'template_clean',
1555 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1556 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1557 forceSelection : true,
1558 hiddenName : 'template_id',
1560 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1562 name : 'template_id_template_clean',
1564 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1565 selectOnFocus : true,
1566 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1567 triggerAction : 'all',
1572 '|xns' : 'Roo.form',
1576 sortInfo : { field: 'template', direction: 'ASC' },
1578 beforeload : function (_self, options)
1581 options.params._rescan = 1;
1582 options.params._clean_name = 1;
1583 // options.params.lang = 'en';
1584 options.params['!template[0]'] = 'master.html';
1585 //options.params['!template[1]'] = 'index.html';
1589 '|xns' : 'Roo.data',
1591 xtype : 'HttpProxy',
1593 url : baseURL + '/Roo/Cms_template',
1598 xtype : 'JsonReader',
1600 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1604 totalProperty : 'total',
1614 displayField : 'name',
1616 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1617 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1618 forceSelection : true,
1619 hiddenName : 'element_id',
1621 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1623 name : 'element_id_name',
1625 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1626 selectOnFocus : true,
1627 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1628 triggerAction : 'all',
1633 '|xns' : 'Roo.form',
1637 sortInfo : { field: 'name', direction: 'ASC' },
1639 beforeload : function (_self, options)
1641 var par = _this.form.findField('parent_id').getValue() * 1;
1643 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1647 options.params._cms_page_id = par;
1651 '|xns' : 'Roo.data',
1653 xtype : 'HttpProxy',
1655 url : baseURL + '/Roo/Cms_template_element',
1660 xtype : 'JsonReader',
1662 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1666 totalProperty : 'total',
1676 displayField : 'page_link',
1678 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1679 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1680 forceSelection : true,
1681 hiddenName : 'menu_page_id',
1683 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1685 name : 'menu_page_id_page_link',
1687 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1688 selectOnFocus : true,
1689 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>',
1690 triggerAction : 'all',
1695 '|xns' : 'Roo.form',
1699 sortInfo : { field: 'title', direction: 'ASC' },
1701 beforeload : function (_self, options)
1703 options.params = options.params || {};
1705 options.params['search[page_link_no_empty]'] =1;
1707 options.params['page_type_id_name[0]'] = 'page';
1708 options.params['page_type_id_name[1]'] = 'blog';
1710 options.params.is_element = 0;
1711 options.params.is_menuitem = 0;
1716 '|xns' : 'Roo.data',
1718 xtype : 'HttpProxy',
1720 url : baseURL + '/Roo/cms_page.php',
1725 xtype : 'JsonReader',
1740 "name":"page_type_id_display_name",
1746 totalProperty : 'total',
1753 xtype : 'ComboBoxArray',
1754 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1755 hiddenName : 'page_cls',
1756 name : 'page_cls_name',
1759 '|xns' : 'Roo.form',
1764 displayField : 'display_name',
1766 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1767 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1768 forceSelection : true,
1771 queryParam : 'query[search]',
1772 selectOnFocus : true,
1773 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1774 triggerAction : 'all',
1775 valueField : 'name',
1778 '|xns' : 'Roo.form',
1782 sortInfo : { direction : 'ASC', field: 'seqid' },
1784 beforeload : function (_self, o){
1785 o.params = o.params || {};
1787 o.params.etype = 'cms_page_class';
1791 '|xns' : 'Roo.data',
1793 xtype : 'HttpProxy',
1795 url : baseURL + '/Roo/core_enum.php',
1800 xtype : 'JsonReader',
1802 {"name":"id","type":"int"},
1803 {"name":"name","type":"string"},
1804 {"name":"display_name","type":"string"}
1808 totalProperty : 'total',
1822 '|xns' : 'Roo.form',
1828 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1829 style : 'width: 165px;',
1831 '|xns' : 'Roo.form',
1834 xtype : 'DisplayField',
1836 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1837 name : 'primary_image_id',
1838 style : 'border: 1px solid #ccc;',
1839 valueRenderer : function(v) {
1841 if (!v || v * 1 < 1) {
1842 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1845 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1858 render : function (_self)
1860 _this.interestsCol = _self;
1864 '|xns' : 'Roo.form',
1867 xtype : 'ComboBoxArray',
1868 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1869 hiddenName : 'interest',
1870 name : 'interest_name',
1873 render : function (_self)
1875 _this.interests = _self;
1877 _self.combo.addicon.setStyle( {
1878 position : 'absolute',
1887 '|xns' : 'Roo.form',
1892 displayField : 'display_name',
1894 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1895 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1896 forceSelection : true,
1899 queryParam : 'query[name]',
1900 selectOnFocus : true,
1901 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1902 triggerAction : 'all',
1906 '|xns' : 'Roo.form',
1910 sortInfo : { direction : 'ASC', field: 'name' },
1912 beforeload : function (_self, o){
1913 o.params = o.params || {};
1914 o.params.etype = 'crm_interest';
1918 '|xns' : 'Roo.data',
1920 xtype : 'HttpProxy',
1922 url : baseURL + '/Roo/Core_enum.php',
1927 xtype : 'JsonReader',
1929 {"name":"id","type":"int"},
1930 {"name":"name","type":"string"},
1931 {"name":"display_name","type":"string"}
1935 totalProperty : 'total',
1952 name : 'is_system_page',
1958 name : 'is_menuitem',
1964 name : 'page_type_id_name',
1971 render : function (_self)
1973 _this.user_defined_fields = _self;
1984 xtype : 'ContentPanel',
1986 fitContainer : true,
1989 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1998 url : baseURL + '/Roo/cms_page.php',
2000 rendered : function (form)
2006 '|xns' : 'Roo.form',
2012 '|xns' : 'Roo.form',
2015 xtype : 'HtmlEditor',
2016 autosave : function() {
2018 var body = _this.form1.findField('body');
2020 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2021 Roo.log('body not dirty');
2025 Roo.log('body dirty, auto save!');
2027 body.fireEvent('autosave', body);
2031 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2035 white : [ 'iframe' ],
2038 autosave : function (_self)
2040 Roo.log('autosave');
2042 var id = _this.form.findField('id').getValue() * 1;
2044 if(!_self.editorcore.sourceEditMode){
2051 url : baseURL + '/Roo/Events.php',
2055 action : 'AUTOSAVE',
2056 on_id : (id > 0) ? id : 0,
2057 on_table : 'cms_page',
2059 source: _self.getValue()
2061 success : function() {
2062 _self.originalValue = _self.getValue();
2065 failure : function()
2067 //Roo.MessageBox.alert("Error", "autosave failed");
2068 Roo.log('body autosave failed?!');
2073 savedpreview : function (_self)
2075 Roo.log('saved preview');
2077 var id = _this.form.findField('id').getValue() * 1;
2079 var successFn = function(res){
2080 return res.data.POST.source;
2084 action : 'AUTOSAVE',
2086 on_id : (id < 1) ? 0 : id,
2087 on_table : 'cms_page',
2088 successFn : successFn
2092 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2093 _self.setValue(res);
2094 _self.originalValue = res;
2097 stylesheetsclick : function (_self)
2099 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2100 _this.dialog.setStylesheets();
2106 '|xns' : 'Roo.form',
2109 xtype : 'ToolbarStandard',
2110 xns : Roo.form.HtmlEditor,
2111 '|xns' : 'Roo.form.HtmlEditor',
2116 displayField : 'name',
2118 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2119 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2120 forceSelection : true,
2122 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2125 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2126 queryParam : 'search',
2127 selectOnFocus : true,
2128 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>',
2129 triggerAction : 'all',
2134 beforequery : function (combo, query, forceAll, cancel, e)
2137 var id = _this.form.findField('id').getValue() * 1;
2139 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2143 render : function (_self)
2145 _this.bodyimgselect = _self;
2147 select : function (combo, record, index)
2154 var editor = _this.form.findField('body').editorcore;
2156 var curnode = editor.getSelectedNode();
2158 if (curnode && curnode.tagName == 'IMG') {
2159 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2160 baseURL, record.data.id, record.data.filename
2162 // note -forces an update... hopefully...
2163 editor.owner.fireEvent('editorevent', editor, false);
2166 editor.insertAtCursor(
2167 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2168 baseURL, record.data.id, record.data.filename
2177 '|xns' : 'Roo.form',
2181 sortInfo : { direction : 'ASC', field: 'id' },
2183 beforeload : function (_self, o){
2184 o.params = o.params || {};
2186 var id = _this.form.findField('id').getValue() * 1;
2188 Roo.MessageBox.alert("Error", "Save press release first");
2192 o.params.ontable = 'cms_page';
2193 // o.params.imgtype = 'PressRelease';
2194 //o.params['query[imagesize]'] = '150x150';
2199 '|xns' : 'Roo.data',
2201 xtype : 'HttpProxy',
2203 url : baseURL + '/Roo/Images.php',
2208 xtype : 'JsonReader',
2209 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2212 totalProperty : 'total',
2221 displayField : 'page_link',
2223 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2224 forceSelection : true,
2225 hiddenName : 'add_link_id',
2227 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2231 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2232 selectOnFocus : true,
2233 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2234 triggerAction : 'all',
2239 select : function (combo, record, index)
2245 var editor = _this.form.findField('body');
2246 editor.editorcore.insertAtCursor(
2247 String.format('<a href="#page-{0}">{1}</a>',
2248 record.data.page_link, record.data.title
2256 '|xns' : 'Roo.form',
2260 sortInfo : { field: 'page_link', direction: 'ASC' },
2262 beforeload : function (_self, options)
2264 options.params['search[page_link_no_empty]'] =1;
2266 options.params.is_element = 0;
2267 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2272 '|xns' : 'Roo.data',
2274 xtype : 'HttpProxy',
2276 url : baseURL + '/Roo/cms_page.php',
2281 xtype : 'JsonReader',
2283 { name: 'id', type: 'int' },
2289 totalProperty : 'total',
2296 xtype : 'Separator',
2298 '|xns' : 'Roo.Toolbar'
2302 cls : 'x-init-enable',
2303 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2305 click : function (_self, e)
2307 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2311 '|xns' : 'Roo.Toolbar'
2316 xtype : 'ToolbarContext',
2317 xns : Roo.form.HtmlEditor,
2318 '|xns' : 'Roo.form.HtmlEditor'
2329 xtype : 'ContentPanel',
2331 fitContainer : true,
2334 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2343 url : baseURL + '/Roo/cms_page.php',
2345 rendered : function (form)
2351 '|xns' : 'Roo.form',
2357 '|xns' : 'Roo.form',
2360 xtype : 'HtmlEditor',
2361 autosave : function() {
2363 var extended = _this.form2.findField('extended');
2365 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2366 Roo.log('extend not dirty');
2371 Roo.log('extend dirty, auto save!');
2373 extended.fireEvent('autosave', extended);
2375 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2379 white : [ 'iframe' ],
2382 autosave : function (_self)
2384 var id = _this.form.findField('id').getValue() * 1;
2387 if(!_self.editorcore.sourceEditMode){
2394 url : baseURL + '/Roo/Events.php',
2398 action : 'AUTOSAVE',
2399 on_id : (id > 0) ? id : 0,
2400 on_table : 'cms_page',
2401 remarks : 'EXTENDED',
2402 source: _self.getValue()
2404 success : function() {
2405 _self.originalValue = _self.getValue();
2408 failure : function()
2410 //Roo.MessageBox.alert("Error", "autosave failed");
2411 Roo.log('extended autosave failed?!');
2415 savedpreview : function (_self)
2417 var id = _this.form.findField('id').getValue() * 1;
2419 var successFn = function(res){
2420 return res.data.POST.source;
2424 action : 'AUTOSAVE',
2425 remarks : 'EXTENDED',
2426 on_id : (id < 1) ? 0 : id,
2427 on_table : 'cms_page',
2428 successFn : successFn
2432 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2433 _self.setValue(res);
2434 _self.originalValue = res;
2437 stylesheetsclick : function (_self)
2439 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2440 _this.dialog.setStylesheets();
2446 '|xns' : 'Roo.form',
2449 xtype : 'ToolbarStandard',
2450 xns : Roo.form.HtmlEditor,
2451 '|xns' : 'Roo.form.HtmlEditor',
2456 displayField : 'name',
2458 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2459 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2460 forceSelection : true,
2462 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2465 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2466 selectOnFocus : true,
2467 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2468 triggerAction : 'all',
2473 beforequery : function (combo, query, forceAll, cancel, e)
2476 var id = _this.form.findField('id').getValue() * 1;
2478 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2482 render : function (_self)
2484 _this.extendimgselect = _self;
2486 select : function (combo, record, index)
2493 var editor = _this.form.findField('extended').editorcore;
2495 var curnode = editor.getSelectedNode();
2497 if (curnode && curnode.tagName == 'IMG') {
2498 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2499 baseURL, record.data.id, record.data.filename
2501 // note -forces an update... hopefully...
2502 editor.owner.fireEvent('editorevent', editor, false);
2505 editor.insertAtCursor(
2506 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2507 baseURL, record.data.id, record.data.filename
2516 '|xns' : 'Roo.form',
2520 sortInfo : { direction : 'ASC', field: 'id' },
2522 beforeload : function (_self, o){
2523 o.params = o.params || {};
2525 var id = _this.form.findField('id').getValue() * 1;
2527 Roo.MessageBox.alert("Error", "Save press release first");
2531 o.params.ontable = 'cms_page';
2532 // o.params.imgtype = 'PressRelease';
2533 //o.params['query[imagesize]'] = '150x150';
2538 '|xns' : 'Roo.data',
2540 xtype : 'HttpProxy',
2542 url : baseURL + '/Roo/Images.php',
2547 xtype : 'JsonReader',
2548 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2551 totalProperty : 'total',
2560 displayField : 'page_link',
2562 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2563 forceSelection : true,
2564 hiddenName : 'add_link_id',
2566 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2570 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2571 selectOnFocus : true,
2572 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2573 triggerAction : 'all',
2578 select : function (combo, record, index)
2584 var editor = _this.form.findField('body');
2585 editor.editorcore.insertAtCursor(
2586 String.format('<a href="#page-{0}">{1}</a>',
2587 record.data.page_link, record.data.title
2595 '|xns' : 'Roo.form',
2599 sortInfo : { field: 'page_link', direction: 'ASC' },
2601 beforeload : function (_self, options)
2603 options.params['search[page_link_no_empty]'] =1;
2605 options.params.is_element = 0;
2606 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2611 '|xns' : 'Roo.data',
2613 xtype : 'HttpProxy',
2615 url : baseURL + '/Roo/cms_page.php',
2620 xtype : 'JsonReader',
2622 { name: 'id', type: 'int' },
2628 totalProperty : 'total',
2635 xtype : 'Separator',
2637 '|xns' : 'Roo.Toolbar'
2641 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2643 click : function (_self, e)
2645 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2649 '|xns' : 'Roo.Toolbar'
2654 xtype : 'ToolbarContext',
2655 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2656 xns : Roo.form.HtmlEditor,
2657 '|xns' : 'Roo.form.HtmlEditor'
2668 xtype : 'ContentPanel',
2670 fitContainer : true,
2673 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2682 url : baseURL + '/Roo/cms_page.php',
2684 rendered : function (form)
2690 '|xns' : 'Roo.form',
2696 '|xns' : 'Roo.form',
2700 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2714 xtype : 'ContentPanel',
2716 fitContainer : true,
2719 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2728 url : baseURL + '/Roo/cms_page.php',
2730 rendered : function (form)
2736 '|xns' : 'Roo.form',
2741 '|xns' : 'Roo.form',
2745 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2754 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2756 name : 'descriptions',
2771 xtype : 'GridPanel',
2773 fitContainer : true,
2776 tableName : 'Images',
2777 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2779 activate : function() {
2782 _this.grid.footer.onClick('first');
2789 xtype : 'EditorGrid',
2790 autoExpandColumn : 'title',
2794 render : function() {
2796 //_this.dialog = Pman.Dialog.FILL_IN
2797 if (_this.panel.active) {
2798 //this.footer.onClick('first');
2801 rowdblclick : function (_self, rowIndex, e)
2803 var rd = _this.grid.getDataSource().getAt(rowIndex);
2804 var id = rd.data.id;
2805 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2806 _this.form.findField('contents').execCmd('insertimage', url);
2811 '|xns' : 'Roo.grid',
2819 cls : 'x-btn-text-icon',
2820 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2821 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2825 var id = _this.form.findField('id').getValue() * 1;
2831 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2832 _this.grid.ds.load({});
2842 cls : 'x-btn-text-icon',
2843 icon : rootURL + '/Pman/templates/images/trash.gif',
2844 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2848 var selection = _this.grid.getSelectionModel().getSelectedCell();
2849 var sn = _this.grid.ds.getAt(selection[0]);
2850 if (!sn || isNaN(sn.id *1)) {
2851 Roo.MessageBox.alert("Error", "Select a image");
2854 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2860 url : baseURL + '/Roo/Images.php',
2865 success : function()
2867 Roo.log('Got Success!!');
2868 _this.grid.ds.load({});
2882 beforeload : function (_self, o)
2884 var id = _this.form.findField('id').getValue() * 1;
2890 o.params = o.params || {};
2891 o.params.limit = 9999;
2893 o.params.ontable = 'cms_page';
2895 update : function (_self, rec, operation)
2899 url : baseURL+'/Roo/Images.php',
2902 success: function(res)
2904 Roo.log("GOT success");
2905 // update the data...
2906 _this.grid.ds.load({});
2908 failure : function(res)
2910 Roo.MessageBox.alert('Error', res.errorMsg);
2911 _this.grid.ds.load({});
2919 '|xns' : 'Roo.data',
2921 xtype : 'HttpProxy',
2923 url : baseURL + '/Roo/Images.php',
2928 xtype : 'JsonReader',
2963 'name': 'displayorder',
2971 'name': 'parent_image_id',
2977 'dateFormat': 'Y-m-d'
2996 'name': 'parent_image_id_id',
3000 'name': 'parent_image_id_filename',
3004 'name': 'parent_image_id_ontable',
3008 'name': 'parent_image_id_onid',
3012 'name': 'parent_image_id_mimetype',
3016 'name': 'parent_image_id_width',
3020 'name': 'parent_image_id_height',
3024 'name': 'parent_image_id_filesize',
3028 'name': 'parent_image_id_displayorder',
3032 'name': 'parent_image_id_language',
3036 'name': 'parent_image_id_parent_image_id',
3040 'name': 'parent_image_id_created',
3044 'name': 'parent_image_id_imgtype',
3048 'name': 'parent_image_id_linkurl',
3052 'name': 'parent_image_id_descript',
3056 'name': 'parent_image_id_title',
3062 totalProperty : 'total',
3069 xtype : 'ColumnModel',
3071 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3072 renderer : function(v,x,r) {
3073 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3081 xtype : 'ColumnModel',
3082 dataIndex : 'filename',
3083 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3084 renderer : function(v) { return String.format('{0}', v); },
3090 xtype : 'ColumnModel',
3091 dataIndex : 'displayorder',
3092 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3093 renderer : function(v) { return String.format('{0}', v); },
3096 '|xns' : 'Roo.grid',
3098 xtype : 'GridEditor',
3100 '|xns' : 'Roo.grid',
3102 xtype : 'NumberField',
3103 decimalPrecision : 0,
3105 focus : function (_self)
3107 if (this.value == 0) {
3108 this.el.dom.value = '';
3118 xtype : 'ColumnModel',
3119 dataIndex : 'title',
3120 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3121 renderer : function(v) { return String.format('{0}', v); },
3124 '|xns' : 'Roo.grid',
3126 xtype : 'GridEditor',
3128 '|xns' : 'Roo.grid',
3130 xtype : 'TextField',
3137 xtype : 'ColumnModel',
3138 dataIndex : 'linkurl',
3139 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3140 renderer : function(v)
3142 return String.format('{0}', (v) ? v : '');
3146 '|xns' : 'Roo.grid',
3148 xtype : 'GridEditor',
3150 '|xns' : 'Roo.grid',
3152 xtype : 'TextField',
3162 xtype : 'NestedLayoutPanel',
3164 fitContainer : true,
3168 render : function (_self)
3170 _this.westLayoutPanel = this;
3177 xtype : 'BorderLayout',
3181 xtype : 'LayoutRegion',
3182 tabPosition : 'top',
3187 xtype : 'LayoutRegion',
3190 tabPosition : 'top',
3196 xtype : 'ContentPanel',
3201 render : function (_self)
3203 _this.trpanel = _self;
3205 resize : function (_self, width, height)
3207 Roo.log('resize called');
3209 var ew = Math.max(250, width - 10);
3210 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3213 if (!_this.trform) {
3217 var bd = _this.trform1.findField('body');
3222 // since render delays resize..
3223 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3224 // _this.trbodycol.el.setWidth(bd.width+20);
3226 var bd = _this.trform2.findField('extended');
3230 // since render delays resize..
3231 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3232 // _this.trextendcol.el.setWidth(bd.width+20);
3242 labelAlign : 'right',
3245 showHide : function() {
3247 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3248 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3249 var has_lang = _this.trform.findField('language').getValue().length;
3251 _this.westLayoutPanel.getLayout().getRegion('south').show();
3252 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3253 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3254 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3257 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3260 if(!has_extended && has_lang){
3261 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3262 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3270 var el = _this.trform.findField(k);
3271 el.actionMode = 'fieldEl';
3273 Roo.log("show: " + k);
3276 Roo.log("hide: " + k);
3281 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3284 if(typeof(_this.trform.editors) == 'undefined'){
3285 _this.trform.editors = {
3286 body : _this.trform1.findField('body').wrap.isVisible(),
3287 extended : _this.trform2.findField('extended').wrap.isVisible()
3289 if(_this.trform.editors.body){
3290 setInterval(_this.trform1.findField('body').autosave, 60000);
3293 if(_this.trform.editors.extended){
3294 setInterval(_this.trform2.findField('extended').autosave, 60000);
3298 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3299 setInterval(_this.trform1.findField('body').autosave, 60000);
3300 _this.trform.editors.body = true;
3303 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3304 setInterval(_this.trform2.findField('extended').autosave, 60000);
3305 _this.trform.editors.extended = true;
3310 style : 'margin: 5px',
3311 trackResetOnLoad : true,
3312 url : baseURL + '/Roo/cms_page.php',
3314 actioncomplete : function (_self, action)
3316 if (action.type =='submit') {
3320 if (action.type == 'setdata') {
3321 _this.trform.addForm(_this.trform1);
3322 _this.trform.addForm(_this.trform2);
3323 _this.trform.addForm(_this.trform3);
3325 if ( _this.data.id) {
3327 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3329 this.trpanel.el.mask("save first");
3336 if (action.type == 'load') {
3337 // _this.dialog.el.unmask();
3340 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3341 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3342 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3343 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3348 actionfailed : function (_self, action)
3350 _this.dialog.el.unmask();
3352 Pman.standardActionFailed(_self, action);
3354 rendered : function (_self)
3356 _this.trform = _self;
3360 '|xns' : 'Roo.form',
3367 '|xns' : 'Roo.form',
3374 '|xns' : 'Roo.form',
3379 displayField : 'language_name',
3381 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3382 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3383 forceSelection : true,
3384 hiddenName : 'language',
3386 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3388 name : 'language_name',
3390 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3391 selectOnFocus : true,
3392 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3393 triggerAction : 'all',
3395 valueField : 'language',
3397 add : function (combo)
3399 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3402 _this.trform.reset();
3403 _this.trform1.reset();
3404 _this.trform2.reset();
3406 combo.setValue(res.lang);
3407 combo.el.dom.value = res.lang_name;
3410 _this.trform.showHide();
3411 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3416 render : function (_self)
3418 _this.language = _self;
3420 select : function (combo, record, index)
3423 _this.trform.showHide();
3424 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3431 'lookup[language]' : record.data.language,
3432 'lookup[translation_of_id]' : _this.data.id,
3439 '|xns' : 'Roo.form',
3443 sortInfo : { direction : 'ASC', field: 'language' },
3445 beforeload : function (_self, o){
3446 o.params = o.params || {};
3448 o.params._distinct = 'language';
3449 o.params._columns ='language_name,language';
3450 o.params._with_name = true;
3452 if(_this.form.findField('id').getValue()*1 > 0){
3453 o.params.translation_of_id = _this.form.findField('id').getValue();
3459 '|xns' : 'Roo.data',
3461 xtype : 'HttpProxy',
3463 url : baseURL + '/Roo/Cms_page.php',
3468 xtype : 'JsonReader',
3469 fields : [{"name":"language","type":"string"}],
3472 totalProperty : 'total',
3480 style : 'padding-top:12px;padding-left:30px;float:left',
3483 render : function (_self)
3485 _this.updateRow = _self;
3489 '|xns' : 'Roo.form',
3493 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3497 // _this.dialog.el.mask("Saving");
3498 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3499 _this.trform1.findField('body').syncValue();
3500 _this.trform2.findField('extended').syncValue();
3502 _this.trform1.findField('body').pushValue();
3503 _this.trform2.findField('extended').pushValue();
3506 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3507 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3508 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3509 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3510 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3512 if(_this.trform.findField('element_id').getValue()*1 > 0){
3513 _this.trform.findField('is_element').setValue(1);
3516 _this.trform.doAction("submit");
3527 xtype : 'TextField',
3528 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3544 name : 'element_id',
3550 name : 'menu_page_id',
3556 name : 'is_menuitem',
3562 name : 'is_element',
3569 name : 'translation_of_id',
3584 xtype : 'ContentPanel',
3586 fitContainer : true,
3589 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3598 url : baseURL + '/Roo/cms_page.php',
3600 rendered : function (form)
3602 _this.trform1 = form;
3606 '|xns' : 'Roo.form',
3612 '|xns' : 'Roo.form',
3615 xtype : 'HtmlEditor',
3616 autosave : function() {
3618 var body = _this.trform1.findField('body');
3620 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3621 Roo.log('tr body not dirty');
3625 Roo.log('tr body dirty, auto save!');
3627 body.fireEvent('autosave', body);
3629 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3633 white : [ 'iframe' ],
3635 autosave : function (_self)
3637 var id = _this.trform.findField('id').getValue() * 1;
3640 if(!_self.editorcore.sourceEditMode){
3647 url : baseURL + '/Roo/Events.php',
3651 action : 'AUTOSAVE',
3652 on_id : (id > 0) ? id : 0,
3653 on_table : 'cms_page',
3655 source: _self.getValue()
3657 success : function() {
3658 _self.originalValue = _self.getValue();
3661 failure : function()
3663 //Roo.MessageBox.alert("Error", "autosave failed");
3664 Roo.log('tr body autosave failed?!');
3668 savedpreview : function (_self)
3670 var id = _this.trform.findField('id').getValue() * 1;
3672 var successFn = function(res){
3673 return res.data.POST.source;
3677 action : 'AUTOSAVE',
3679 on_id : (id < 1) ? 0 : id,
3680 on_table : 'cms_page',
3681 successFn : successFn
3685 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3686 _self.setValue(res);
3687 _self.originalValue = res;
3690 stylesheetsclick : function (_self)
3692 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3693 _this.dialog.setStylesheets();
3699 '|xns' : 'Roo.form',
3702 xtype : 'ToolbarStandard',
3703 xns : Roo.form.HtmlEditor,
3704 '|xns' : 'Roo.form.HtmlEditor',
3709 displayField : 'name',
3711 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3712 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3713 forceSelection : true,
3715 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3718 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3719 selectOnFocus : true,
3720 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>',
3721 triggerAction : 'all',
3726 beforequery : function (combo, query, forceAll, cancel, e)
3729 var id = _this.form.findField('id').getValue() * 1;
3731 Roo.MessageBox.alert("Error", "Save press release first");
3735 render : function (_self)
3737 _this.trbodyimgselect = _self;
3739 select : function (combo, record, index)
3746 var editor = _this.trform.findField('body').editorcore;
3748 var curnode = editor.getSelectedNode();
3750 if (curnode && curnode.tagName == 'IMG') {
3751 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3752 baseURL, record.data.id, record.data.filename
3754 // note -forces an update... hopefully...
3755 editor.owner.fireEvent('editorevent', editor, false);
3758 editor.insertAtCursor(
3759 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3760 baseURL, record.data.id, record.data.filename
3769 '|xns' : 'Roo.form',
3773 sortInfo : { direction : 'ASC', field: 'id' },
3775 beforeload : function (_self, o){
3776 o.params = o.params || {};
3778 var id = _this.form.findField('id').getValue() * 1;
3780 Roo.MessageBox.alert("Error", "Save press release first");
3784 o.params.ontable = 'cms_page';
3785 // o.params.imgtype = 'PressRelease';
3786 //o.params['query[imagesize]'] = '150x150';
3791 '|xns' : 'Roo.data',
3793 xtype : 'HttpProxy',
3795 url : baseURL + '/Roo/Images.php',
3800 xtype : 'JsonReader',
3801 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3804 totalProperty : 'total',
3813 displayField : 'page_link',
3815 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3816 forceSelection : true,
3817 hiddenName : 'add_link_id',
3819 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3823 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3824 selectOnFocus : true,
3825 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3826 triggerAction : 'all',
3831 select : function (combo, record, index)
3837 var editor = _this.form.findField('body');
3838 editor.insertAtCursor(
3839 String.format('<a href="#page-{0}">{1}</a>',
3840 record.data.page_link, record.data.title
3848 '|xns' : 'Roo.form',
3852 sortInfo : { field: 'page_link', direction: 'ASC' },
3854 beforeload : function (_self, options)
3856 options.params['search[page_link_no_empty]'] =1;
3858 options.params.is_element = 0;
3859 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3864 '|xns' : 'Roo.data',
3866 xtype : 'HttpProxy',
3868 url : baseURL + '/Roo/cms_page.php',
3873 xtype : 'JsonReader',
3875 { name: 'id', type: 'int' },
3881 totalProperty : 'total',
3888 xtype : 'Separator',
3890 '|xns' : 'Roo.Toolbar'
3894 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3896 click : function (_self, e)
3898 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3902 '|xns' : 'Roo.Toolbar'
3907 xtype : 'ToolbarContext',
3908 xns : Roo.form.HtmlEditor,
3909 '|xns' : 'Roo.form.HtmlEditor'
3920 xtype : 'ContentPanel',
3922 fitContainer : true,
3925 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3934 url : baseURL + '/Roo/cms_page.php',
3936 rendered : function (form)
3938 _this.trform2 = form;
3942 '|xns' : 'Roo.form',
3948 '|xns' : 'Roo.form',
3951 xtype : 'HtmlEditor',
3952 autosave : function() {
3954 var extended = _this.trform2.findField('extended');
3956 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3957 Roo.log('tr extend not dirty');
3962 Roo.log('tr extend dirty, auto save!');
3964 extended.fireEvent('autosave', extended);
3968 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3972 white : [ 'iframe' ],
3974 autosave : function (_self)
3976 var id = _this.trform.findField('id').getValue() * 1;
3979 if(!_self.editorcore.sourceEditMode){
3987 url : baseURL + '/Roo/Events.php',
3991 action : 'AUTOSAVE',
3992 on_id : (id > 0) ? id : 0,
3993 on_table : 'cms_page',
3994 remarks : 'EXTENDED',
3995 source: _self.getValue()
3997 success : function() {
3998 _self.originalValue = _self.getValue();
4001 failure : function()
4003 //Roo.MessageBox.alert("Error", "autosave failed");
4004 Roo.log('tr extended autosave failed?!');
4008 savedpreview : function (_self)
4010 var id = _this.trform.findField('id').getValue() * 1;
4012 var successFn = function(res){
4013 return res.data.POST.source;
4017 action : 'AUTOSAVE',
4018 remarks : 'EXTENDED',
4019 on_id : (id < 1) ? 0 : id,
4020 on_table : 'cms_page',
4021 successFn : successFn
4025 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4026 _self.setValue(res);
4027 _self.originalValue = res;
4030 stylesheetsclick : function (_self)
4032 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4033 _this.dialog.setStylesheets();
4039 '|xns' : 'Roo.form',
4042 xtype : 'ToolbarStandard',
4043 xns : Roo.form.HtmlEditor,
4044 '|xns' : 'Roo.form.HtmlEditor',
4047 xtype : 'Separator',
4049 '|xns' : 'Roo.Toolbar'
4053 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4055 click : function (_self, e)
4057 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4061 '|xns' : 'Roo.Toolbar'
4066 xtype : 'ToolbarContext',
4067 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4068 xns : Roo.form.HtmlEditor,
4069 '|xns' : 'Roo.form.HtmlEditor'
4080 xtype : 'ContentPanel',
4082 fitContainer : true,
4085 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4094 url : baseURL + '/Roo/cms_page.php',
4096 rendered : function (form)
4098 _this.trform3 = form;
4102 '|xns' : 'Roo.form',
4107 '|xns' : 'Roo.form',
4111 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4120 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4122 name : 'descriptions',