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 _this.trform.reset();
895 _this.trform1.reset();
896 _this.trform2.reset();
897 _this.trform3.reset();
899 if ( _this.data.id) {
900 _this.dialog.el.mask("Loading");
901 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
905 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
906 this.findField('is_draft').setValue(is_draft);
907 _this.page_type.setValue(_this.data.page_type_id);
908 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
910 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
911 _this.interestsCol.show();
914 _this.form.showHide();
917 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
918 catlabel.dom.innerHTML = 'Category';
919 if(_this.data.page_type_id_name == 'category'){
920 catlabel.dom.innerHTML = 'Parent Category';
925 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
926 catlabel.dom.innerHTML = 'Parent page';
927 if(_this.data.page_type_id_name == 'category'){
928 catlabel.dom.innerHTML = 'Parent';
934 if(_this.data._is_copy){
935 _this.form.is_copy();
941 if (action.type == 'load') {
943 //_this.data = action.result.data;
945 var d = action.result.data;
947 _this.dialog.el.unmask();
948 _this.grid.getDataSource().load();
950 _this.trform.reset();
951 _this.trform1.reset();
952 _this.trform2.reset();
954 _this.trform.addForm(_this.trform1);
955 _this.trform.addForm(_this.trform2);
957 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
958 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
959 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
960 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
961 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
964 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
965 catlabel.dom.innerHTML = 'Category';
967 if(_this.data.page_type_id_name == 'category'){
968 catlabel.dom.innerHTML = 'Parent Category';
972 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
973 catlabel.dom.innerHTML = 'Parent page';
974 if(_this.data.page_type_id_name == 'category'){
975 catlabel.dom.innerHTML = 'Parent';
978 // better if this was not here... - not sure which project uses it?
980 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
981 _this.interestsCol.show();
984 if(typeof(d['interests']) != 'undefined'){
985 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
988 if(typeof(d['categories']) != 'undefined'){
989 _this.form.findField('category').setValue(Roo.decode(d['categories']));
992 if(typeof(d['page_classes']) != 'undefined'){
993 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
996 _this.trpanel.el.unmask();
997 _this.panel.el.unmask();
1000 _this.cpanel.el.dom.scrollTop = 0;
1002 // fix messed up scroll.
1003 _this.dialog.layout.el.dom.scrollTop = 0;
1007 if (action.type =='submit') {
1009 _this.dialog.el.unmask();
1012 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1016 _this.dialog.hide();
1019 if (_this.callback) {
1020 _this.callback.call(_this, action.result.data);
1026 actionfailed : function (_self, action)
1028 _this.dialog.el.unmask();
1029 Pman.standardActionFailed(_self, action);
1031 rendered : function (_self)
1037 '|xns' : 'Roo.form',
1044 '|xns' : 'Roo.form',
1049 labelAlign : 'right',
1051 style : 'height:30px;overflow:hidden',
1054 '|xns' : 'Roo.form',
1058 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1067 style : 'height:30px;overflow:hidden',
1070 '|xns' : 'Roo.form',
1075 displayField : 'display_name',
1077 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1078 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1079 forceSelection : true,
1080 hiddenName : 'page_type_id',
1082 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1084 name : 'page_type_id_display_name',
1086 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1087 selectOnFocus : true,
1088 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1089 triggerAction : 'all',
1093 render : function (_self)
1095 _this.page_type = _self;
1097 select : function (combo, record, index)
1099 // _this.grid.footer.onClick('first');
1100 var page_type_name = record.data.name;
1101 _this.form.findField('page_type_id_name').setValue(page_type_name);
1102 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1103 _this.form.findField('is_attachment').setValue(0);
1107 _this.form.showHide.defer(100, _this.form);
1113 '|xns' : 'Roo.form',
1117 sortInfo : { direction : 'ASC', field: 'seqid' },
1119 beforeload : function (_self, o){
1120 o.params = o.params || {};
1122 o.params.etype = 'cms_page_type';
1126 '|xns' : 'Roo.data',
1128 xtype : 'HttpProxy',
1130 url : baseURL + '/Roo/core_enum.php',
1135 xtype : 'JsonReader',
1136 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1139 totalProperty : 'total',
1148 style : 'padding-left: -70px;',
1151 '|xns' : 'Roo.form',
1154 xtype : 'NumberField',
1155 decimalPrecision : 0,
1156 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1171 labelAlign : 'right',
1173 style : 'height:30px;overflow:hidden',
1176 '|xns' : 'Roo.form',
1180 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1189 style : 'height:30px;overflow:hidden',
1192 '|xns' : 'Roo.form',
1196 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1197 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1205 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1207 name : 'has_extended',
1210 check : function (_self, checked)
1215 _this.form.showHide();
1216 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1227 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1229 name : 'is_attachment',
1232 check : function (_self, checked)
1236 _this.form.showHide.defer(100, _this.form);
1250 displayField : 'name',
1252 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1253 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1254 forceSelection : true,
1255 hiddenName : 'author_id',
1257 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1259 name : 'author_id_name',
1261 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1262 queryParam : 'query[name]',
1263 selectOnFocus : true,
1264 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1265 triggerAction : 'all',
1270 '|xns' : 'Roo.form',
1274 sortInfo : { direction : 'ASC', field: 'name' },
1276 beforeload : function (_self, o){
1277 o.params = o.params || {};
1279 o.params.active = 1;
1280 o.params['query[is_owner]'] = 1;
1284 '|xns' : 'Roo.data',
1286 xtype : 'HttpProxy',
1288 url : baseURL + '/Roo/core_person',
1293 xtype : 'JsonReader',
1294 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1297 totalProperty : 'total',
1304 xtype : 'ComboBoxArray',
1305 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1306 hiddenName : 'category',
1307 name : 'category_name',
1310 '|xns' : 'Roo.form',
1315 displayField : 'display_fullpath',
1317 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1318 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1319 forceSelection : true,
1323 queryParam : 'search[name]',
1324 selectOnFocus : true,
1325 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1326 triggerAction : 'all',
1330 '|xns' : 'Roo.form',
1334 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1336 beforeload : function (_self, o){
1337 o.params = o.params || {};
1339 o.params.page_type_id_name= 'CATEGORY';
1341 o.params._with_fullpath = 1;
1345 '|xns' : 'Roo.data',
1347 xtype : 'HttpProxy',
1349 url : baseURL + '/Roo/cms_page.php',
1354 xtype : 'JsonReader',
1356 {"name":"id","type":"int"},
1357 {"name":"name","type":"string"},
1358 {"name":"display_name","type":"string"}
1362 totalProperty : 'total',
1373 displayField : 'page_link',
1375 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1376 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1377 forceSelection : true,
1378 hiddenName : 'parent_id',
1380 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1382 name : 'parent_id_title',
1384 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1385 selectOnFocus : true,
1386 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1387 triggerAction : 'all',
1392 select : function (combo, record, index)
1394 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1395 if (page_type_name == 'page') { // page
1398 // do not default to put 'Home' at the beginning.
1399 if (!record || !(record.data.parent_id *1)) {
1402 var pl = _this.form.findField('page_link');
1403 var lk = pl.getValue();
1404 var new_link = record.data.page_link + '/';
1406 new_link += lk.split('/').pop();
1408 pl.setValue(new_link);
1413 '|xns' : 'Roo.form',
1417 sortInfo : { field: 'page_link', direction: 'ASC' },
1419 beforeload : function (_self, options)
1421 options.params['search[page_link_no_empty]'] =1;
1423 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1424 options.params._page_type = 'page,element';
1426 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1429 var id = _this.form.findField('id').getValue() * 1;
1432 options.params['!id'] = id;
1437 options.params.is_element = 0;
1438 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1439 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1444 '|xns' : 'Roo.data',
1446 xtype : 'HttpProxy',
1448 url : baseURL + '/Roo/cms_page.php',
1453 xtype : 'JsonReader',
1455 { name: 'id', type: 'int' },
1461 totalProperty : 'total',
1471 '|xns' : 'Roo.form',
1474 xtype : 'DateField',
1475 altFormats : 'Y-m-d H:i:s',
1476 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1484 xtype : 'TextField',
1485 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1486 name : 'to_replace_id',
1494 xtype : 'TextField',
1495 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1499 keyup : function (_self, e)
1501 if (_this.page_type.getRawValue() == 'Category') {
1503 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1512 xtype : 'TextField',
1513 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1520 xtype : 'TextField',
1521 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1522 name : 'target_url',
1531 displayField : 'template_clean',
1533 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1534 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1535 forceSelection : true,
1536 hiddenName : 'template_id',
1538 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1540 name : 'template_id_template_clean',
1542 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1543 selectOnFocus : true,
1544 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1545 triggerAction : 'all',
1550 '|xns' : 'Roo.form',
1554 sortInfo : { field: 'template', direction: 'ASC' },
1556 beforeload : function (_self, options)
1559 options.params._rescan = 1;
1560 options.params._clean_name = 1;
1561 // options.params.lang = 'en';
1562 options.params['!template[0]'] = 'master.html';
1563 //options.params['!template[1]'] = 'index.html';
1567 '|xns' : 'Roo.data',
1569 xtype : 'HttpProxy',
1571 url : baseURL + '/Roo/Cms_template',
1576 xtype : 'JsonReader',
1578 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1582 totalProperty : 'total',
1592 displayField : 'name',
1594 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1595 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1596 forceSelection : true,
1597 hiddenName : 'element_id',
1599 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1601 name : 'element_id_name',
1603 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1604 selectOnFocus : true,
1605 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1606 triggerAction : 'all',
1611 '|xns' : 'Roo.form',
1615 sortInfo : { field: 'name', direction: 'ASC' },
1617 beforeload : function (_self, options)
1619 var par = _this.form.findField('parent_id').getValue() * 1;
1621 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1625 options.params._cms_page_id = par;
1629 '|xns' : 'Roo.data',
1631 xtype : 'HttpProxy',
1633 url : baseURL + '/Roo/Cms_template_element',
1638 xtype : 'JsonReader',
1640 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1644 totalProperty : 'total',
1654 displayField : 'page_link',
1656 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1657 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1658 forceSelection : true,
1659 hiddenName : 'menu_page_id',
1661 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1663 name : 'menu_page_id_page_link',
1665 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1666 selectOnFocus : true,
1667 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>',
1668 triggerAction : 'all',
1673 '|xns' : 'Roo.form',
1677 sortInfo : { field: 'title', direction: 'ASC' },
1679 beforeload : function (_self, options)
1681 options.params = options.params || {};
1683 options.params['search[page_link_no_empty]'] =1;
1685 options.params['page_type_id_name[0]'] = 'page';
1686 options.params['page_type_id_name[1]'] = 'blog';
1688 options.params.is_element = 0;
1689 options.params.is_menuitem = 0;
1694 '|xns' : 'Roo.data',
1696 xtype : 'HttpProxy',
1698 url : baseURL + '/Roo/cms_page.php',
1703 xtype : 'JsonReader',
1718 "name":"page_type_id_display_name",
1724 totalProperty : 'total',
1731 xtype : 'ComboBoxArray',
1732 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1733 hiddenName : 'page_cls',
1734 name : 'page_cls_name',
1737 '|xns' : 'Roo.form',
1742 displayField : 'display_name',
1744 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1745 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1746 forceSelection : true,
1749 queryParam : 'query[search]',
1750 selectOnFocus : true,
1751 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1752 triggerAction : 'all',
1753 valueField : 'name',
1756 '|xns' : 'Roo.form',
1760 sortInfo : { direction : 'ASC', field: 'seqid' },
1762 beforeload : function (_self, o){
1763 o.params = o.params || {};
1765 o.params.etype = 'cms_page_class';
1769 '|xns' : 'Roo.data',
1771 xtype : 'HttpProxy',
1773 url : baseURL + '/Roo/core_enum.php',
1778 xtype : 'JsonReader',
1780 {"name":"id","type":"int"},
1781 {"name":"name","type":"string"},
1782 {"name":"display_name","type":"string"}
1786 totalProperty : 'total',
1800 '|xns' : 'Roo.form',
1806 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1807 style : 'width: 165px;',
1809 '|xns' : 'Roo.form',
1812 xtype : 'DisplayField',
1814 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1815 name : 'primary_image_id',
1816 style : 'border: 1px solid #ccc;',
1817 valueRenderer : function(v) {
1819 if (!v || v * 1 < 1) {
1820 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1823 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1836 render : function (_self)
1838 _this.interestsCol = _self;
1842 '|xns' : 'Roo.form',
1845 xtype : 'ComboBoxArray',
1846 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1847 hiddenName : 'interest',
1848 name : 'interest_name',
1851 render : function (_self)
1853 _this.interests = _self;
1855 _self.combo.addicon.setStyle( {
1856 position : 'absolute',
1865 '|xns' : 'Roo.form',
1870 displayField : 'display_name',
1872 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1873 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1874 forceSelection : true,
1877 queryParam : 'query[name]',
1878 selectOnFocus : true,
1879 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1880 triggerAction : 'all',
1884 '|xns' : 'Roo.form',
1888 sortInfo : { direction : 'ASC', field: 'name' },
1890 beforeload : function (_self, o){
1891 o.params = o.params || {};
1892 o.params.etype = 'crm_interest';
1896 '|xns' : 'Roo.data',
1898 xtype : 'HttpProxy',
1900 url : baseURL + '/Roo/Core_enum.php',
1905 xtype : 'JsonReader',
1907 {"name":"id","type":"int"},
1908 {"name":"name","type":"string"},
1909 {"name":"display_name","type":"string"}
1913 totalProperty : 'total',
1930 name : 'is_system_page',
1936 name : 'is_menuitem',
1942 name : 'page_type_id_name',
1949 render : function (_self)
1951 _this.user_defined_fields = _self;
1962 xtype : 'ContentPanel',
1964 fitContainer : true,
1967 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1976 url : baseURL + '/Roo/cms_page.php',
1978 rendered : function (form)
1984 '|xns' : 'Roo.form',
1990 '|xns' : 'Roo.form',
1993 xtype : 'HtmlEditor',
1994 autosave : function() {
1996 var body = _this.form1.findField('body');
1998 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
1999 Roo.log('body not dirty');
2003 Roo.log('body dirty, auto save!');
2005 body.fireEvent('autosave', body);
2009 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2013 white : [ 'iframe' ],
2016 autosave : function (_self)
2018 Roo.log('autosave');
2020 var id = _this.form.findField('id').getValue() * 1;
2022 if(!_self.editorcore.sourceEditMode){
2029 url : baseURL + '/Roo/Events.php',
2033 action : 'AUTOSAVE',
2034 on_id : (id > 0) ? id : 0,
2035 on_table : 'cms_page',
2037 source: _self.getValue()
2039 success : function() {
2040 _self.originalValue = _self.getValue();
2043 failure : function()
2045 //Roo.MessageBox.alert("Error", "autosave failed");
2046 Roo.log('body autosave failed?!');
2051 savedpreview : function (_self)
2053 Roo.log('saved preview');
2055 var id = _this.form.findField('id').getValue() * 1;
2057 var successFn = function(res){
2058 return res.data.POST.source;
2062 action : 'AUTOSAVE',
2064 on_id : (id < 1) ? 0 : id,
2065 on_table : 'cms_page',
2066 successFn : successFn
2070 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2071 _self.setValue(res);
2072 _self.originalValue = res;
2075 stylesheetsclick : function (_self)
2077 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2078 _this.dialog.setStylesheets();
2084 '|xns' : 'Roo.form',
2087 xtype : 'ToolbarStandard',
2088 xns : Roo.form.HtmlEditor,
2089 '|xns' : 'Roo.form.HtmlEditor',
2094 displayField : 'name',
2096 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2097 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2098 forceSelection : true,
2100 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2103 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2104 queryParam : 'search',
2105 selectOnFocus : true,
2106 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>',
2107 triggerAction : 'all',
2112 beforequery : function (combo, query, forceAll, cancel, e)
2115 var id = _this.form.findField('id').getValue() * 1;
2117 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2121 render : function (_self)
2123 _this.bodyimgselect = _self;
2125 select : function (combo, record, index)
2132 var editor = _this.form.findField('body').editorcore;
2134 var curnode = editor.getSelectedNode();
2136 if (curnode && curnode.tagName == 'IMG') {
2137 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2138 baseURL, record.data.id, record.data.filename
2140 // note -forces an update... hopefully...
2141 editor.owner.fireEvent('editorevent', editor, false);
2144 editor.insertAtCursor(
2145 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2146 baseURL, record.data.id, record.data.filename
2155 '|xns' : 'Roo.form',
2159 sortInfo : { direction : 'ASC', field: 'id' },
2161 beforeload : function (_self, o){
2162 o.params = o.params || {};
2164 var id = _this.form.findField('id').getValue() * 1;
2166 Roo.MessageBox.alert("Error", "Save press release first");
2170 o.params.ontable = 'cms_page';
2171 // o.params.imgtype = 'PressRelease';
2172 //o.params['query[imagesize]'] = '150x150';
2177 '|xns' : 'Roo.data',
2179 xtype : 'HttpProxy',
2181 url : baseURL + '/Roo/Images.php',
2186 xtype : 'JsonReader',
2187 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2190 totalProperty : 'total',
2199 displayField : 'page_link',
2201 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2202 forceSelection : true,
2203 hiddenName : 'add_link_id',
2205 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2209 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2210 selectOnFocus : true,
2211 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2212 triggerAction : 'all',
2217 select : function (combo, record, index)
2223 var editor = _this.form.findField('body');
2224 editor.editorcore.insertAtCursor(
2225 String.format('<a href="#page-{0}">{1}</a>',
2226 record.data.page_link, record.data.title
2234 '|xns' : 'Roo.form',
2238 sortInfo : { field: 'page_link', direction: 'ASC' },
2240 beforeload : function (_self, options)
2242 options.params['search[page_link_no_empty]'] =1;
2244 options.params.is_element = 0;
2245 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2250 '|xns' : 'Roo.data',
2252 xtype : 'HttpProxy',
2254 url : baseURL + '/Roo/cms_page.php',
2259 xtype : 'JsonReader',
2261 { name: 'id', type: 'int' },
2267 totalProperty : 'total',
2274 xtype : 'Separator',
2276 '|xns' : 'Roo.Toolbar'
2280 cls : 'x-init-enable',
2281 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2283 click : function (_self, e)
2285 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2289 '|xns' : 'Roo.Toolbar'
2294 xtype : 'ToolbarContext',
2295 xns : Roo.form.HtmlEditor,
2296 '|xns' : 'Roo.form.HtmlEditor'
2307 xtype : 'ContentPanel',
2309 fitContainer : true,
2312 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2321 url : baseURL + '/Roo/cms_page.php',
2323 rendered : function (form)
2329 '|xns' : 'Roo.form',
2335 '|xns' : 'Roo.form',
2338 xtype : 'HtmlEditor',
2339 autosave : function() {
2341 var extended = _this.form2.findField('extended');
2343 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2344 Roo.log('extend not dirty');
2349 Roo.log('extend dirty, auto save!');
2351 extended.fireEvent('autosave', extended);
2353 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2357 white : [ 'iframe' ],
2360 autosave : function (_self)
2362 var id = _this.form.findField('id').getValue() * 1;
2365 if(!_self.editorcore.sourceEditMode){
2372 url : baseURL + '/Roo/Events.php',
2376 action : 'AUTOSAVE',
2377 on_id : (id > 0) ? id : 0,
2378 on_table : 'cms_page',
2379 remarks : 'EXTENDED',
2380 source: _self.getValue()
2382 success : function() {
2383 _self.originalValue = _self.getValue();
2386 failure : function()
2388 //Roo.MessageBox.alert("Error", "autosave failed");
2389 Roo.log('extended autosave failed?!');
2393 savedpreview : function (_self)
2395 var id = _this.form.findField('id').getValue() * 1;
2397 var successFn = function(res){
2398 return res.data.POST.source;
2402 action : 'AUTOSAVE',
2403 remarks : 'EXTENDED',
2404 on_id : (id < 1) ? 0 : id,
2405 on_table : 'cms_page',
2406 successFn : successFn
2410 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2411 _self.setValue(res);
2412 _self.originalValue = res;
2415 stylesheetsclick : function (_self)
2417 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2418 _this.dialog.setStylesheets();
2424 '|xns' : 'Roo.form',
2427 xtype : 'ToolbarStandard',
2428 xns : Roo.form.HtmlEditor,
2429 '|xns' : 'Roo.form.HtmlEditor',
2434 displayField : 'name',
2436 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2437 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2438 forceSelection : true,
2440 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2443 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2444 selectOnFocus : true,
2445 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2446 triggerAction : 'all',
2451 beforequery : function (combo, query, forceAll, cancel, e)
2454 var id = _this.form.findField('id').getValue() * 1;
2456 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2460 render : function (_self)
2462 _this.extendimgselect = _self;
2464 select : function (combo, record, index)
2471 var editor = _this.form.findField('extended').editorcore;
2473 var curnode = editor.getSelectedNode();
2475 if (curnode && curnode.tagName == 'IMG') {
2476 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2477 baseURL, record.data.id, record.data.filename
2479 // note -forces an update... hopefully...
2480 editor.owner.fireEvent('editorevent', editor, false);
2483 editor.insertAtCursor(
2484 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2485 baseURL, record.data.id, record.data.filename
2494 '|xns' : 'Roo.form',
2498 sortInfo : { direction : 'ASC', field: 'id' },
2500 beforeload : function (_self, o){
2501 o.params = o.params || {};
2503 var id = _this.form.findField('id').getValue() * 1;
2505 Roo.MessageBox.alert("Error", "Save press release first");
2509 o.params.ontable = 'cms_page';
2510 // o.params.imgtype = 'PressRelease';
2511 //o.params['query[imagesize]'] = '150x150';
2516 '|xns' : 'Roo.data',
2518 xtype : 'HttpProxy',
2520 url : baseURL + '/Roo/Images.php',
2525 xtype : 'JsonReader',
2526 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2529 totalProperty : 'total',
2538 displayField : 'page_link',
2540 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2541 forceSelection : true,
2542 hiddenName : 'add_link_id',
2544 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2548 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2549 selectOnFocus : true,
2550 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2551 triggerAction : 'all',
2556 select : function (combo, record, index)
2562 var editor = _this.form.findField('body');
2563 editor.editorcore.insertAtCursor(
2564 String.format('<a href="#page-{0}">{1}</a>',
2565 record.data.page_link, record.data.title
2573 '|xns' : 'Roo.form',
2577 sortInfo : { field: 'page_link', direction: 'ASC' },
2579 beforeload : function (_self, options)
2581 options.params['search[page_link_no_empty]'] =1;
2583 options.params.is_element = 0;
2584 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2589 '|xns' : 'Roo.data',
2591 xtype : 'HttpProxy',
2593 url : baseURL + '/Roo/cms_page.php',
2598 xtype : 'JsonReader',
2600 { name: 'id', type: 'int' },
2606 totalProperty : 'total',
2613 xtype : 'Separator',
2615 '|xns' : 'Roo.Toolbar'
2619 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2621 click : function (_self, e)
2623 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2627 '|xns' : 'Roo.Toolbar'
2632 xtype : 'ToolbarContext',
2633 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2634 xns : Roo.form.HtmlEditor,
2635 '|xns' : 'Roo.form.HtmlEditor'
2646 xtype : 'ContentPanel',
2648 fitContainer : true,
2651 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2660 url : baseURL + '/Roo/cms_page.php',
2662 rendered : function (form)
2668 '|xns' : 'Roo.form',
2674 '|xns' : 'Roo.form',
2678 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2692 xtype : 'ContentPanel',
2694 fitContainer : true,
2697 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2706 url : baseURL + '/Roo/cms_page.php',
2708 rendered : function (form)
2714 '|xns' : 'Roo.form',
2719 '|xns' : 'Roo.form',
2723 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2732 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2734 name : 'descriptions',
2749 xtype : 'GridPanel',
2751 fitContainer : true,
2754 tableName : 'Images',
2755 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2757 activate : function() {
2760 _this.grid.footer.onClick('first');
2767 xtype : 'EditorGrid',
2768 autoExpandColumn : 'title',
2772 render : function() {
2774 //_this.dialog = Pman.Dialog.FILL_IN
2775 if (_this.panel.active) {
2776 //this.footer.onClick('first');
2779 rowdblclick : function (_self, rowIndex, e)
2781 var rd = _this.grid.getDataSource().getAt(rowIndex);
2782 var id = rd.data.id;
2783 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2784 _this.form.findField('contents').execCmd('insertimage', url);
2789 '|xns' : 'Roo.grid',
2797 cls : 'x-btn-text-icon',
2798 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2799 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2803 var id = _this.form.findField('id').getValue() * 1;
2809 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2810 _this.grid.ds.load({});
2820 cls : 'x-btn-text-icon',
2821 icon : rootURL + '/Pman/templates/images/trash.gif',
2822 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2826 var selection = _this.grid.getSelectionModel().getSelectedCell();
2827 var sn = _this.grid.ds.getAt(selection[0]);
2828 if (!sn || isNaN(sn.id *1)) {
2829 Roo.MessageBox.alert("Error", "Select a image");
2832 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2838 url : baseURL + '/Roo/Images.php',
2843 success : function()
2845 Roo.log('Got Success!!');
2846 _this.grid.ds.load({});
2860 beforeload : function (_self, o)
2862 var id = _this.form.findField('id').getValue() * 1;
2868 o.params = o.params || {};
2869 o.params.limit = 9999;
2871 o.params.ontable = 'cms_page';
2873 update : function (_self, rec, operation)
2877 url : baseURL+'/Roo/Images.php',
2880 success: function(res)
2882 Roo.log("GOT success");
2883 // update the data...
2884 _this.grid.ds.load({});
2886 failure : function(res)
2888 Roo.MessageBox.alert('Error', res.errorMsg);
2889 _this.grid.ds.load({});
2897 '|xns' : 'Roo.data',
2899 xtype : 'HttpProxy',
2901 url : baseURL + '/Roo/Images.php',
2906 xtype : 'JsonReader',
2941 'name': 'displayorder',
2949 'name': 'parent_image_id',
2955 'dateFormat': 'Y-m-d'
2974 'name': 'parent_image_id_id',
2978 'name': 'parent_image_id_filename',
2982 'name': 'parent_image_id_ontable',
2986 'name': 'parent_image_id_onid',
2990 'name': 'parent_image_id_mimetype',
2994 'name': 'parent_image_id_width',
2998 'name': 'parent_image_id_height',
3002 'name': 'parent_image_id_filesize',
3006 'name': 'parent_image_id_displayorder',
3010 'name': 'parent_image_id_language',
3014 'name': 'parent_image_id_parent_image_id',
3018 'name': 'parent_image_id_created',
3022 'name': 'parent_image_id_imgtype',
3026 'name': 'parent_image_id_linkurl',
3030 'name': 'parent_image_id_descript',
3034 'name': 'parent_image_id_title',
3040 totalProperty : 'total',
3047 xtype : 'ColumnModel',
3049 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3050 renderer : function(v,x,r) {
3051 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3059 xtype : 'ColumnModel',
3060 dataIndex : 'filename',
3061 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3062 renderer : function(v) { return String.format('{0}', v); },
3068 xtype : 'ColumnModel',
3069 dataIndex : 'displayorder',
3070 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3071 renderer : function(v) { return String.format('{0}', v); },
3074 '|xns' : 'Roo.grid',
3076 xtype : 'GridEditor',
3078 '|xns' : 'Roo.grid',
3080 xtype : 'NumberField',
3081 decimalPrecision : 0,
3083 focus : function (_self)
3085 if (this.value == 0) {
3086 this.el.dom.value = '';
3096 xtype : 'ColumnModel',
3097 dataIndex : 'title',
3098 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3099 renderer : function(v) { return String.format('{0}', v); },
3102 '|xns' : 'Roo.grid',
3104 xtype : 'GridEditor',
3106 '|xns' : 'Roo.grid',
3108 xtype : 'TextField',
3115 xtype : 'ColumnModel',
3116 dataIndex : 'linkurl',
3117 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3118 renderer : function(v)
3120 return String.format('{0}', (v) ? v : '');
3124 '|xns' : 'Roo.grid',
3126 xtype : 'GridEditor',
3128 '|xns' : 'Roo.grid',
3130 xtype : 'TextField',
3140 xtype : 'NestedLayoutPanel',
3142 fitContainer : true,
3146 render : function (_self)
3148 _this.westLayoutPanel = this;
3155 xtype : 'BorderLayout',
3159 xtype : 'LayoutRegion',
3160 tabPosition : 'top',
3165 xtype : 'LayoutRegion',
3168 tabPosition : 'top',
3174 xtype : 'ContentPanel',
3179 render : function (_self)
3181 _this.trpanel = _self;
3183 resize : function (_self, width, height)
3185 Roo.log('resize called');
3187 var ew = Math.max(250, width - 10);
3188 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3191 if (!_this.trform) {
3195 var bd = _this.trform1.findField('body');
3200 // since render delays resize..
3201 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3202 // _this.trbodycol.el.setWidth(bd.width+20);
3204 var bd = _this.trform2.findField('extended');
3208 // since render delays resize..
3209 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3210 // _this.trextendcol.el.setWidth(bd.width+20);
3220 labelAlign : 'right',
3223 showHide : function() {
3225 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3226 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3227 var has_lang = _this.trform.findField('language').getValue().length;
3229 _this.westLayoutPanel.getLayout().getRegion('south').show();
3230 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3231 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3232 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3235 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3238 if(!has_extended && has_lang){
3239 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3240 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3248 var el = _this.trform.findField(k);
3249 el.actionMode = 'fieldEl';
3251 Roo.log("show: " + k);
3254 Roo.log("hide: " + k);
3259 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3262 if(typeof(_this.trform.editors) == 'undefined'){
3263 _this.trform.editors = {
3264 body : _this.trform1.findField('body').wrap.isVisible(),
3265 extended : _this.trform2.findField('extended').wrap.isVisible()
3267 if(_this.trform.editors.body){
3268 setInterval(_this.trform1.findField('body').autosave, 60000);
3271 if(_this.trform.editors.extended){
3272 setInterval(_this.trform2.findField('extended').autosave, 60000);
3276 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3277 setInterval(_this.trform1.findField('body').autosave, 60000);
3278 _this.trform.editors.body = true;
3281 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3282 setInterval(_this.trform2.findField('extended').autosave, 60000);
3283 _this.trform.editors.extended = true;
3288 style : 'margin: 5px',
3289 trackResetOnLoad : true,
3290 url : baseURL + '/Roo/cms_page.php',
3292 actioncomplete : function (_self, action)
3294 if (action.type =='submit') {
3298 if (action.type == 'setdata') {
3299 _this.trform.addForm(_this.trform1);
3300 _this.trform.addForm(_this.trform2);
3301 _this.trform.addForm(_this.trform3);
3303 if ( _this.data.id) {
3305 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3307 this.trpanel.el.mask("save first");
3314 if (action.type == 'load') {
3315 // _this.dialog.el.unmask();
3318 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3319 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3320 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3321 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3326 actionfailed : function (_self, action)
3328 _this.dialog.el.unmask();
3330 Pman.standardActionFailed(_self, action);
3332 rendered : function (_self)
3334 _this.trform = _self;
3338 '|xns' : 'Roo.form',
3345 '|xns' : 'Roo.form',
3352 '|xns' : 'Roo.form',
3357 displayField : 'language_name',
3359 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3360 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3361 forceSelection : true,
3362 hiddenName : 'language',
3364 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3366 name : 'language_name',
3368 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3369 selectOnFocus : true,
3370 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3371 triggerAction : 'all',
3373 valueField : 'language',
3375 add : function (combo)
3377 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3380 _this.trform.reset();
3381 _this.trform1.reset();
3382 _this.trform2.reset();
3384 combo.setValue(res.lang);
3385 combo.el.dom.value = res.lang_name;
3388 _this.trform.showHide();
3389 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3394 render : function (_self)
3396 _this.language = _self;
3398 select : function (combo, record, index)
3401 _this.trform.showHide();
3402 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3409 'lookup[language]' : record.data.language,
3410 'lookup[translation_of_id]' : _this.data.id,
3417 '|xns' : 'Roo.form',
3421 sortInfo : { direction : 'ASC', field: 'language' },
3423 beforeload : function (_self, o){
3424 o.params = o.params || {};
3426 o.params._distinct = 'language';
3427 o.params._columns ='language_name,language';
3428 o.params._with_name = true;
3430 if(_this.form.findField('id').getValue()*1 > 0){
3431 o.params.translation_of_id = _this.form.findField('id').getValue();
3437 '|xns' : 'Roo.data',
3439 xtype : 'HttpProxy',
3441 url : baseURL + '/Roo/Cms_page.php',
3446 xtype : 'JsonReader',
3447 fields : [{"name":"language","type":"string"}],
3450 totalProperty : 'total',
3458 style : 'padding-top:12px;padding-left:30px;float:left',
3461 render : function (_self)
3463 _this.updateRow = _self;
3467 '|xns' : 'Roo.form',
3471 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3475 // _this.dialog.el.mask("Saving");
3476 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3477 _this.trform1.findField('body').syncValue();
3478 _this.trform2.findField('extended').syncValue();
3480 _this.trform1.findField('body').pushValue();
3481 _this.trform2.findField('extended').pushValue();
3484 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3485 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3486 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3487 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3488 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3490 if(_this.trform.findField('element_id').getValue()*1 > 0){
3491 _this.trform.findField('is_element').setValue(1);
3494 _this.trform.doAction("submit");
3505 xtype : 'TextField',
3506 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3522 name : 'element_id',
3528 name : 'menu_page_id',
3534 name : 'is_menuitem',
3540 name : 'is_element',
3547 name : 'translation_of_id',
3562 xtype : 'ContentPanel',
3564 fitContainer : true,
3567 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3576 url : baseURL + '/Roo/cms_page.php',
3578 rendered : function (form)
3580 _this.trform1 = form;
3584 '|xns' : 'Roo.form',
3590 '|xns' : 'Roo.form',
3593 xtype : 'HtmlEditor',
3594 autosave : function() {
3596 var body = _this.trform1.findField('body');
3598 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3599 Roo.log('tr body not dirty');
3603 Roo.log('tr body dirty, auto save!');
3605 body.fireEvent('autosave', body);
3607 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3611 white : [ 'iframe' ],
3613 autosave : function (_self)
3615 var id = _this.trform.findField('id').getValue() * 1;
3618 if(!_self.editorcore.sourceEditMode){
3625 url : baseURL + '/Roo/Events.php',
3629 action : 'AUTOSAVE',
3630 on_id : (id > 0) ? id : 0,
3631 on_table : 'cms_page',
3633 source: _self.getValue()
3635 success : function() {
3636 _self.originalValue = _self.getValue();
3639 failure : function()
3641 //Roo.MessageBox.alert("Error", "autosave failed");
3642 Roo.log('tr body autosave failed?!');
3646 savedpreview : function (_self)
3648 var id = _this.trform.findField('id').getValue() * 1;
3650 var successFn = function(res){
3651 return res.data.POST.source;
3655 action : 'AUTOSAVE',
3657 on_id : (id < 1) ? 0 : id,
3658 on_table : 'cms_page',
3659 successFn : successFn
3663 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3664 _self.setValue(res);
3665 _self.originalValue = res;
3668 stylesheetsclick : function (_self)
3670 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3671 _this.dialog.setStylesheets();
3677 '|xns' : 'Roo.form',
3680 xtype : 'ToolbarStandard',
3681 xns : Roo.form.HtmlEditor,
3682 '|xns' : 'Roo.form.HtmlEditor',
3687 displayField : 'name',
3689 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3690 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3691 forceSelection : true,
3693 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3696 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3697 selectOnFocus : true,
3698 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>',
3699 triggerAction : 'all',
3704 beforequery : function (combo, query, forceAll, cancel, e)
3707 var id = _this.form.findField('id').getValue() * 1;
3709 Roo.MessageBox.alert("Error", "Save press release first");
3713 render : function (_self)
3715 _this.trbodyimgselect = _self;
3717 select : function (combo, record, index)
3724 var editor = _this.trform.findField('body').editorcore;
3726 var curnode = editor.getSelectedNode();
3728 if (curnode && curnode.tagName == 'IMG') {
3729 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3730 baseURL, record.data.id, record.data.filename
3732 // note -forces an update... hopefully...
3733 editor.owner.fireEvent('editorevent', editor, false);
3736 editor.insertAtCursor(
3737 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3738 baseURL, record.data.id, record.data.filename
3747 '|xns' : 'Roo.form',
3751 sortInfo : { direction : 'ASC', field: 'id' },
3753 beforeload : function (_self, o){
3754 o.params = o.params || {};
3756 var id = _this.form.findField('id').getValue() * 1;
3758 Roo.MessageBox.alert("Error", "Save press release first");
3762 o.params.ontable = 'cms_page';
3763 // o.params.imgtype = 'PressRelease';
3764 //o.params['query[imagesize]'] = '150x150';
3769 '|xns' : 'Roo.data',
3771 xtype : 'HttpProxy',
3773 url : baseURL + '/Roo/Images.php',
3778 xtype : 'JsonReader',
3779 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3782 totalProperty : 'total',
3791 displayField : 'page_link',
3793 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3794 forceSelection : true,
3795 hiddenName : 'add_link_id',
3797 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3801 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3802 selectOnFocus : true,
3803 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3804 triggerAction : 'all',
3809 select : function (combo, record, index)
3815 var editor = _this.form.findField('body');
3816 editor.insertAtCursor(
3817 String.format('<a href="#page-{0}">{1}</a>',
3818 record.data.page_link, record.data.title
3826 '|xns' : 'Roo.form',
3830 sortInfo : { field: 'page_link', direction: 'ASC' },
3832 beforeload : function (_self, options)
3834 options.params['search[page_link_no_empty]'] =1;
3836 options.params.is_element = 0;
3837 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3842 '|xns' : 'Roo.data',
3844 xtype : 'HttpProxy',
3846 url : baseURL + '/Roo/cms_page.php',
3851 xtype : 'JsonReader',
3853 { name: 'id', type: 'int' },
3859 totalProperty : 'total',
3866 xtype : 'Separator',
3868 '|xns' : 'Roo.Toolbar'
3872 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3874 click : function (_self, e)
3876 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3880 '|xns' : 'Roo.Toolbar'
3885 xtype : 'ToolbarContext',
3886 xns : Roo.form.HtmlEditor,
3887 '|xns' : 'Roo.form.HtmlEditor'
3898 xtype : 'ContentPanel',
3900 fitContainer : true,
3903 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3912 url : baseURL + '/Roo/cms_page.php',
3914 rendered : function (form)
3916 _this.trform2 = form;
3920 '|xns' : 'Roo.form',
3926 '|xns' : 'Roo.form',
3929 xtype : 'HtmlEditor',
3930 autosave : function() {
3932 var extended = _this.trform2.findField('extended');
3934 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3935 Roo.log('tr extend not dirty');
3940 Roo.log('tr extend dirty, auto save!');
3942 extended.fireEvent('autosave', extended);
3946 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3950 white : [ 'iframe' ],
3952 autosave : function (_self)
3954 var id = _this.trform.findField('id').getValue() * 1;
3957 if(!_self.editorcore.sourceEditMode){
3965 url : baseURL + '/Roo/Events.php',
3969 action : 'AUTOSAVE',
3970 on_id : (id > 0) ? id : 0,
3971 on_table : 'cms_page',
3972 remarks : 'EXTENDED',
3973 source: _self.getValue()
3975 success : function() {
3976 _self.originalValue = _self.getValue();
3979 failure : function()
3981 //Roo.MessageBox.alert("Error", "autosave failed");
3982 Roo.log('tr extended autosave failed?!');
3986 savedpreview : function (_self)
3988 var id = _this.trform.findField('id').getValue() * 1;
3990 var successFn = function(res){
3991 return res.data.POST.source;
3995 action : 'AUTOSAVE',
3996 remarks : 'EXTENDED',
3997 on_id : (id < 1) ? 0 : id,
3998 on_table : 'cms_page',
3999 successFn : successFn
4003 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4004 _self.setValue(res);
4005 _self.originalValue = res;
4008 stylesheetsclick : function (_self)
4010 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4011 _this.dialog.setStylesheets();
4017 '|xns' : 'Roo.form',
4020 xtype : 'ToolbarStandard',
4021 xns : Roo.form.HtmlEditor,
4022 '|xns' : 'Roo.form.HtmlEditor',
4025 xtype : 'Separator',
4027 '|xns' : 'Roo.Toolbar'
4031 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4033 click : function (_self, e)
4035 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4039 '|xns' : 'Roo.Toolbar'
4044 xtype : 'ToolbarContext',
4045 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4046 xns : Roo.form.HtmlEditor,
4047 '|xns' : 'Roo.form.HtmlEditor'
4058 xtype : 'ContentPanel',
4060 fitContainer : true,
4063 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4072 url : baseURL + '/Roo/cms_page.php',
4074 rendered : function (form)
4076 _this.trform3 = form;
4080 '|xns' : 'Roo.form',
4085 '|xns' : 'Roo.form',
4089 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4098 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4100 name : 'descriptions',