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)
341 _this.trform.reset();
342 _this.trform1.reset();
343 _this.trform2.reset();
344 _this.trform3.reset();
346 expanded : function (_self)
348 var id = _this.form.findField('id').getValue() * 1;
351 Roo.MessageBox.alert('Error', 'Save first');
356 var w = Roo.lib.Dom.getViewWidth();
357 var h = Roo.lib.Dom.getViewHeight();
359 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
361 _this.panel.region.collapse();
371 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
375 var page_link = _this.form.findField('page_link').getValue();
377 if(!page_link.length){
378 Roo.MessageBox.alert('Error', 'Please fill in the page link');
382 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
383 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
387 var url = uiConfig.cms_page_preview_base + page_link;
397 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
402 _this.trform.isDirty() ||
403 _this.trform1.isDirty() ||
404 _this.trform2.isDirty() ||
405 _this.trform3.isDirty()
407 Roo.MessageBox.confirm(
409 "Do you want to save the translation",
435 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
440 if(!_this.form1.findField('body').editorcore.sourceEditMode){
441 _this.form1.findField('body').syncValue();
442 _this.form2.findField('extended').syncValue();
443 Roo.log('syncValue');
445 _this.form1.findField('body').pushValue();
446 _this.form2.findField('extended').pushValue();
447 Roo.log('pushValue');
450 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
451 _this.interests.reset();
455 _this.trform.isDirty() ||
456 _this.trform1.isDirty() ||
457 _this.trform2.isDirty() ||
458 _this.trform3.isDirty()
460 Roo.MessageBox.confirm(
462 "Do you want to save the translation",
465 _this.dialog.el.mask("Saving");
466 _this.form.doAction("submit");
476 _this.dialog.el.mask("Saving");
477 _this.form.doAction("submit");
486 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
492 if(!_this.form1.findField('body').editorcore.sourceEditMode){
493 _this.form1.findField('body').syncValue();
494 _this.form2.findField('extended').syncValue();
496 _this.form1.findField('body').pushValue();
497 _this.form2.findField('extended').pushValue();
500 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
501 _this.interests.reset();
506 _this.trform.isDirty() ||
507 _this.trform1.isDirty() ||
508 _this.trform2.isDirty() ||
509 _this.trform3.isDirty()
511 Roo.MessageBox.confirm(
513 "Do you want to save the translation",
516 _this.dialog.el.mask("Saving");
517 _this.form.doAction("submit");
527 _this.dialog.el.mask("Saving");
528 _this.form.doAction("submit");
538 xtype : 'NestedLayoutPanel',
544 render : function (_self)
546 _this.centerLayoutPanel = this;
553 xtype : 'BorderLayout',
557 xtype : 'LayoutRegion',
563 xtype : 'LayoutRegion',
572 xtype : 'ContentPanel',
577 render : function (_self)
579 _this.cpanel = _self;
581 resize : function (_self, width, height)
583 Roo.log("RESIZE, " + width + ',' + height);
585 var ew = Math.max(250, width - 10);
586 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
593 bd = _this.form1.findField('body');
597 // since render delays resize..
598 Roo.log('resizing body to ' + bd.width);
599 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
600 // _this.bodycol.el.setWidth(bd.width+20);
605 bd = _this.form2.findField('extended');
611 Roo.log('resizing extended to ' + bd.width);
612 // since render delays resize..
613 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
614 // _this.extendcol.el.setWidth(bd.width+20);
619 bd = _this.form3.findField('extra_css');
623 // _this.keywordscol.el.setWidth(ew+20);
625 // fix for messed up rendering of dialog?
629 _this.dialog.layout.el.dom.scrollTop = 0;
631 // noop... - the above sometimes fails...
644 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
646 click : function (_self, e)
648 if (_this.dialog.getLayout().getRegion('west').collapsed) {
649 _this.dialog.getLayout().getRegion('west').expand();
651 _this.dialog.getLayout().getRegion('west').collapse();
657 '|xns' : 'Roo.Toolbar'
662 '|xns' : 'Roo.Toolbar'
666 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
668 click : function (_self, e)
670 if (_this.panel.region.collapsed) {
671 _this.panel.region.expand();
673 _this.panel.region.collapse();
679 '|xns' : 'Roo.Toolbar'
688 _this.form.setValues(_this.data);
692 _this.dialog.el.unmask();
693 _this.grid.getDataSource().load();
695 _this.trform.reset();
696 _this.trform1.reset();
697 _this.trform2.reset();
699 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
700 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
703 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
704 catlabel.dom.innerHTML = 'Category';
706 if(_this.data.page_type_id_name == 'category'){
707 catlabel.dom.innerHTML = 'Parent Category';
711 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
712 catlabel.dom.innerHTML = 'Parent page';
713 if(_this.data.page_type_id_name == 'category'){
714 catlabel.dom.innerHTML = 'Parent';
717 // better if this was not here... - not sure which project uses it?
719 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
720 _this.interestsCol.show();
723 if(typeof(d['interests']) != 'undefined'){
724 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
727 if(typeof(d['categories']) != 'undefined'){
728 _this.form.findField('category').setValue(Roo.decode(d['categories']));
731 if(typeof(d['page_classes']) != 'undefined'){
732 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
735 _this.trpanel.el.unmask();
736 _this.panel.el.unmask();
739 _this.cpanel.el.dom.scrollTop = 0;
741 // fix messed up scroll.
742 _this.dialog.layout.el.dom.scrollTop = 0;
745 labelAlign : 'right',
748 showHide : function()
755 var page_type_name = _this.form.findField('page_type_id_name').getValue();
757 switch(page_type_name){
780 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
781 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
782 var has_extended = _this.form.findField('has_extended').getValue() * 1;
785 is_attachment : !in_rss,
787 category_type_id : in_rss && !is_menu,
788 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
789 target_url : is_menu,
791 category : !is_category,
793 parent_id : !in_rss || is_category ,
796 to_replace_id :false, // !in_rss, // is this used.
797 is_draft : !is_system_page,
798 author_id : in_rss && !is_menu && !is_attachment,
800 template_id : !is_attachment && !is_menu && !is_system_page,
801 element_id : is_element && !is_menu,
802 menu_page_id : is_menu,
803 page_cls : is_element
805 // has_extended : !is_menu && !is_attachment, // always shown.
806 // extended : has_extended && !is_menu && !is_attachment,
807 // body : !is_attachment && !is_menu,
808 //keywords : !is_attachment && !is_menu,
809 // descriptions : !is_attachment && !is_menu
810 // extra_css : !is_attachment && !is_menu
814 var el = _this.form.findField(k);
817 Roo.log("missing field " + k);
821 el.actionMode = 'fieldEl';
831 _this.centerLayoutPanel.getLayout().getRegion('south').show();
832 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
833 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
834 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
835 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
837 if(is_attachment || is_menu){
839 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
843 if(!has_extended && !is_attachment && !is_menu){
844 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
845 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
849 _this.trform.showHide();
851 if(typeof(_this.form.editors) == 'undefined'){
852 _this.form.editors = {
853 body : _this.form1.findField('body').wrap.isVisible(),
854 extended : _this.form2.findField('extended').wrap.isVisible()
857 if(_this.form.editors.body){
858 setInterval(_this.form1.findField('body').autosave, 60000);
861 if(_this.form.editors.extended){
862 setInterval(_this.form2.findField('extended').autosave, 60000);
866 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
867 setInterval(_this.form1.findField('body').autosave, 60000);
868 _this.form.editors.body = true;
871 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
872 setInterval(_this.form2.findField('extended').autosave, 60000);
873 _this.form.editors.extended = true;
879 style : 'margin: 5px',
880 url : baseURL + '/Roo/cms_page.php',
882 actioncomplete : function (_self, action)
885 if (action.type == 'setdata') {
887 _this.form.addForm(_this.form1);
888 _this.form.addForm(_this.form2);
889 _this.form.addForm(_this.form3);
890 _this.form.addForm(_this.form4);
892 _this.dialog.setStylesheets();
894 _this.dialog.getLayout().getRegion('west').collapse();
895 _this.panel.region.collapse();
897 _this.trpanel.el.mask('Save first');
898 _this.panel.el.mask('Save first');
900 _this.loaded = false;
901 _this.interestsCol.hide();
903 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
905 if ( _this.data.id) {
906 _this.dialog.el.mask("Loading");
907 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
911 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
912 this.findField('is_draft').setValue(is_draft);
913 _this.page_type.setValue(_this.data.page_type_id);
914 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
916 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
917 _this.interestsCol.show();
920 _this.form.showHide();
923 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
924 catlabel.dom.innerHTML = 'Category';
925 if(_this.data.page_type_id_name == 'category'){
926 catlabel.dom.innerHTML = 'Parent Category';
931 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
932 catlabel.dom.innerHTML = 'Parent page';
933 if(_this.data.page_type_id_name == 'category'){
934 catlabel.dom.innerHTML = 'Parent';
940 if(_this.data._is_copy){
941 _this.form.is_copy();
947 if (action.type == 'load') {
949 //_this.data = action.result.data;
951 var d = action.result.data;
953 _this.dialog.el.unmask();
954 _this.grid.getDataSource().load();
956 _this.trform.reset();
957 _this.trform1.reset();
958 _this.trform2.reset();
960 _this.trform.addForm(_this.trform1);
961 _this.trform.addForm(_this.trform2);
963 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
964 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
965 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
966 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
967 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
970 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
971 catlabel.dom.innerHTML = 'Category';
973 if(_this.data.page_type_id_name == 'category'){
974 catlabel.dom.innerHTML = 'Parent Category';
978 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
979 catlabel.dom.innerHTML = 'Parent page';
980 if(_this.data.page_type_id_name == 'category'){
981 catlabel.dom.innerHTML = 'Parent';
984 // better if this was not here... - not sure which project uses it?
986 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
987 _this.interestsCol.show();
990 if(typeof(d['interests']) != 'undefined'){
991 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
994 if(typeof(d['categories']) != 'undefined'){
995 _this.form.findField('category').setValue(Roo.decode(d['categories']));
998 if(typeof(d['page_classes']) != 'undefined'){
999 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1002 _this.trpanel.el.unmask();
1003 _this.panel.el.unmask();
1006 _this.cpanel.el.dom.scrollTop = 0;
1008 // fix messed up scroll.
1009 _this.dialog.layout.el.dom.scrollTop = 0;
1013 if (action.type =='submit') {
1015 _this.dialog.el.unmask();
1018 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1022 _this.dialog.hide();
1025 if (_this.callback) {
1026 _this.callback.call(_this, action.result.data);
1032 actionfailed : function (_self, action)
1034 _this.dialog.el.unmask();
1035 Pman.standardActionFailed(_self, action);
1037 rendered : function (_self)
1043 '|xns' : 'Roo.form',
1050 '|xns' : 'Roo.form',
1055 labelAlign : 'right',
1057 style : 'height:30px;overflow:hidden',
1060 '|xns' : 'Roo.form',
1064 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1073 style : 'height:30px;overflow:hidden',
1076 '|xns' : 'Roo.form',
1081 displayField : 'display_name',
1083 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1084 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1085 forceSelection : true,
1086 hiddenName : 'page_type_id',
1088 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1090 name : 'page_type_id_display_name',
1092 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1093 selectOnFocus : true,
1094 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1095 triggerAction : 'all',
1099 render : function (_self)
1101 _this.page_type = _self;
1103 select : function (combo, record, index)
1105 // _this.grid.footer.onClick('first');
1106 var page_type_name = record.data.name;
1107 _this.form.findField('page_type_id_name').setValue(page_type_name);
1108 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1109 _this.form.findField('is_attachment').setValue(0);
1113 _this.form.showHide.defer(100, _this.form);
1119 '|xns' : 'Roo.form',
1123 sortInfo : { direction : 'ASC', field: 'seqid' },
1125 beforeload : function (_self, o){
1126 o.params = o.params || {};
1128 o.params.etype = 'cms_page_type';
1132 '|xns' : 'Roo.data',
1134 xtype : 'HttpProxy',
1136 url : baseURL + '/Roo/core_enum.php',
1141 xtype : 'JsonReader',
1142 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1145 totalProperty : 'total',
1154 style : 'padding-left: -70px;',
1157 '|xns' : 'Roo.form',
1160 xtype : 'NumberField',
1161 decimalPrecision : 0,
1162 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1177 labelAlign : 'right',
1179 style : 'height:30px;overflow:hidden',
1182 '|xns' : 'Roo.form',
1186 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1195 style : 'height:30px;overflow:hidden',
1198 '|xns' : 'Roo.form',
1202 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1203 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1211 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1213 name : 'has_extended',
1216 check : function (_self, checked)
1221 _this.form.showHide();
1222 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1233 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1235 name : 'is_attachment',
1238 check : function (_self, checked)
1242 _this.form.showHide.defer(100, _this.form);
1256 displayField : 'name',
1258 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1259 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1260 forceSelection : true,
1261 hiddenName : 'author_id',
1263 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1265 name : 'author_id_name',
1267 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1268 queryParam : 'query[name]',
1269 selectOnFocus : true,
1270 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1271 triggerAction : 'all',
1276 '|xns' : 'Roo.form',
1280 sortInfo : { direction : 'ASC', field: 'name' },
1282 beforeload : function (_self, o){
1283 o.params = o.params || {};
1285 o.params.active = 1;
1286 o.params['query[is_owner]'] = 1;
1290 '|xns' : 'Roo.data',
1292 xtype : 'HttpProxy',
1294 url : baseURL + '/Roo/core_person',
1299 xtype : 'JsonReader',
1300 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1303 totalProperty : 'total',
1310 xtype : 'ComboBoxArray',
1311 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1312 hiddenName : 'category',
1313 name : 'category_name',
1316 '|xns' : 'Roo.form',
1321 displayField : 'display_fullpath',
1323 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1324 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1325 forceSelection : true,
1329 queryParam : 'search[name]',
1330 selectOnFocus : true,
1331 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1332 triggerAction : 'all',
1336 '|xns' : 'Roo.form',
1340 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1342 beforeload : function (_self, o){
1343 o.params = o.params || {};
1345 o.params.page_type_id_name= 'CATEGORY';
1347 o.params._with_fullpath = 1;
1351 '|xns' : 'Roo.data',
1353 xtype : 'HttpProxy',
1355 url : baseURL + '/Roo/cms_page.php',
1360 xtype : 'JsonReader',
1362 {"name":"id","type":"int"},
1363 {"name":"name","type":"string"},
1364 {"name":"display_name","type":"string"}
1368 totalProperty : 'total',
1379 displayField : 'page_link',
1381 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1382 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1383 forceSelection : true,
1384 hiddenName : 'parent_id',
1386 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1388 name : 'parent_id_title',
1390 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1391 selectOnFocus : true,
1392 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1393 triggerAction : 'all',
1398 select : function (combo, record, index)
1400 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1401 if (page_type_name == 'page') { // page
1404 // do not default to put 'Home' at the beginning.
1405 if (!record || !(record.data.parent_id *1)) {
1408 var pl = _this.form.findField('page_link');
1409 var lk = pl.getValue();
1410 var new_link = record.data.page_link + '/';
1412 new_link += lk.split('/').pop();
1414 pl.setValue(new_link);
1419 '|xns' : 'Roo.form',
1423 sortInfo : { field: 'page_link', direction: 'ASC' },
1425 beforeload : function (_self, options)
1427 options.params['search[page_link_no_empty]'] =1;
1429 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1430 options.params._page_type = 'page,element';
1432 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1435 var id = _this.form.findField('id').getValue() * 1;
1438 options.params['!id'] = id;
1443 options.params.is_element = 0;
1444 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1445 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1450 '|xns' : 'Roo.data',
1452 xtype : 'HttpProxy',
1454 url : baseURL + '/Roo/cms_page.php',
1459 xtype : 'JsonReader',
1461 { name: 'id', type: 'int' },
1467 totalProperty : 'total',
1477 '|xns' : 'Roo.form',
1480 xtype : 'DateField',
1481 altFormats : 'Y-m-d H:i:s',
1482 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1490 xtype : 'TextField',
1491 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1492 name : 'to_replace_id',
1500 xtype : 'TextField',
1501 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1505 keyup : function (_self, e)
1507 if (_this.page_type.getRawValue() == 'Category') {
1509 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1518 xtype : 'TextField',
1519 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1526 xtype : 'TextField',
1527 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1528 name : 'target_url',
1537 displayField : 'template_clean',
1539 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1540 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1541 forceSelection : true,
1542 hiddenName : 'template_id',
1544 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1546 name : 'template_id_template_clean',
1548 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1549 selectOnFocus : true,
1550 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1551 triggerAction : 'all',
1556 '|xns' : 'Roo.form',
1560 sortInfo : { field: 'template', direction: 'ASC' },
1562 beforeload : function (_self, options)
1565 options.params._rescan = 1;
1566 options.params._clean_name = 1;
1567 // options.params.lang = 'en';
1568 options.params['!template[0]'] = 'master.html';
1569 //options.params['!template[1]'] = 'index.html';
1573 '|xns' : 'Roo.data',
1575 xtype : 'HttpProxy',
1577 url : baseURL + '/Roo/Cms_template',
1582 xtype : 'JsonReader',
1584 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1588 totalProperty : 'total',
1598 displayField : 'name',
1600 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1601 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1602 forceSelection : true,
1603 hiddenName : 'element_id',
1605 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1607 name : 'element_id_name',
1609 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1610 selectOnFocus : true,
1611 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1612 triggerAction : 'all',
1617 '|xns' : 'Roo.form',
1621 sortInfo : { field: 'name', direction: 'ASC' },
1623 beforeload : function (_self, options)
1625 var par = _this.form.findField('parent_id').getValue() * 1;
1627 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1631 options.params._cms_page_id = par;
1635 '|xns' : 'Roo.data',
1637 xtype : 'HttpProxy',
1639 url : baseURL + '/Roo/Cms_template_element',
1644 xtype : 'JsonReader',
1646 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1650 totalProperty : 'total',
1660 displayField : 'page_link',
1662 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1663 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1664 forceSelection : true,
1665 hiddenName : 'menu_page_id',
1667 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1669 name : 'menu_page_id_page_link',
1671 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1672 selectOnFocus : true,
1673 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>',
1674 triggerAction : 'all',
1679 '|xns' : 'Roo.form',
1683 sortInfo : { field: 'title', direction: 'ASC' },
1685 beforeload : function (_self, options)
1687 options.params = options.params || {};
1689 options.params['search[page_link_no_empty]'] =1;
1691 options.params['page_type_id_name[0]'] = 'page';
1692 options.params['page_type_id_name[1]'] = 'blog';
1694 options.params.is_element = 0;
1695 options.params.is_menuitem = 0;
1700 '|xns' : 'Roo.data',
1702 xtype : 'HttpProxy',
1704 url : baseURL + '/Roo/cms_page.php',
1709 xtype : 'JsonReader',
1724 "name":"page_type_id_display_name",
1730 totalProperty : 'total',
1737 xtype : 'ComboBoxArray',
1738 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1739 hiddenName : 'page_cls',
1740 name : 'page_cls_name',
1743 '|xns' : 'Roo.form',
1748 displayField : 'display_name',
1750 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1751 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1752 forceSelection : true,
1755 queryParam : 'query[search]',
1756 selectOnFocus : true,
1757 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1758 triggerAction : 'all',
1759 valueField : 'name',
1762 '|xns' : 'Roo.form',
1766 sortInfo : { direction : 'ASC', field: 'seqid' },
1768 beforeload : function (_self, o){
1769 o.params = o.params || {};
1771 o.params.etype = 'cms_page_class';
1775 '|xns' : 'Roo.data',
1777 xtype : 'HttpProxy',
1779 url : baseURL + '/Roo/core_enum.php',
1784 xtype : 'JsonReader',
1786 {"name":"id","type":"int"},
1787 {"name":"name","type":"string"},
1788 {"name":"display_name","type":"string"}
1792 totalProperty : 'total',
1806 '|xns' : 'Roo.form',
1812 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1813 style : 'width: 165px;',
1815 '|xns' : 'Roo.form',
1818 xtype : 'DisplayField',
1820 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1821 name : 'primary_image_id',
1822 style : 'border: 1px solid #ccc;',
1823 valueRenderer : function(v) {
1825 if (!v || v * 1 < 1) {
1826 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1829 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1842 render : function (_self)
1844 _this.interestsCol = _self;
1848 '|xns' : 'Roo.form',
1851 xtype : 'ComboBoxArray',
1852 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1853 hiddenName : 'interest',
1854 name : 'interest_name',
1857 render : function (_self)
1859 _this.interests = _self;
1861 _self.combo.addicon.setStyle( {
1862 position : 'absolute',
1871 '|xns' : 'Roo.form',
1876 displayField : 'display_name',
1878 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1879 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1880 forceSelection : true,
1883 queryParam : 'query[name]',
1884 selectOnFocus : true,
1885 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1886 triggerAction : 'all',
1890 '|xns' : 'Roo.form',
1894 sortInfo : { direction : 'ASC', field: 'name' },
1896 beforeload : function (_self, o){
1897 o.params = o.params || {};
1898 o.params.etype = 'crm_interest';
1902 '|xns' : 'Roo.data',
1904 xtype : 'HttpProxy',
1906 url : baseURL + '/Roo/Core_enum.php',
1911 xtype : 'JsonReader',
1913 {"name":"id","type":"int"},
1914 {"name":"name","type":"string"},
1915 {"name":"display_name","type":"string"}
1919 totalProperty : 'total',
1936 name : 'is_system_page',
1942 name : 'is_menuitem',
1948 name : 'page_type_id_name',
1955 render : function (_self)
1957 _this.user_defined_fields = _self;
1968 xtype : 'ContentPanel',
1970 fitContainer : true,
1973 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1982 url : baseURL + '/Roo/cms_page.php',
1984 rendered : function (form)
1990 '|xns' : 'Roo.form',
1996 '|xns' : 'Roo.form',
1999 xtype : 'HtmlEditor',
2000 autosave : function() {
2002 var body = _this.form1.findField('body');
2004 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2005 Roo.log('body not dirty');
2009 Roo.log('body dirty, auto save!');
2011 body.fireEvent('autosave', body);
2015 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2019 white : [ 'iframe' ],
2022 autosave : function (_self)
2024 Roo.log('autosave');
2026 var id = _this.form.findField('id').getValue() * 1;
2028 if(!_self.editorcore.sourceEditMode){
2035 url : baseURL + '/Roo/Events.php',
2039 action : 'AUTOSAVE',
2040 on_id : (id > 0) ? id : 0,
2041 on_table : 'cms_page',
2043 source: _self.getValue()
2045 success : function() {
2046 _self.originalValue = _self.getValue();
2049 failure : function()
2051 //Roo.MessageBox.alert("Error", "autosave failed");
2052 Roo.log('body autosave failed?!');
2057 savedpreview : function (_self)
2059 Roo.log('saved preview');
2061 var id = _this.form.findField('id').getValue() * 1;
2063 var successFn = function(res){
2064 return res.data.POST.source;
2068 action : 'AUTOSAVE',
2070 on_id : (id < 1) ? 0 : id,
2071 on_table : 'cms_page',
2072 successFn : successFn
2076 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2077 _self.setValue(res);
2078 _self.originalValue = res;
2081 stylesheetsclick : function (_self)
2083 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2084 _this.dialog.setStylesheets();
2090 '|xns' : 'Roo.form',
2093 xtype : 'ToolbarStandard',
2094 xns : Roo.form.HtmlEditor,
2095 '|xns' : 'Roo.form.HtmlEditor',
2100 displayField : 'name',
2102 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2103 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2104 forceSelection : true,
2106 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2109 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2110 queryParam : 'search',
2111 selectOnFocus : true,
2112 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>',
2113 triggerAction : 'all',
2118 beforequery : function (combo, query, forceAll, cancel, e)
2121 var id = _this.form.findField('id').getValue() * 1;
2123 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2127 render : function (_self)
2129 _this.bodyimgselect = _self;
2131 select : function (combo, record, index)
2138 var editor = _this.form.findField('body').editorcore;
2140 var curnode = editor.getSelectedNode();
2142 if (curnode && curnode.tagName == 'IMG') {
2143 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2144 baseURL, record.data.id, record.data.filename
2146 // note -forces an update... hopefully...
2147 editor.owner.fireEvent('editorevent', editor, false);
2150 editor.insertAtCursor(
2151 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2152 baseURL, record.data.id, record.data.filename
2161 '|xns' : 'Roo.form',
2165 sortInfo : { direction : 'ASC', field: 'id' },
2167 beforeload : function (_self, o){
2168 o.params = o.params || {};
2170 var id = _this.form.findField('id').getValue() * 1;
2172 Roo.MessageBox.alert("Error", "Save press release first");
2176 o.params.ontable = 'cms_page';
2177 // o.params.imgtype = 'PressRelease';
2178 //o.params['query[imagesize]'] = '150x150';
2183 '|xns' : 'Roo.data',
2185 xtype : 'HttpProxy',
2187 url : baseURL + '/Roo/Images.php',
2192 xtype : 'JsonReader',
2193 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2196 totalProperty : 'total',
2205 displayField : 'page_link',
2207 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2208 forceSelection : true,
2209 hiddenName : 'add_link_id',
2211 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2215 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2216 selectOnFocus : true,
2217 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2218 triggerAction : 'all',
2223 select : function (combo, record, index)
2229 var editor = _this.form.findField('body');
2230 editor.editorcore.insertAtCursor(
2231 String.format('<a href="#page-{0}">{1}</a>',
2232 record.data.page_link, record.data.title
2240 '|xns' : 'Roo.form',
2244 sortInfo : { field: 'page_link', direction: 'ASC' },
2246 beforeload : function (_self, options)
2248 options.params['search[page_link_no_empty]'] =1;
2250 options.params.is_element = 0;
2251 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2256 '|xns' : 'Roo.data',
2258 xtype : 'HttpProxy',
2260 url : baseURL + '/Roo/cms_page.php',
2265 xtype : 'JsonReader',
2267 { name: 'id', type: 'int' },
2273 totalProperty : 'total',
2280 xtype : 'Separator',
2282 '|xns' : 'Roo.Toolbar'
2286 cls : 'x-init-enable',
2287 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2289 click : function (_self, e)
2291 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2295 '|xns' : 'Roo.Toolbar'
2300 xtype : 'ToolbarContext',
2301 xns : Roo.form.HtmlEditor,
2302 '|xns' : 'Roo.form.HtmlEditor'
2313 xtype : 'ContentPanel',
2315 fitContainer : true,
2318 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2327 url : baseURL + '/Roo/cms_page.php',
2329 rendered : function (form)
2335 '|xns' : 'Roo.form',
2341 '|xns' : 'Roo.form',
2344 xtype : 'HtmlEditor',
2345 autosave : function() {
2347 var extended = _this.form2.findField('extended');
2349 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2350 Roo.log('extend not dirty');
2355 Roo.log('extend dirty, auto save!');
2357 extended.fireEvent('autosave', extended);
2359 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2363 white : [ 'iframe' ],
2366 autosave : function (_self)
2368 var id = _this.form.findField('id').getValue() * 1;
2371 if(!_self.editorcore.sourceEditMode){
2378 url : baseURL + '/Roo/Events.php',
2382 action : 'AUTOSAVE',
2383 on_id : (id > 0) ? id : 0,
2384 on_table : 'cms_page',
2385 remarks : 'EXTENDED',
2386 source: _self.getValue()
2388 success : function() {
2389 _self.originalValue = _self.getValue();
2392 failure : function()
2394 //Roo.MessageBox.alert("Error", "autosave failed");
2395 Roo.log('extended autosave failed?!');
2399 savedpreview : function (_self)
2401 var id = _this.form.findField('id').getValue() * 1;
2403 var successFn = function(res){
2404 return res.data.POST.source;
2408 action : 'AUTOSAVE',
2409 remarks : 'EXTENDED',
2410 on_id : (id < 1) ? 0 : id,
2411 on_table : 'cms_page',
2412 successFn : successFn
2416 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2417 _self.setValue(res);
2418 _self.originalValue = res;
2421 stylesheetsclick : function (_self)
2423 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2424 _this.dialog.setStylesheets();
2430 '|xns' : 'Roo.form',
2433 xtype : 'ToolbarStandard',
2434 xns : Roo.form.HtmlEditor,
2435 '|xns' : 'Roo.form.HtmlEditor',
2440 displayField : 'name',
2442 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2443 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2444 forceSelection : true,
2446 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2449 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2450 selectOnFocus : true,
2451 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2452 triggerAction : 'all',
2457 beforequery : function (combo, query, forceAll, cancel, e)
2460 var id = _this.form.findField('id').getValue() * 1;
2462 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2466 render : function (_self)
2468 _this.extendimgselect = _self;
2470 select : function (combo, record, index)
2477 var editor = _this.form.findField('extended').editorcore;
2479 var curnode = editor.getSelectedNode();
2481 if (curnode && curnode.tagName == 'IMG') {
2482 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2483 baseURL, record.data.id, record.data.filename
2485 // note -forces an update... hopefully...
2486 editor.owner.fireEvent('editorevent', editor, false);
2489 editor.insertAtCursor(
2490 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2491 baseURL, record.data.id, record.data.filename
2500 '|xns' : 'Roo.form',
2504 sortInfo : { direction : 'ASC', field: 'id' },
2506 beforeload : function (_self, o){
2507 o.params = o.params || {};
2509 var id = _this.form.findField('id').getValue() * 1;
2511 Roo.MessageBox.alert("Error", "Save press release first");
2515 o.params.ontable = 'cms_page';
2516 // o.params.imgtype = 'PressRelease';
2517 //o.params['query[imagesize]'] = '150x150';
2522 '|xns' : 'Roo.data',
2524 xtype : 'HttpProxy',
2526 url : baseURL + '/Roo/Images.php',
2531 xtype : 'JsonReader',
2532 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2535 totalProperty : 'total',
2544 displayField : 'page_link',
2546 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2547 forceSelection : true,
2548 hiddenName : 'add_link_id',
2550 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2554 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2555 selectOnFocus : true,
2556 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2557 triggerAction : 'all',
2562 select : function (combo, record, index)
2568 var editor = _this.form.findField('body');
2569 editor.editorcore.insertAtCursor(
2570 String.format('<a href="#page-{0}">{1}</a>',
2571 record.data.page_link, record.data.title
2579 '|xns' : 'Roo.form',
2583 sortInfo : { field: 'page_link', direction: 'ASC' },
2585 beforeload : function (_self, options)
2587 options.params['search[page_link_no_empty]'] =1;
2589 options.params.is_element = 0;
2590 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2595 '|xns' : 'Roo.data',
2597 xtype : 'HttpProxy',
2599 url : baseURL + '/Roo/cms_page.php',
2604 xtype : 'JsonReader',
2606 { name: 'id', type: 'int' },
2612 totalProperty : 'total',
2619 xtype : 'Separator',
2621 '|xns' : 'Roo.Toolbar'
2625 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2627 click : function (_self, e)
2629 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2633 '|xns' : 'Roo.Toolbar'
2638 xtype : 'ToolbarContext',
2639 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2640 xns : Roo.form.HtmlEditor,
2641 '|xns' : 'Roo.form.HtmlEditor'
2652 xtype : 'ContentPanel',
2654 fitContainer : true,
2657 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2666 url : baseURL + '/Roo/cms_page.php',
2668 rendered : function (form)
2674 '|xns' : 'Roo.form',
2680 '|xns' : 'Roo.form',
2684 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2698 xtype : 'ContentPanel',
2700 fitContainer : true,
2703 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2712 url : baseURL + '/Roo/cms_page.php',
2714 rendered : function (form)
2720 '|xns' : 'Roo.form',
2725 '|xns' : 'Roo.form',
2729 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2738 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2740 name : 'descriptions',
2755 xtype : 'GridPanel',
2757 fitContainer : true,
2760 tableName : 'Images',
2761 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2763 activate : function() {
2766 _this.grid.footer.onClick('first');
2773 xtype : 'EditorGrid',
2774 autoExpandColumn : 'title',
2778 render : function() {
2780 //_this.dialog = Pman.Dialog.FILL_IN
2781 if (_this.panel.active) {
2782 //this.footer.onClick('first');
2785 rowdblclick : function (_self, rowIndex, e)
2787 var rd = _this.grid.getDataSource().getAt(rowIndex);
2788 var id = rd.data.id;
2789 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2790 _this.form.findField('contents').execCmd('insertimage', url);
2795 '|xns' : 'Roo.grid',
2803 cls : 'x-btn-text-icon',
2804 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2805 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2809 var id = _this.form.findField('id').getValue() * 1;
2815 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2816 _this.grid.ds.load({});
2826 cls : 'x-btn-text-icon',
2827 icon : rootURL + '/Pman/templates/images/trash.gif',
2828 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2832 var selection = _this.grid.getSelectionModel().getSelectedCell();
2833 var sn = _this.grid.ds.getAt(selection[0]);
2834 if (!sn || isNaN(sn.id *1)) {
2835 Roo.MessageBox.alert("Error", "Select a image");
2838 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2844 url : baseURL + '/Roo/Images.php',
2849 success : function()
2851 Roo.log('Got Success!!');
2852 _this.grid.ds.load({});
2866 beforeload : function (_self, o)
2868 var id = _this.form.findField('id').getValue() * 1;
2874 o.params = o.params || {};
2875 o.params.limit = 9999;
2877 o.params.ontable = 'cms_page';
2879 update : function (_self, rec, operation)
2883 url : baseURL+'/Roo/Images.php',
2886 success: function(res)
2888 Roo.log("GOT success");
2889 // update the data...
2890 _this.grid.ds.load({});
2892 failure : function(res)
2894 Roo.MessageBox.alert('Error', res.errorMsg);
2895 _this.grid.ds.load({});
2903 '|xns' : 'Roo.data',
2905 xtype : 'HttpProxy',
2907 url : baseURL + '/Roo/Images.php',
2912 xtype : 'JsonReader',
2947 'name': 'displayorder',
2955 'name': 'parent_image_id',
2961 'dateFormat': 'Y-m-d'
2980 'name': 'parent_image_id_id',
2984 'name': 'parent_image_id_filename',
2988 'name': 'parent_image_id_ontable',
2992 'name': 'parent_image_id_onid',
2996 'name': 'parent_image_id_mimetype',
3000 'name': 'parent_image_id_width',
3004 'name': 'parent_image_id_height',
3008 'name': 'parent_image_id_filesize',
3012 'name': 'parent_image_id_displayorder',
3016 'name': 'parent_image_id_language',
3020 'name': 'parent_image_id_parent_image_id',
3024 'name': 'parent_image_id_created',
3028 'name': 'parent_image_id_imgtype',
3032 'name': 'parent_image_id_linkurl',
3036 'name': 'parent_image_id_descript',
3040 'name': 'parent_image_id_title',
3046 totalProperty : 'total',
3053 xtype : 'ColumnModel',
3055 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3056 renderer : function(v,x,r) {
3057 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3065 xtype : 'ColumnModel',
3066 dataIndex : 'filename',
3067 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3068 renderer : function(v) { return String.format('{0}', v); },
3074 xtype : 'ColumnModel',
3075 dataIndex : 'displayorder',
3076 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3077 renderer : function(v) { return String.format('{0}', v); },
3080 '|xns' : 'Roo.grid',
3082 xtype : 'GridEditor',
3084 '|xns' : 'Roo.grid',
3086 xtype : 'NumberField',
3087 decimalPrecision : 0,
3089 focus : function (_self)
3091 if (this.value == 0) {
3092 this.el.dom.value = '';
3102 xtype : 'ColumnModel',
3103 dataIndex : 'title',
3104 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3105 renderer : function(v) { return String.format('{0}', v); },
3108 '|xns' : 'Roo.grid',
3110 xtype : 'GridEditor',
3112 '|xns' : 'Roo.grid',
3114 xtype : 'TextField',
3121 xtype : 'ColumnModel',
3122 dataIndex : 'linkurl',
3123 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3124 renderer : function(v)
3126 return String.format('{0}', (v) ? v : '');
3130 '|xns' : 'Roo.grid',
3132 xtype : 'GridEditor',
3134 '|xns' : 'Roo.grid',
3136 xtype : 'TextField',
3146 xtype : 'NestedLayoutPanel',
3148 fitContainer : true,
3152 render : function (_self)
3154 _this.westLayoutPanel = this;
3161 xtype : 'BorderLayout',
3165 xtype : 'LayoutRegion',
3166 tabPosition : 'top',
3171 xtype : 'LayoutRegion',
3174 tabPosition : 'top',
3180 xtype : 'ContentPanel',
3185 render : function (_self)
3187 _this.trpanel = _self;
3189 resize : function (_self, width, height)
3191 Roo.log('resize called');
3193 var ew = Math.max(250, width - 10);
3194 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3197 if (!_this.trform) {
3201 var bd = _this.trform1.findField('body');
3206 // since render delays resize..
3207 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3208 // _this.trbodycol.el.setWidth(bd.width+20);
3210 var bd = _this.trform2.findField('extended');
3214 // since render delays resize..
3215 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3216 // _this.trextendcol.el.setWidth(bd.width+20);
3226 labelAlign : 'right',
3229 showHide : function() {
3231 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3232 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3233 var has_lang = _this.trform.findField('language').getValue().length;
3235 _this.westLayoutPanel.getLayout().getRegion('south').show();
3236 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3237 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3238 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3241 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3244 if(!has_extended && has_lang){
3245 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3246 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3254 var el = _this.trform.findField(k);
3255 el.actionMode = 'fieldEl';
3257 Roo.log("show: " + k);
3260 Roo.log("hide: " + k);
3265 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3268 if(typeof(_this.trform.editors) == 'undefined'){
3269 _this.trform.editors = {
3270 body : _this.trform1.findField('body').wrap.isVisible(),
3271 extended : _this.trform2.findField('extended').wrap.isVisible()
3273 if(_this.trform.editors.body){
3274 setInterval(_this.trform1.findField('body').autosave, 60000);
3277 if(_this.trform.editors.extended){
3278 setInterval(_this.trform2.findField('extended').autosave, 60000);
3282 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3283 setInterval(_this.trform1.findField('body').autosave, 60000);
3284 _this.trform.editors.body = true;
3287 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3288 setInterval(_this.trform2.findField('extended').autosave, 60000);
3289 _this.trform.editors.extended = true;
3294 style : 'margin: 5px',
3295 trackResetOnLoad : true,
3296 url : baseURL + '/Roo/cms_page.php',
3298 actioncomplete : function (_self, action)
3300 if (action.type =='submit') {
3304 if (action.type == 'setdata') {
3305 _this.trform.addForm(_this.trform1);
3306 _this.trform.addForm(_this.trform2);
3307 _this.trform.addForm(_this.trform3);
3309 if ( _this.data.id) {
3311 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3313 this.trpanel.el.mask("save first");
3320 if (action.type == 'load') {
3321 // _this.dialog.el.unmask();
3324 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3325 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3326 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3327 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3332 actionfailed : function (_self, action)
3334 _this.dialog.el.unmask();
3336 Pman.standardActionFailed(_self, action);
3338 rendered : function (_self)
3340 _this.trform = _self;
3344 '|xns' : 'Roo.form',
3351 '|xns' : 'Roo.form',
3358 '|xns' : 'Roo.form',
3363 displayField : 'language_name',
3365 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3366 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3367 forceSelection : true,
3368 hiddenName : 'language',
3370 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3372 name : 'language_name',
3374 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3375 selectOnFocus : true,
3376 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3377 triggerAction : 'all',
3379 valueField : 'language',
3381 add : function (combo)
3383 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3386 _this.trform.reset();
3387 _this.trform1.reset();
3388 _this.trform2.reset();
3390 combo.setValue(res.lang);
3391 combo.el.dom.value = res.lang_name;
3394 _this.trform.showHide();
3395 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3400 render : function (_self)
3402 _this.language = _self;
3404 select : function (combo, record, index)
3407 _this.trform.showHide();
3408 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3415 'lookup[language]' : record.data.language,
3416 'lookup[translation_of_id]' : _this.data.id,
3423 '|xns' : 'Roo.form',
3427 sortInfo : { direction : 'ASC', field: 'language' },
3429 beforeload : function (_self, o){
3430 o.params = o.params || {};
3432 o.params._distinct = 'language';
3433 o.params._columns ='language_name,language';
3434 o.params._with_name = true;
3436 if(_this.form.findField('id').getValue()*1 > 0){
3437 o.params.translation_of_id = _this.form.findField('id').getValue();
3443 '|xns' : 'Roo.data',
3445 xtype : 'HttpProxy',
3447 url : baseURL + '/Roo/Cms_page.php',
3452 xtype : 'JsonReader',
3453 fields : [{"name":"language","type":"string"}],
3456 totalProperty : 'total',
3464 style : 'padding-top:12px;padding-left:30px;float:left',
3467 render : function (_self)
3469 _this.updateRow = _self;
3473 '|xns' : 'Roo.form',
3477 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3481 // _this.dialog.el.mask("Saving");
3482 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3483 _this.trform1.findField('body').syncValue();
3484 _this.trform2.findField('extended').syncValue();
3486 _this.trform1.findField('body').pushValue();
3487 _this.trform2.findField('extended').pushValue();
3490 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3491 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3492 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3493 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3494 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3496 if(_this.trform.findField('element_id').getValue()*1 > 0){
3497 _this.trform.findField('is_element').setValue(1);
3500 _this.trform.doAction("submit");
3511 xtype : 'TextField',
3512 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3528 name : 'element_id',
3534 name : 'menu_page_id',
3540 name : 'is_menuitem',
3546 name : 'is_element',
3553 name : 'translation_of_id',
3568 xtype : 'ContentPanel',
3570 fitContainer : true,
3573 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3582 url : baseURL + '/Roo/cms_page.php',
3584 rendered : function (form)
3586 _this.trform1 = form;
3590 '|xns' : 'Roo.form',
3596 '|xns' : 'Roo.form',
3599 xtype : 'HtmlEditor',
3600 autosave : function() {
3602 var body = _this.trform1.findField('body');
3604 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3605 Roo.log('tr body not dirty');
3609 Roo.log('tr body dirty, auto save!');
3611 body.fireEvent('autosave', body);
3613 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3617 white : [ 'iframe' ],
3619 autosave : function (_self)
3621 var id = _this.trform.findField('id').getValue() * 1;
3624 if(!_self.editorcore.sourceEditMode){
3631 url : baseURL + '/Roo/Events.php',
3635 action : 'AUTOSAVE',
3636 on_id : (id > 0) ? id : 0,
3637 on_table : 'cms_page',
3639 source: _self.getValue()
3641 success : function() {
3642 _self.originalValue = _self.getValue();
3645 failure : function()
3647 //Roo.MessageBox.alert("Error", "autosave failed");
3648 Roo.log('tr body autosave failed?!');
3652 savedpreview : function (_self)
3654 var id = _this.trform.findField('id').getValue() * 1;
3656 var successFn = function(res){
3657 return res.data.POST.source;
3661 action : 'AUTOSAVE',
3663 on_id : (id < 1) ? 0 : id,
3664 on_table : 'cms_page',
3665 successFn : successFn
3669 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3670 _self.setValue(res);
3671 _self.originalValue = res;
3674 stylesheetsclick : function (_self)
3676 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3677 _this.dialog.setStylesheets();
3683 '|xns' : 'Roo.form',
3686 xtype : 'ToolbarStandard',
3687 xns : Roo.form.HtmlEditor,
3688 '|xns' : 'Roo.form.HtmlEditor',
3693 displayField : 'name',
3695 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3696 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3697 forceSelection : true,
3699 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3702 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3703 selectOnFocus : true,
3704 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>',
3705 triggerAction : 'all',
3710 beforequery : function (combo, query, forceAll, cancel, e)
3713 var id = _this.form.findField('id').getValue() * 1;
3715 Roo.MessageBox.alert("Error", "Save press release first");
3719 render : function (_self)
3721 _this.trbodyimgselect = _self;
3723 select : function (combo, record, index)
3730 var editor = _this.trform.findField('body').editorcore;
3732 var curnode = editor.getSelectedNode();
3734 if (curnode && curnode.tagName == 'IMG') {
3735 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3736 baseURL, record.data.id, record.data.filename
3738 // note -forces an update... hopefully...
3739 editor.owner.fireEvent('editorevent', editor, false);
3742 editor.insertAtCursor(
3743 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3744 baseURL, record.data.id, record.data.filename
3753 '|xns' : 'Roo.form',
3757 sortInfo : { direction : 'ASC', field: 'id' },
3759 beforeload : function (_self, o){
3760 o.params = o.params || {};
3762 var id = _this.form.findField('id').getValue() * 1;
3764 Roo.MessageBox.alert("Error", "Save press release first");
3768 o.params.ontable = 'cms_page';
3769 // o.params.imgtype = 'PressRelease';
3770 //o.params['query[imagesize]'] = '150x150';
3775 '|xns' : 'Roo.data',
3777 xtype : 'HttpProxy',
3779 url : baseURL + '/Roo/Images.php',
3784 xtype : 'JsonReader',
3785 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3788 totalProperty : 'total',
3797 displayField : 'page_link',
3799 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3800 forceSelection : true,
3801 hiddenName : 'add_link_id',
3803 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3807 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3808 selectOnFocus : true,
3809 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3810 triggerAction : 'all',
3815 select : function (combo, record, index)
3821 var editor = _this.form.findField('body');
3822 editor.insertAtCursor(
3823 String.format('<a href="#page-{0}">{1}</a>',
3824 record.data.page_link, record.data.title
3832 '|xns' : 'Roo.form',
3836 sortInfo : { field: 'page_link', direction: 'ASC' },
3838 beforeload : function (_self, options)
3840 options.params['search[page_link_no_empty]'] =1;
3842 options.params.is_element = 0;
3843 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3848 '|xns' : 'Roo.data',
3850 xtype : 'HttpProxy',
3852 url : baseURL + '/Roo/cms_page.php',
3857 xtype : 'JsonReader',
3859 { name: 'id', type: 'int' },
3865 totalProperty : 'total',
3872 xtype : 'Separator',
3874 '|xns' : 'Roo.Toolbar'
3878 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3880 click : function (_self, e)
3882 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3886 '|xns' : 'Roo.Toolbar'
3891 xtype : 'ToolbarContext',
3892 xns : Roo.form.HtmlEditor,
3893 '|xns' : 'Roo.form.HtmlEditor'
3904 xtype : 'ContentPanel',
3906 fitContainer : true,
3909 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3918 url : baseURL + '/Roo/cms_page.php',
3920 rendered : function (form)
3922 _this.trform2 = form;
3926 '|xns' : 'Roo.form',
3932 '|xns' : 'Roo.form',
3935 xtype : 'HtmlEditor',
3936 autosave : function() {
3938 var extended = _this.trform2.findField('extended');
3940 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3941 Roo.log('tr extend not dirty');
3946 Roo.log('tr extend dirty, auto save!');
3948 extended.fireEvent('autosave', extended);
3952 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3956 white : [ 'iframe' ],
3958 autosave : function (_self)
3960 var id = _this.trform.findField('id').getValue() * 1;
3963 if(!_self.editorcore.sourceEditMode){
3971 url : baseURL + '/Roo/Events.php',
3975 action : 'AUTOSAVE',
3976 on_id : (id > 0) ? id : 0,
3977 on_table : 'cms_page',
3978 remarks : 'EXTENDED',
3979 source: _self.getValue()
3981 success : function() {
3982 _self.originalValue = _self.getValue();
3985 failure : function()
3987 //Roo.MessageBox.alert("Error", "autosave failed");
3988 Roo.log('tr extended autosave failed?!');
3992 savedpreview : function (_self)
3994 var id = _this.trform.findField('id').getValue() * 1;
3996 var successFn = function(res){
3997 return res.data.POST.source;
4001 action : 'AUTOSAVE',
4002 remarks : 'EXTENDED',
4003 on_id : (id < 1) ? 0 : id,
4004 on_table : 'cms_page',
4005 successFn : successFn
4009 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4010 _self.setValue(res);
4011 _self.originalValue = res;
4014 stylesheetsclick : function (_self)
4016 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4017 _this.dialog.setStylesheets();
4023 '|xns' : 'Roo.form',
4026 xtype : 'ToolbarStandard',
4027 xns : Roo.form.HtmlEditor,
4028 '|xns' : 'Roo.form.HtmlEditor',
4031 xtype : 'Separator',
4033 '|xns' : 'Roo.Toolbar'
4037 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4039 click : function (_self, e)
4041 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4045 '|xns' : 'Roo.Toolbar'
4050 xtype : 'ToolbarContext',
4051 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4052 xns : Roo.form.HtmlEditor,
4053 '|xns' : 'Roo.form.HtmlEditor'
4064 xtype : 'ContentPanel',
4066 fitContainer : true,
4069 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4078 url : baseURL + '/Roo/cms_page.php',
4080 rendered : function (form)
4082 _this.trform3 = form;
4086 '|xns' : 'Roo.form',
4091 '|xns' : 'Roo.form',
4095 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4104 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4106 name : 'descriptions',