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();
224 var ew = Math.max(250, w-150); // was 350?/ why?
225 //var eh = Math.max(250, h-350) ;
228 var bd = _this.form1.findField('body');
233 // since render delays resize..
234 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
235 //_this.bodycol.el.setWidth(bd.width+20);
237 var bd = _this.form2.findField('extended');
241 // since render delays resize..
242 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
243 // _this.extendcol.el.setWidth(bd.width+20);
245 var bd = _this.form3.findField('extra_css');
248 //_this.keywordscol.el.setWidth(ew+20);
251 // fix messed up scroll.
252 _this.dialog.layout.el.dom.scrollTop = 0;
260 xtype : 'LayoutRegion',
266 xtype : 'LayoutRegion',
268 collapsedTitle : 'Images / Attachments',
272 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
275 expanded : function (_self)
277 var id = _this.form.findField('id').getValue() * 1;
280 Roo.MessageBox.alert('Error', 'Save first');
285 var w = Roo.lib.Dom.getViewWidth();
286 var h = Roo.lib.Dom.getViewHeight();
288 _self.resizeTo.defer(110, _self,[ w-400, h] );
289 _this.dialog.getLayout().getRegion('west').collapse();
296 xtype : 'LayoutRegion',
298 collapsedTitle : 'Translations',
302 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
305 beforecollapse : function (_self)
307 if(!_this.trform || !_this.trform1 || !_this.trform2){
312 !_this.trform.isDirty() &&
313 !_this.trform1.isDirty() &&
314 !_this.trform2.isDirty() &&
315 !_this.trform3.isDirty()
320 Roo.MessageBox.confirm(
322 "Do you want to save the translation",
325 _self.collapse(true, true);
335 expanded : function (_self)
337 var id = _this.form.findField('id').getValue() * 1;
340 Roo.MessageBox.alert('Error', 'Save first');
345 var w = Roo.lib.Dom.getViewWidth();
346 var h = Roo.lib.Dom.getViewHeight();
348 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
350 _this.panel.region.collapse();
360 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
364 var page_link = _this.form.findField('page_link').getValue();
366 if(!page_link.length){
367 Roo.MessageBox.alert('Error', 'Please fill in the page link');
371 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
372 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
376 var url = uiConfig.cms_page_preview_base + page_link;
386 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
391 _this.trform.isDirty() ||
392 _this.trform1.isDirty() ||
393 _this.trform2.isDirty() ||
394 _this.trform3.isDirty()
396 Roo.MessageBox.confirm(
398 "Do you want to save the translation",
424 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
429 if(!_this.form1.findField('body').editorcore.sourceEditMode){
430 _this.form1.findField('body').syncValue();
431 _this.form2.findField('extended').syncValue();
432 Roo.log('syncValue');
434 _this.form1.findField('body').pushValue();
435 _this.form2.findField('extended').pushValue();
436 Roo.log('pushValue');
439 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
440 _this.interests.reset();
444 _this.trform.isDirty() ||
445 _this.trform1.isDirty() ||
446 _this.trform2.isDirty() ||
447 _this.trform3.isDirty()
449 Roo.MessageBox.confirm(
451 "Do you want to save the translation",
454 _this.dialog.el.mask("Saving");
455 _this.form.doAction("submit");
465 _this.dialog.el.mask("Saving");
466 _this.form.doAction("submit");
475 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
481 if(!_this.form1.findField('body').editorcore.sourceEditMode){
482 _this.form1.findField('body').syncValue();
483 _this.form2.findField('extended').syncValue();
485 _this.form1.findField('body').pushValue();
486 _this.form2.findField('extended').pushValue();
489 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
490 _this.interests.reset();
495 _this.trform.isDirty() ||
496 _this.trform1.isDirty() ||
497 _this.trform2.isDirty() ||
498 _this.trform3.isDirty()
500 Roo.MessageBox.confirm(
502 "Do you want to save the translation",
505 _this.dialog.el.mask("Saving");
506 _this.form.doAction("submit");
516 _this.dialog.el.mask("Saving");
517 _this.form.doAction("submit");
527 xtype : 'NestedLayoutPanel',
533 render : function (_self)
535 _this.centerLayoutPanel = this;
542 xtype : 'BorderLayout',
546 xtype : 'LayoutRegion',
552 xtype : 'LayoutRegion',
561 xtype : 'ContentPanel',
566 render : function (_self)
568 _this.cpanel = _self;
570 resize : function (_self, width, height)
572 Roo.log("RESIZE, " + width + ',' + height);
574 var ew = Math.max(250, width - 10);
575 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
582 bd = _this.form1.findField('body');
586 // since render delays resize..
587 Roo.log('resizing body to ' + bd.width);
588 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
589 // _this.bodycol.el.setWidth(bd.width+20);
594 bd = _this.form2.findField('extended');
600 Roo.log('resizing extended to ' + bd.width);
601 // since render delays resize..
602 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
603 // _this.extendcol.el.setWidth(bd.width+20);
608 bd = _this.form3.findField('extra_css');
612 // _this.keywordscol.el.setWidth(ew+20);
614 // fix for messed up rendering of dialog?
618 _this.dialog.layout.el.dom.scrollTop = 0;
620 // noop... - the above sometimes fails...
633 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
635 click : function (_self, e)
637 if (_this.dialog.getLayout().getRegion('west').collapsed) {
638 _this.dialog.getLayout().getRegion('west').expand();
640 _this.dialog.getLayout().getRegion('west').collapse();
646 '|xns' : 'Roo.Toolbar'
651 '|xns' : 'Roo.Toolbar'
655 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
657 click : function (_self, e)
659 if (_this.panel.region.collapsed) {
660 _this.panel.region.expand();
662 _this.panel.region.collapse();
668 '|xns' : 'Roo.Toolbar'
677 _this.form.setValues(_this.data);
681 _this.dialog.el.unmask();
682 _this.grid.getDataSource().load();
684 _this.trform.reset();
685 _this.trform1.reset();
686 _this.trform2.reset();
688 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
689 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
692 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
693 catlabel.dom.innerHTML = 'Category';
695 if(_this.data.page_type_id_name == 'category'){
696 catlabel.dom.innerHTML = 'Parent Category';
700 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
701 catlabel.dom.innerHTML = 'Parent page';
702 if(_this.data.page_type_id_name == 'category'){
703 catlabel.dom.innerHTML = 'Parent';
706 // better if this was not here... - not sure which project uses it?
708 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
709 _this.interestsCol.show();
712 if(typeof(d['interests']) != 'undefined'){
713 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
716 if(typeof(d['categories']) != 'undefined'){
717 _this.form.findField('category').setValue(Roo.decode(d['categories']));
720 if(typeof(d['page_classes']) != 'undefined'){
721 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
724 _this.trpanel.el.unmask();
725 _this.panel.el.unmask();
728 _this.cpanel.el.dom.scrollTop = 0;
730 // fix messed up scroll.
731 _this.dialog.layout.el.dom.scrollTop = 0;
734 labelAlign : 'right',
737 showHide : function()
744 var page_type_name = _this.form.findField('page_type_id_name').getValue();
746 switch(page_type_name){
769 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
770 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
771 var has_extended = _this.form.findField('has_extended').getValue() * 1;
774 is_attachment : !in_rss,
776 category_type_id : in_rss && !is_menu,
777 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
778 target_url : is_menu,
780 category : !is_category,
782 parent_id : !in_rss || is_category ,
785 to_replace_id :false, // !in_rss, // is this used.
786 is_draft : !is_system_page,
787 author_id : in_rss && !is_menu && !is_attachment,
789 template_id : !is_attachment && !is_menu && !is_system_page,
790 element_id : is_element && !is_menu,
791 menu_page_id : is_menu,
792 page_cls : is_element
794 // has_extended : !is_menu && !is_attachment, // always shown.
795 // extended : has_extended && !is_menu && !is_attachment,
796 // body : !is_attachment && !is_menu,
797 //keywords : !is_attachment && !is_menu,
798 // descriptions : !is_attachment && !is_menu
799 // extra_css : !is_attachment && !is_menu
803 var el = _this.form.findField(k);
806 Roo.log("missing field " + k);
810 el.actionMode = 'fieldEl';
820 _this.centerLayoutPanel.getLayout().getRegion('south').show();
821 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
822 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
823 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
824 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
826 if(is_attachment || is_menu){
828 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
832 if(!has_extended && !is_attachment && !is_menu){
833 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
834 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
838 _this.trform.showHide();
840 if(typeof(_this.form.editors) == 'undefined'){
841 _this.form.editors = {
842 body : _this.form1.findField('body').wrap.isVisible(),
843 extended : _this.form2.findField('extended').wrap.isVisible()
846 if(_this.form.editors.body){
847 setInterval(_this.form1.findField('body').autosave, 60000);
850 if(_this.form.editors.extended){
851 setInterval(_this.form2.findField('extended').autosave, 60000);
855 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
856 setInterval(_this.form1.findField('body').autosave, 60000);
857 _this.form.editors.body = true;
860 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
861 setInterval(_this.form2.findField('extended').autosave, 60000);
862 _this.form.editors.extended = true;
868 style : 'margin: 5px',
869 url : baseURL + '/Roo/cms_page.php',
871 actioncomplete : function (_self, action)
874 if (action.type == 'setdata') {
876 _this.form.addForm(_this.form1);
877 _this.form.addForm(_this.form2);
878 _this.form.addForm(_this.form3);
879 _this.form.addForm(_this.form4);
881 _this.dialog.setStylesheets();
883 _this.dialog.getLayout().getRegion('west').collapse();
884 _this.panel.region.collapse();
886 _this.trpanel.el.mask('Save first');
887 _this.panel.el.mask('Save first');
889 _this.loaded = false;
890 _this.interestsCol.hide();
892 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
894 if ( _this.data.id) {
895 _this.dialog.el.mask("Loading");
896 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
900 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
901 this.findField('is_draft').setValue(is_draft);
902 _this.page_type.setValue(_this.data.page_type_id);
903 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
905 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
906 _this.interestsCol.show();
909 _this.form.showHide();
912 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
913 catlabel.dom.innerHTML = 'Category';
914 if(_this.data.page_type_id_name == 'category'){
915 catlabel.dom.innerHTML = 'Parent Category';
920 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
921 catlabel.dom.innerHTML = 'Parent page';
922 if(_this.data.page_type_id_name == 'category'){
923 catlabel.dom.innerHTML = 'Parent';
929 if(_this.data._is_copy){
930 _this.form.is_copy();
936 if (action.type == 'load') {
938 //_this.data = action.result.data;
940 var d = action.result.data;
942 _this.dialog.el.unmask();
943 _this.grid.getDataSource().load();
945 _this.trform.reset();
946 _this.trform1.reset();
947 _this.trform2.reset();
949 _this.trform.addForm(_this.trform1);
950 _this.trform.addForm(_this.trform2);
952 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
953 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
954 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
955 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
956 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
959 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
960 catlabel.dom.innerHTML = 'Category';
962 if(_this.data.page_type_id_name == 'category'){
963 catlabel.dom.innerHTML = 'Parent Category';
967 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
968 catlabel.dom.innerHTML = 'Parent page';
969 if(_this.data.page_type_id_name == 'category'){
970 catlabel.dom.innerHTML = 'Parent';
973 // better if this was not here... - not sure which project uses it?
975 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
976 _this.interestsCol.show();
979 if(typeof(d['interests']) != 'undefined'){
980 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
983 if(typeof(d['categories']) != 'undefined'){
984 _this.form.findField('category').setValue(Roo.decode(d['categories']));
987 if(typeof(d['page_classes']) != 'undefined'){
988 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
991 _this.trpanel.el.unmask();
992 _this.panel.el.unmask();
995 _this.cpanel.el.dom.scrollTop = 0;
997 // fix messed up scroll.
998 _this.dialog.layout.el.dom.scrollTop = 0;
1002 if (action.type =='submit') {
1004 _this.dialog.el.unmask();
1007 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1011 _this.dialog.hide();
1014 if (_this.callback) {
1015 _this.callback.call(_this, action.result.data);
1021 actionfailed : function (_self, action)
1023 _this.dialog.el.unmask();
1024 Pman.standardActionFailed(_self, action);
1026 rendered : function (_self)
1032 '|xns' : 'Roo.form',
1039 '|xns' : 'Roo.form',
1044 labelAlign : 'right',
1046 style : 'height:30px;overflow:hidden',
1049 '|xns' : 'Roo.form',
1053 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1062 style : 'height:30px;overflow:hidden',
1065 '|xns' : 'Roo.form',
1070 displayField : 'display_name',
1072 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1073 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1074 forceSelection : true,
1075 hiddenName : 'page_type_id',
1077 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1079 name : 'page_type_id_display_name',
1081 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1082 selectOnFocus : true,
1083 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1084 triggerAction : 'all',
1088 render : function (_self)
1090 _this.page_type = _self;
1092 select : function (combo, record, index)
1094 // _this.grid.footer.onClick('first');
1095 var page_type_name = record.data.name;
1096 _this.form.findField('page_type_id_name').setValue(page_type_name);
1097 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1098 _this.form.findField('is_attachment').setValue(0);
1102 _this.form.showHide.defer(100, _this.form);
1108 '|xns' : 'Roo.form',
1112 sortInfo : { direction : 'ASC', field: 'seqid' },
1114 beforeload : function (_self, o){
1115 o.params = o.params || {};
1117 o.params.etype = 'cms_page_type';
1121 '|xns' : 'Roo.data',
1123 xtype : 'HttpProxy',
1125 url : baseURL + '/Roo/core_enum.php',
1130 xtype : 'JsonReader',
1131 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1134 totalProperty : 'total',
1143 style : 'padding-left: -70px;',
1146 '|xns' : 'Roo.form',
1149 xtype : 'NumberField',
1150 decimalPrecision : 0,
1151 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1166 labelAlign : 'right',
1168 style : 'height:30px;overflow:hidden',
1171 '|xns' : 'Roo.form',
1175 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1184 style : 'height:30px;overflow:hidden',
1187 '|xns' : 'Roo.form',
1191 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1192 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1200 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1202 name : 'has_extended',
1205 check : function (_self, checked)
1210 _this.form.showHide();
1211 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1222 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1224 name : 'is_attachment',
1227 check : function (_self, checked)
1231 _this.form.showHide.defer(100, _this.form);
1245 displayField : 'name',
1247 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1248 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1249 forceSelection : true,
1250 hiddenName : 'author_id',
1252 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1254 name : 'author_id_name',
1256 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1257 queryParam : 'query[name]',
1258 selectOnFocus : true,
1259 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1260 triggerAction : 'all',
1265 '|xns' : 'Roo.form',
1269 sortInfo : { direction : 'ASC', field: 'name' },
1271 beforeload : function (_self, o){
1272 o.params = o.params || {};
1274 o.params.active = 1;
1275 o.params['query[is_owner]'] = 1;
1279 '|xns' : 'Roo.data',
1281 xtype : 'HttpProxy',
1283 url : baseURL + '/Roo/core_person',
1288 xtype : 'JsonReader',
1289 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1292 totalProperty : 'total',
1299 xtype : 'ComboBoxArray',
1300 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1301 hiddenName : 'category',
1302 name : 'category_name',
1305 '|xns' : 'Roo.form',
1310 displayField : 'display_fullpath',
1312 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1313 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1314 forceSelection : true,
1318 queryParam : 'search[name]',
1319 selectOnFocus : true,
1320 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1321 triggerAction : 'all',
1325 '|xns' : 'Roo.form',
1329 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1331 beforeload : function (_self, o){
1332 o.params = o.params || {};
1334 o.params.page_type_id_name= 'CATEGORY';
1336 o.params._with_fullpath = 1;
1340 '|xns' : 'Roo.data',
1342 xtype : 'HttpProxy',
1344 url : baseURL + '/Roo/cms_page.php',
1349 xtype : 'JsonReader',
1351 {"name":"id","type":"int"},
1352 {"name":"name","type":"string"},
1353 {"name":"display_name","type":"string"}
1357 totalProperty : 'total',
1368 displayField : 'page_link',
1370 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1371 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1372 forceSelection : true,
1373 hiddenName : 'parent_id',
1375 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1377 name : 'parent_id_title',
1379 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1380 selectOnFocus : true,
1381 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1382 triggerAction : 'all',
1387 select : function (combo, record, index)
1389 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1390 if (page_type_name == 'page') { // page
1393 // do not default to put 'Home' at the beginning.
1394 if (!record || !(record.data.parent_id *1)) {
1397 var pl = _this.form.findField('page_link');
1398 var lk = pl.getValue();
1399 var new_link = record.data.page_link + '/';
1401 new_link += lk.split('/').pop();
1403 pl.setValue(new_link);
1408 '|xns' : 'Roo.form',
1412 sortInfo : { field: 'page_link', direction: 'ASC' },
1414 beforeload : function (_self, options)
1416 options.params['search[page_link_no_empty]'] =1;
1418 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1419 options.params._page_type = 'page,element';
1421 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1424 var id = _this.form.findField('id').getValue() * 1;
1427 options.params['!id'] = id;
1432 options.params.is_element = 0;
1433 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1434 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1439 '|xns' : 'Roo.data',
1441 xtype : 'HttpProxy',
1443 url : baseURL + '/Roo/cms_page.php',
1448 xtype : 'JsonReader',
1450 { name: 'id', type: 'int' },
1456 totalProperty : 'total',
1466 '|xns' : 'Roo.form',
1469 xtype : 'DateField',
1470 altFormats : 'Y-m-d H:i:s',
1471 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1479 xtype : 'TextField',
1480 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1481 name : 'to_replace_id',
1489 xtype : 'TextField',
1490 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1494 keyup : function (_self, e)
1496 if (_this.page_type.getRawValue() == 'Category') {
1498 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1507 xtype : 'TextField',
1508 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1515 xtype : 'TextField',
1516 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1517 name : 'target_url',
1526 displayField : 'template_clean',
1528 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1529 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1530 forceSelection : true,
1531 hiddenName : 'template_id',
1533 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1535 name : 'template_id_template_clean',
1537 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1538 selectOnFocus : true,
1539 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1540 triggerAction : 'all',
1545 '|xns' : 'Roo.form',
1549 sortInfo : { field: 'template', direction: 'ASC' },
1551 beforeload : function (_self, options)
1554 options.params._rescan = 1;
1555 options.params._clean_name = 1;
1556 // options.params.lang = 'en';
1557 options.params['!template[0]'] = 'master.html';
1558 //options.params['!template[1]'] = 'index.html';
1562 '|xns' : 'Roo.data',
1564 xtype : 'HttpProxy',
1566 url : baseURL + '/Roo/Cms_template',
1571 xtype : 'JsonReader',
1573 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1577 totalProperty : 'total',
1587 displayField : 'name',
1589 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1590 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1591 forceSelection : true,
1592 hiddenName : 'element_id',
1594 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1596 name : 'element_id_name',
1598 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1599 selectOnFocus : true,
1600 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1601 triggerAction : 'all',
1606 '|xns' : 'Roo.form',
1610 sortInfo : { field: 'name', direction: 'ASC' },
1612 beforeload : function (_self, options)
1614 var par = _this.form.findField('parent_id').getValue() * 1;
1616 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1620 options.params._cms_page_id = par;
1624 '|xns' : 'Roo.data',
1626 xtype : 'HttpProxy',
1628 url : baseURL + '/Roo/Cms_template_element',
1633 xtype : 'JsonReader',
1635 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1639 totalProperty : 'total',
1649 displayField : 'page_link',
1651 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1652 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1653 forceSelection : true,
1654 hiddenName : 'menu_page_id',
1656 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1658 name : 'menu_page_id_page_link',
1660 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1661 selectOnFocus : true,
1662 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>',
1663 triggerAction : 'all',
1668 '|xns' : 'Roo.form',
1672 sortInfo : { field: 'title', direction: 'ASC' },
1674 beforeload : function (_self, options)
1676 options.params = options.params || {};
1678 options.params['search[page_link_no_empty]'] =1;
1680 options.params['page_type_id_name[0]'] = 'page';
1681 options.params['page_type_id_name[1]'] = 'blog';
1683 options.params.is_element = 0;
1684 options.params.is_menuitem = 0;
1689 '|xns' : 'Roo.data',
1691 xtype : 'HttpProxy',
1693 url : baseURL + '/Roo/cms_page.php',
1698 xtype : 'JsonReader',
1713 "name":"page_type_id_display_name",
1719 totalProperty : 'total',
1726 xtype : 'ComboBoxArray',
1727 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1728 hiddenName : 'page_cls',
1729 name : 'page_cls_name',
1732 '|xns' : 'Roo.form',
1737 displayField : 'display_name',
1739 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1740 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1741 forceSelection : true,
1744 queryParam : 'query[search]',
1745 selectOnFocus : true,
1746 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1747 triggerAction : 'all',
1748 valueField : 'name',
1751 '|xns' : 'Roo.form',
1755 sortInfo : { direction : 'ASC', field: 'seqid' },
1757 beforeload : function (_self, o){
1758 o.params = o.params || {};
1760 o.params.etype = 'cms_page_class';
1764 '|xns' : 'Roo.data',
1766 xtype : 'HttpProxy',
1768 url : baseURL + '/Roo/core_enum.php',
1773 xtype : 'JsonReader',
1775 {"name":"id","type":"int"},
1776 {"name":"name","type":"string"},
1777 {"name":"display_name","type":"string"}
1781 totalProperty : 'total',
1795 '|xns' : 'Roo.form',
1801 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1802 style : 'width: 165px;',
1804 '|xns' : 'Roo.form',
1807 xtype : 'DisplayField',
1809 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1810 name : 'primary_image_id',
1811 style : 'border: 1px solid #ccc;',
1812 valueRenderer : function(v) {
1814 if (!v || v * 1 < 1) {
1815 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1818 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1831 render : function (_self)
1833 _this.interestsCol = _self;
1837 '|xns' : 'Roo.form',
1840 xtype : 'ComboBoxArray',
1841 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1842 hiddenName : 'interest',
1843 name : 'interest_name',
1846 render : function (_self)
1848 _this.interests = _self;
1850 _self.combo.addicon.setStyle( {
1851 position : 'absolute',
1860 '|xns' : 'Roo.form',
1865 displayField : 'display_name',
1867 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1868 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1869 forceSelection : true,
1872 queryParam : 'query[name]',
1873 selectOnFocus : true,
1874 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1875 triggerAction : 'all',
1879 '|xns' : 'Roo.form',
1883 sortInfo : { direction : 'ASC', field: 'name' },
1885 beforeload : function (_self, o){
1886 o.params = o.params || {};
1887 o.params.etype = 'crm_interest';
1891 '|xns' : 'Roo.data',
1893 xtype : 'HttpProxy',
1895 url : baseURL + '/Roo/Core_enum.php',
1900 xtype : 'JsonReader',
1902 {"name":"id","type":"int"},
1903 {"name":"name","type":"string"},
1904 {"name":"display_name","type":"string"}
1908 totalProperty : 'total',
1925 name : 'is_system_page',
1931 name : 'is_menuitem',
1937 name : 'page_type_id_name',
1944 render : function (_self)
1946 _this.user_defined_fields = _self;
1957 xtype : 'ContentPanel',
1959 fitContainer : true,
1962 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1971 url : baseURL + '/Roo/cms_page.php',
1973 rendered : function (form)
1979 '|xns' : 'Roo.form',
1985 '|xns' : 'Roo.form',
1988 xtype : 'HtmlEditor',
1989 autosave : function() {
1991 var body = _this.form1.findField('body');
1993 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
1994 Roo.log('body not dirty');
1998 Roo.log('body dirty, auto save!');
2000 body.fireEvent('autosave', body);
2004 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2008 white : [ 'iframe' ],
2011 autosave : function (_self)
2013 Roo.log('autosave');
2015 var id = _this.form.findField('id').getValue() * 1;
2017 if(!_self.editorcore.sourceEditMode){
2024 url : baseURL + '/Roo/Events.php',
2028 action : 'AUTOSAVE',
2029 on_id : (id > 0) ? id : 0,
2030 on_table : 'cms_page',
2032 source: _self.getValue()
2034 success : function() {
2035 _self.originalValue = _self.getValue();
2038 failure : function()
2040 //Roo.MessageBox.alert("Error", "autosave failed");
2041 Roo.log('body autosave failed?!');
2046 savedpreview : function (_self)
2048 Roo.log('saved preview');
2050 var id = _this.form.findField('id').getValue() * 1;
2052 var successFn = function(res){
2053 return res.data.POST.source;
2057 action : 'AUTOSAVE',
2059 on_id : (id < 1) ? 0 : id,
2060 on_table : 'cms_page',
2061 successFn : successFn
2065 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2066 _self.setValue(res);
2067 _self.originalValue = res;
2070 stylesheetsclick : function (_self)
2072 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2073 _this.dialog.setStylesheets();
2079 '|xns' : 'Roo.form',
2082 xtype : 'ToolbarStandard',
2083 xns : Roo.form.HtmlEditor,
2084 '|xns' : 'Roo.form.HtmlEditor',
2089 displayField : 'name',
2091 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2092 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2093 forceSelection : true,
2095 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2098 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2099 queryParam : 'search',
2100 selectOnFocus : true,
2101 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>',
2102 triggerAction : 'all',
2107 beforequery : function (combo, query, forceAll, cancel, e)
2110 var id = _this.form.findField('id').getValue() * 1;
2112 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2116 render : function (_self)
2118 _this.bodyimgselect = _self;
2120 select : function (combo, record, index)
2127 var editor = _this.form.findField('body').editorcore;
2129 var curnode = editor.getSelectedNode();
2131 if (curnode && curnode.tagName == 'IMG') {
2132 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2133 baseURL, record.data.id, record.data.filename
2135 // note -forces an update... hopefully...
2136 editor.owner.fireEvent('editorevent', editor, false);
2139 editor.insertAtCursor(
2140 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2141 baseURL, record.data.id, record.data.filename
2150 '|xns' : 'Roo.form',
2154 sortInfo : { direction : 'ASC', field: 'id' },
2156 beforeload : function (_self, o){
2157 o.params = o.params || {};
2159 var id = _this.form.findField('id').getValue() * 1;
2161 Roo.MessageBox.alert("Error", "Save press release first");
2165 o.params.ontable = 'cms_page';
2166 // o.params.imgtype = 'PressRelease';
2167 //o.params['query[imagesize]'] = '150x150';
2172 '|xns' : 'Roo.data',
2174 xtype : 'HttpProxy',
2176 url : baseURL + '/Roo/Images.php',
2181 xtype : 'JsonReader',
2182 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2185 totalProperty : 'total',
2194 displayField : 'page_link',
2196 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2197 forceSelection : true,
2198 hiddenName : 'add_link_id',
2200 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2204 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2205 selectOnFocus : true,
2206 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2207 triggerAction : 'all',
2212 select : function (combo, record, index)
2218 var editor = _this.form.findField('body');
2219 editor.editorcore.insertAtCursor(
2220 String.format('<a href="#page-{0}">{1}</a>',
2221 record.data.page_link, record.data.title
2229 '|xns' : 'Roo.form',
2233 sortInfo : { field: 'page_link', direction: 'ASC' },
2235 beforeload : function (_self, options)
2237 options.params['search[page_link_no_empty]'] =1;
2239 options.params.is_element = 0;
2240 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2245 '|xns' : 'Roo.data',
2247 xtype : 'HttpProxy',
2249 url : baseURL + '/Roo/cms_page.php',
2254 xtype : 'JsonReader',
2256 { name: 'id', type: 'int' },
2262 totalProperty : 'total',
2269 xtype : 'Separator',
2271 '|xns' : 'Roo.Toolbar'
2275 cls : 'x-init-enable',
2276 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2278 click : function (_self, e)
2280 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2284 '|xns' : 'Roo.Toolbar'
2289 xtype : 'ToolbarContext',
2290 xns : Roo.form.HtmlEditor,
2291 '|xns' : 'Roo.form.HtmlEditor'
2302 xtype : 'ContentPanel',
2304 fitContainer : true,
2307 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2316 url : baseURL + '/Roo/cms_page.php',
2318 rendered : function (form)
2324 '|xns' : 'Roo.form',
2330 '|xns' : 'Roo.form',
2333 xtype : 'HtmlEditor',
2334 autosave : function() {
2336 var extended = _this.form2.findField('extended');
2338 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2339 Roo.log('extend not dirty');
2344 Roo.log('extend dirty, auto save!');
2346 extended.fireEvent('autosave', extended);
2348 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2352 white : [ 'iframe' ],
2355 autosave : function (_self)
2357 var id = _this.form.findField('id').getValue() * 1;
2360 if(!_self.editorcore.sourceEditMode){
2367 url : baseURL + '/Roo/Events.php',
2371 action : 'AUTOSAVE',
2372 on_id : (id > 0) ? id : 0,
2373 on_table : 'cms_page',
2374 remarks : 'EXTENDED',
2375 source: _self.getValue()
2377 success : function() {
2378 _self.originalValue = _self.getValue();
2381 failure : function()
2383 //Roo.MessageBox.alert("Error", "autosave failed");
2384 Roo.log('extended autosave failed?!');
2388 savedpreview : function (_self)
2390 var id = _this.form.findField('id').getValue() * 1;
2392 var successFn = function(res){
2393 return res.data.POST.source;
2397 action : 'AUTOSAVE',
2398 remarks : 'EXTENDED',
2399 on_id : (id < 1) ? 0 : id,
2400 on_table : 'cms_page',
2401 successFn : successFn
2405 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2406 _self.setValue(res);
2407 _self.originalValue = res;
2410 stylesheetsclick : function (_self)
2412 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2413 _this.dialog.setStylesheets();
2419 '|xns' : 'Roo.form',
2422 xtype : 'ToolbarStandard',
2423 xns : Roo.form.HtmlEditor,
2424 '|xns' : 'Roo.form.HtmlEditor',
2429 displayField : 'name',
2431 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2432 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2433 forceSelection : true,
2435 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2438 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2439 selectOnFocus : true,
2440 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2441 triggerAction : 'all',
2446 beforequery : function (combo, query, forceAll, cancel, e)
2449 var id = _this.form.findField('id').getValue() * 1;
2451 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2455 render : function (_self)
2457 _this.extendimgselect = _self;
2459 select : function (combo, record, index)
2466 var editor = _this.form.findField('extended').editorcore;
2468 var curnode = editor.getSelectedNode();
2470 if (curnode && curnode.tagName == 'IMG') {
2471 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2472 baseURL, record.data.id, record.data.filename
2474 // note -forces an update... hopefully...
2475 editor.owner.fireEvent('editorevent', editor, false);
2478 editor.insertAtCursor(
2479 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2480 baseURL, record.data.id, record.data.filename
2489 '|xns' : 'Roo.form',
2493 sortInfo : { direction : 'ASC', field: 'id' },
2495 beforeload : function (_self, o){
2496 o.params = o.params || {};
2498 var id = _this.form.findField('id').getValue() * 1;
2500 Roo.MessageBox.alert("Error", "Save press release first");
2504 o.params.ontable = 'cms_page';
2505 // o.params.imgtype = 'PressRelease';
2506 //o.params['query[imagesize]'] = '150x150';
2511 '|xns' : 'Roo.data',
2513 xtype : 'HttpProxy',
2515 url : baseURL + '/Roo/Images.php',
2520 xtype : 'JsonReader',
2521 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2524 totalProperty : 'total',
2533 displayField : 'page_link',
2535 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2536 forceSelection : true,
2537 hiddenName : 'add_link_id',
2539 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2543 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2544 selectOnFocus : true,
2545 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2546 triggerAction : 'all',
2551 select : function (combo, record, index)
2557 var editor = _this.form.findField('body');
2558 editor.editorcore.insertAtCursor(
2559 String.format('<a href="#page-{0}">{1}</a>',
2560 record.data.page_link, record.data.title
2568 '|xns' : 'Roo.form',
2572 sortInfo : { field: 'page_link', direction: 'ASC' },
2574 beforeload : function (_self, options)
2576 options.params['search[page_link_no_empty]'] =1;
2578 options.params.is_element = 0;
2579 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2584 '|xns' : 'Roo.data',
2586 xtype : 'HttpProxy',
2588 url : baseURL + '/Roo/cms_page.php',
2593 xtype : 'JsonReader',
2595 { name: 'id', type: 'int' },
2601 totalProperty : 'total',
2608 xtype : 'Separator',
2610 '|xns' : 'Roo.Toolbar'
2614 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2616 click : function (_self, e)
2618 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2622 '|xns' : 'Roo.Toolbar'
2627 xtype : 'ToolbarContext',
2628 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2629 xns : Roo.form.HtmlEditor,
2630 '|xns' : 'Roo.form.HtmlEditor'
2641 xtype : 'ContentPanel',
2643 fitContainer : true,
2646 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2655 url : baseURL + '/Roo/cms_page.php',
2657 rendered : function (form)
2663 '|xns' : 'Roo.form',
2669 '|xns' : 'Roo.form',
2673 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2687 xtype : 'ContentPanel',
2689 fitContainer : true,
2692 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2701 url : baseURL + '/Roo/cms_page.php',
2703 rendered : function (form)
2709 '|xns' : 'Roo.form',
2714 '|xns' : 'Roo.form',
2718 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2727 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2729 name : 'descriptions',
2744 xtype : 'GridPanel',
2746 fitContainer : true,
2749 tableName : 'Images',
2750 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2752 activate : function() {
2755 _this.grid.footer.onClick('first');
2762 xtype : 'EditorGrid',
2763 autoExpandColumn : 'title',
2767 render : function() {
2769 //_this.dialog = Pman.Dialog.FILL_IN
2770 if (_this.panel.active) {
2771 //this.footer.onClick('first');
2774 rowdblclick : function (_self, rowIndex, e)
2776 var rd = _this.grid.getDataSource().getAt(rowIndex);
2777 var id = rd.data.id;
2778 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2779 _this.form.findField('contents').execCmd('insertimage', url);
2784 '|xns' : 'Roo.grid',
2792 cls : 'x-btn-text-icon',
2793 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2794 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2798 var id = _this.form.findField('id').getValue() * 1;
2804 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2805 _this.grid.ds.load({});
2815 cls : 'x-btn-text-icon',
2816 icon : rootURL + '/Pman/templates/images/trash.gif',
2817 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2821 var selection = _this.grid.getSelectionModel().getSelectedCell();
2822 var sn = _this.grid.ds.getAt(selection[0]);
2823 if (!sn || isNaN(sn.id *1)) {
2824 Roo.MessageBox.alert("Error", "Select a image");
2827 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2833 url : baseURL + '/Roo/Images.php',
2838 success : function()
2840 Roo.log('Got Success!!');
2841 _this.grid.ds.load({});
2855 beforeload : function (_self, o)
2857 var id = _this.form.findField('id').getValue() * 1;
2863 o.params = o.params || {};
2864 o.params.limit = 9999;
2866 o.params.ontable = 'cms_page';
2868 update : function (_self, rec, operation)
2872 url : baseURL+'/Roo/Images.php',
2875 success: function(res)
2877 Roo.log("GOT success");
2878 // update the data...
2879 _this.grid.ds.load({});
2881 failure : function(res)
2883 Roo.MessageBox.alert('Error', res.errorMsg);
2884 _this.grid.ds.load({});
2892 '|xns' : 'Roo.data',
2894 xtype : 'HttpProxy',
2896 url : baseURL + '/Roo/Images.php',
2901 xtype : 'JsonReader',
2936 'name': 'displayorder',
2944 'name': 'parent_image_id',
2950 'dateFormat': 'Y-m-d'
2969 'name': 'parent_image_id_id',
2973 'name': 'parent_image_id_filename',
2977 'name': 'parent_image_id_ontable',
2981 'name': 'parent_image_id_onid',
2985 'name': 'parent_image_id_mimetype',
2989 'name': 'parent_image_id_width',
2993 'name': 'parent_image_id_height',
2997 'name': 'parent_image_id_filesize',
3001 'name': 'parent_image_id_displayorder',
3005 'name': 'parent_image_id_language',
3009 'name': 'parent_image_id_parent_image_id',
3013 'name': 'parent_image_id_created',
3017 'name': 'parent_image_id_imgtype',
3021 'name': 'parent_image_id_linkurl',
3025 'name': 'parent_image_id_descript',
3029 'name': 'parent_image_id_title',
3035 totalProperty : 'total',
3042 xtype : 'ColumnModel',
3044 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3045 renderer : function(v,x,r) {
3046 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3054 xtype : 'ColumnModel',
3055 dataIndex : 'filename',
3056 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3057 renderer : function(v) { return String.format('{0}', v); },
3063 xtype : 'ColumnModel',
3064 dataIndex : 'displayorder',
3065 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3066 renderer : function(v) { return String.format('{0}', v); },
3069 '|xns' : 'Roo.grid',
3071 xtype : 'GridEditor',
3073 '|xns' : 'Roo.grid',
3075 xtype : 'NumberField',
3076 decimalPrecision : 0,
3078 focus : function (_self)
3080 if (this.value == 0) {
3081 this.el.dom.value = '';
3091 xtype : 'ColumnModel',
3092 dataIndex : 'title',
3093 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3094 renderer : function(v) { return String.format('{0}', v); },
3097 '|xns' : 'Roo.grid',
3099 xtype : 'GridEditor',
3101 '|xns' : 'Roo.grid',
3103 xtype : 'TextField',
3110 xtype : 'ColumnModel',
3111 dataIndex : 'linkurl',
3112 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3113 renderer : function(v)
3115 return String.format('{0}', (v) ? v : '');
3119 '|xns' : 'Roo.grid',
3121 xtype : 'GridEditor',
3123 '|xns' : 'Roo.grid',
3125 xtype : 'TextField',
3135 xtype : 'NestedLayoutPanel',
3137 fitContainer : true,
3141 render : function (_self)
3143 _this.westLayoutPanel = this;
3150 xtype : 'BorderLayout',
3154 xtype : 'LayoutRegion',
3155 tabPosition : 'top',
3160 xtype : 'LayoutRegion',
3163 tabPosition : 'top',
3169 xtype : 'ContentPanel',
3174 render : function (_self)
3176 _this.trpanel = _self;
3178 resize : function (_self, width, height)
3180 Roo.log('resize called');
3182 var ew = Math.max(250, width - 10);
3183 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3186 if (!_this.trform) {
3190 var bd = _this.trform1.findField('body');
3195 // since render delays resize..
3196 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3197 // _this.trbodycol.el.setWidth(bd.width+20);
3199 var bd = _this.trform2.findField('extended');
3203 // since render delays resize..
3204 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3205 // _this.trextendcol.el.setWidth(bd.width+20);
3215 labelAlign : 'right',
3218 showHide : function() {
3220 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3221 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3222 var has_lang = _this.trform.findField('language').getValue().length;
3224 _this.westLayoutPanel.getLayout().getRegion('south').show();
3225 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3226 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3227 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3230 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3233 if(!has_extended && has_lang){
3234 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3235 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3243 var el = _this.trform.findField(k);
3244 el.actionMode = 'fieldEl';
3246 Roo.log("show: " + k);
3249 Roo.log("hide: " + k);
3254 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3257 if(typeof(_this.trform.editors) == 'undefined'){
3258 _this.trform.editors = {
3259 body : _this.trform1.findField('body').wrap.isVisible(),
3260 extended : _this.trform2.findField('extended').wrap.isVisible()
3262 if(_this.trform.editors.body){
3263 setInterval(_this.trform1.findField('body').autosave, 60000);
3266 if(_this.trform.editors.extended){
3267 setInterval(_this.trform2.findField('extended').autosave, 60000);
3271 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3272 setInterval(_this.trform1.findField('body').autosave, 60000);
3273 _this.trform.editors.body = true;
3276 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3277 setInterval(_this.trform2.findField('extended').autosave, 60000);
3278 _this.trform.editors.extended = true;
3283 style : 'margin: 5px',
3284 trackResetOnLoad : true,
3285 url : baseURL + '/Roo/cms_page.php',
3287 actioncomplete : function (_self, action)
3289 if (action.type =='submit') {
3293 if (action.type == 'setdata') {
3294 _this.trform.addForm(_this.trform1);
3295 _this.trform.addForm(_this.trform2);
3296 _this.trform.addForm(_this.trform3);
3298 if ( _this.data.id) {
3300 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3302 this.trpanel.el.mask("save first");
3309 if (action.type == 'load') {
3310 // _this.dialog.el.unmask();
3313 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3314 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3315 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3316 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3321 actionfailed : function (_self, action)
3323 _this.dialog.el.unmask();
3325 Pman.standardActionFailed(_self, action);
3327 rendered : function (_self)
3329 _this.trform = _self;
3333 '|xns' : 'Roo.form',
3340 '|xns' : 'Roo.form',
3347 '|xns' : 'Roo.form',
3352 displayField : 'language_name',
3354 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3355 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3356 forceSelection : true,
3357 hiddenName : 'language',
3359 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3361 name : 'language_name',
3363 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3364 selectOnFocus : true,
3365 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3366 triggerAction : 'all',
3368 valueField : 'language',
3370 add : function (combo)
3372 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3375 _this.trform.reset();
3376 _this.trform1.reset();
3377 _this.trform2.reset();
3379 combo.setValue(res.lang);
3380 combo.el.dom.value = res.lang_name;
3383 _this.trform.showHide();
3384 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3389 render : function (_self)
3391 _this.language = _self;
3393 select : function (combo, record, index)
3396 _this.trform.showHide();
3397 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3404 'lookup[language]' : record.data.language,
3405 'lookup[translation_of_id]' : _this.data.id,
3412 '|xns' : 'Roo.form',
3416 sortInfo : { direction : 'ASC', field: 'language' },
3418 beforeload : function (_self, o){
3419 o.params = o.params || {};
3421 o.params._distinct = 'language';
3422 o.params._columns ='language_name,language';
3423 o.params._with_name = true;
3425 if(_this.form.findField('id').getValue()*1 > 0){
3426 o.params.translation_of_id = _this.form.findField('id').getValue();
3432 '|xns' : 'Roo.data',
3434 xtype : 'HttpProxy',
3436 url : baseURL + '/Roo/Cms_page.php',
3441 xtype : 'JsonReader',
3442 fields : [{"name":"language","type":"string"}],
3445 totalProperty : 'total',
3453 style : 'padding-top:12px;padding-left:30px;float:left',
3456 render : function (_self)
3458 _this.updateRow = _self;
3462 '|xns' : 'Roo.form',
3466 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3470 // _this.dialog.el.mask("Saving");
3471 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3472 _this.trform1.findField('body').syncValue();
3473 _this.trform2.findField('extended').syncValue();
3475 _this.trform1.findField('body').pushValue();
3476 _this.trform2.findField('extended').pushValue();
3479 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3480 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3481 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3482 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3483 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3485 if(_this.trform.findField('element_id').getValue()*1 > 0){
3486 _this.trform.findField('is_element').setValue(1);
3489 _this.trform.doAction("submit");
3500 xtype : 'TextField',
3501 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3517 name : 'element_id',
3523 name : 'menu_page_id',
3529 name : 'is_menuitem',
3535 name : 'is_element',
3542 name : 'translation_of_id',
3557 xtype : 'ContentPanel',
3559 fitContainer : true,
3562 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3571 url : baseURL + '/Roo/cms_page.php',
3573 rendered : function (form)
3575 _this.trform1 = form;
3579 '|xns' : 'Roo.form',
3585 '|xns' : 'Roo.form',
3588 xtype : 'HtmlEditor',
3589 autosave : function() {
3591 var body = _this.trform1.findField('body');
3593 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3594 Roo.log('tr body not dirty');
3598 Roo.log('tr body dirty, auto save!');
3600 body.fireEvent('autosave', body);
3602 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3606 white : [ 'iframe' ],
3608 autosave : function (_self)
3610 var id = _this.trform.findField('id').getValue() * 1;
3613 if(!_self.editorcore.sourceEditMode){
3620 url : baseURL + '/Roo/Events.php',
3624 action : 'AUTOSAVE',
3625 on_id : (id > 0) ? id : 0,
3626 on_table : 'cms_page',
3628 source: _self.getValue()
3630 success : function() {
3631 _self.originalValue = _self.getValue();
3634 failure : function()
3636 //Roo.MessageBox.alert("Error", "autosave failed");
3637 Roo.log('tr body autosave failed?!');
3641 savedpreview : function (_self)
3643 var id = _this.trform.findField('id').getValue() * 1;
3645 var successFn = function(res){
3646 return res.data.POST.source;
3650 action : 'AUTOSAVE',
3652 on_id : (id < 1) ? 0 : id,
3653 on_table : 'cms_page',
3654 successFn : successFn
3658 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3659 _self.setValue(res);
3660 _self.originalValue = res;
3663 stylesheetsclick : function (_self)
3665 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3666 _this.dialog.setStylesheets();
3672 '|xns' : 'Roo.form',
3675 xtype : 'ToolbarStandard',
3676 xns : Roo.form.HtmlEditor,
3677 '|xns' : 'Roo.form.HtmlEditor',
3682 displayField : 'name',
3684 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3685 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3686 forceSelection : true,
3688 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3691 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3692 selectOnFocus : true,
3693 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>',
3694 triggerAction : 'all',
3699 beforequery : function (combo, query, forceAll, cancel, e)
3702 var id = _this.form.findField('id').getValue() * 1;
3704 Roo.MessageBox.alert("Error", "Save press release first");
3708 render : function (_self)
3710 _this.trbodyimgselect = _self;
3712 select : function (combo, record, index)
3719 var editor = _this.trform.findField('body').editorcore;
3721 var curnode = editor.getSelectedNode();
3723 if (curnode && curnode.tagName == 'IMG') {
3724 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3725 baseURL, record.data.id, record.data.filename
3727 // note -forces an update... hopefully...
3728 editor.owner.fireEvent('editorevent', editor, false);
3731 editor.insertAtCursor(
3732 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3733 baseURL, record.data.id, record.data.filename
3742 '|xns' : 'Roo.form',
3746 sortInfo : { direction : 'ASC', field: 'id' },
3748 beforeload : function (_self, o){
3749 o.params = o.params || {};
3751 var id = _this.form.findField('id').getValue() * 1;
3753 Roo.MessageBox.alert("Error", "Save press release first");
3757 o.params.ontable = 'cms_page';
3758 // o.params.imgtype = 'PressRelease';
3759 //o.params['query[imagesize]'] = '150x150';
3764 '|xns' : 'Roo.data',
3766 xtype : 'HttpProxy',
3768 url : baseURL + '/Roo/Images.php',
3773 xtype : 'JsonReader',
3774 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3777 totalProperty : 'total',
3786 displayField : 'page_link',
3788 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3789 forceSelection : true,
3790 hiddenName : 'add_link_id',
3792 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3796 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3797 selectOnFocus : true,
3798 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3799 triggerAction : 'all',
3804 select : function (combo, record, index)
3810 var editor = _this.form.findField('body');
3811 editor.insertAtCursor(
3812 String.format('<a href="#page-{0}">{1}</a>',
3813 record.data.page_link, record.data.title
3821 '|xns' : 'Roo.form',
3825 sortInfo : { field: 'page_link', direction: 'ASC' },
3827 beforeload : function (_self, options)
3829 options.params['search[page_link_no_empty]'] =1;
3831 options.params.is_element = 0;
3832 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3837 '|xns' : 'Roo.data',
3839 xtype : 'HttpProxy',
3841 url : baseURL + '/Roo/cms_page.php',
3846 xtype : 'JsonReader',
3848 { name: 'id', type: 'int' },
3854 totalProperty : 'total',
3861 xtype : 'Separator',
3863 '|xns' : 'Roo.Toolbar'
3867 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3869 click : function (_self, e)
3871 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3875 '|xns' : 'Roo.Toolbar'
3880 xtype : 'ToolbarContext',
3881 xns : Roo.form.HtmlEditor,
3882 '|xns' : 'Roo.form.HtmlEditor'
3893 xtype : 'ContentPanel',
3895 fitContainer : true,
3898 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3907 url : baseURL + '/Roo/cms_page.php',
3909 rendered : function (form)
3911 _this.trform2 = form;
3915 '|xns' : 'Roo.form',
3921 '|xns' : 'Roo.form',
3924 xtype : 'HtmlEditor',
3925 autosave : function() {
3927 var extended = _this.trform2.findField('extended');
3929 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3930 Roo.log('tr extend not dirty');
3935 Roo.log('tr extend dirty, auto save!');
3937 extended.fireEvent('autosave', extended);
3941 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3945 white : [ 'iframe' ],
3947 autosave : function (_self)
3949 var id = _this.trform.findField('id').getValue() * 1;
3952 if(!_self.editorcore.sourceEditMode){
3960 url : baseURL + '/Roo/Events.php',
3964 action : 'AUTOSAVE',
3965 on_id : (id > 0) ? id : 0,
3966 on_table : 'cms_page',
3967 remarks : 'EXTENDED',
3968 source: _self.getValue()
3970 success : function() {
3971 _self.originalValue = _self.getValue();
3974 failure : function()
3976 //Roo.MessageBox.alert("Error", "autosave failed");
3977 Roo.log('tr extended autosave failed?!');
3981 savedpreview : function (_self)
3983 var id = _this.trform.findField('id').getValue() * 1;
3985 var successFn = function(res){
3986 return res.data.POST.source;
3990 action : 'AUTOSAVE',
3991 remarks : 'EXTENDED',
3992 on_id : (id < 1) ? 0 : id,
3993 on_table : 'cms_page',
3994 successFn : successFn
3998 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3999 _self.setValue(res);
4000 _self.originalValue = res;
4003 stylesheetsclick : function (_self)
4005 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4006 _this.dialog.setStylesheets();
4012 '|xns' : 'Roo.form',
4015 xtype : 'ToolbarStandard',
4016 xns : Roo.form.HtmlEditor,
4017 '|xns' : 'Roo.form.HtmlEditor',
4020 xtype : 'Separator',
4022 '|xns' : 'Roo.Toolbar'
4026 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4028 click : function (_self, e)
4030 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4034 '|xns' : 'Roo.Toolbar'
4039 xtype : 'ToolbarContext',
4040 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4041 xns : Roo.form.HtmlEditor,
4042 '|xns' : 'Roo.form.HtmlEditor'
4053 xtype : 'ContentPanel',
4055 fitContainer : true,
4058 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4067 url : baseURL + '/Roo/cms_page.php',
4069 rendered : function (form)
4071 _this.trform3 = form;
4075 '|xns' : 'Roo.form',
4080 '|xns' : 'Roo.form',
4084 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4093 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4095 name : 'descriptions',