1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CmsBlog = {
10 '2f26e35d61be90501e099089dc533638' :"Select Images",
11 'f3912172e6bf57f8979782f4a2342233' :"Appears in Block",
12 '95cb4f45ab7ff3984f25ab8668499020' :"Select Parent",
13 'c1df1da7a1ce305a3b60af9d5733ac1d' :"Contents",
14 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
15 'ebd9bec4d70abc789d439c1f136b0538' :"Layout",
16 '20bec77364d863100a1f9325873a8504' :"Select Page Type",
17 'a517747c3d12f99244ae598910d979c5' :"Author",
18 '31fde7b05ac8952dacf4af8a704074ec' :"Preview",
19 '779e2624ddf330fb05b51ae59faf212d' :"Select Status Type",
20 '5834d26e96dbae06029496e5b111dca2' :"Has Extended content?",
21 '6a5b847af3d97df722040debdbccfbed' :"Page Type",
22 '30d1a216420426fcbd43ca70acd4aa48' :"Select interests",
23 'f03ab16cd58372c77ba45a3d9a5a1cb9' :"Draft",
24 'cc6892c9705afcfa61c53698756ba51b' :"Page Class",
25 'e6b391a8d2c4d45902a23a8b6585703d' :"URL",
26 '03368e3c1eb4d2a9048775874301b19f' :"Select category",
27 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
28 '778551900655782c5c7827332b08cf3f' :"Save and close",
29 '77174410b72decfd0b259961f1f65a8f' :"Attributes:",
30 'b28a711cf7e94ec793ef926633997529' :"Seq",
31 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
32 '8a53accfc94c2500b00575ce0e0d786f' :"Primary Image",
33 '580b21aac58f1b73cece26e272cdfbee' :"Add Link",
34 '8bc84316c4078bf66723fd019616d920' :"Descriptions",
35 '83dad8107f9459efe2b4fabcf5b63108' :"Select Language",
36 '76729937a5eb6b0fd88c42581161facd' :"Select Category ",
37 '0b8d92bc19b720bb1065649535463409' :"Translations",
38 '14c21301c0faf9d5561b8a580be21a13' :"Select class",
39 'd41d8cd98f00b204e9800998ecf8427e' :"",
40 '867343577fa1f33caa632a19543bd252' :"Keywords",
41 '340c2ee497b85d5954b01c64de7f44f6' :"Select Person",
42 '69dd756ae9c23191a5bb9b61f0857432' :"Date to Publish",
43 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
44 '57e195426892c5515935f21d97228814' :"Extended Contents",
45 'd88aa1eee60ba140f07d5f81769cec74' :"<< Edit Translations",
46 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
47 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
48 'cfcd208495d565ef66e7dff9f98764da' :"0",
49 'd8e4d1f5e445107e505b2cf63a1fb65c' :"Extra CSS",
50 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
51 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
52 'c02bd0c22c290ae599ee2f3ff2023fd3' :"Manage Images / Attachments >>",
53 'b78a3223503896721cca1303f776159b' :"Title",
54 '39f64cc9436cacfbceda3b7bdeb8e24c' :"Styles (CSS)",
55 'e64df1d7c22b9638f084ce8a4aff3ff3' :"Target URL",
56 '98e93e8f7adfe14832db6caed713d849' :"Meta Tags",
57 'a240fa27925a635b08dc28c9e4f9216d' :"Order",
58 '287234a1ff35a314b5b6bc4e5828e745' :"Attributes",
59 '99e7707748ae048e17c5810fad119e0b' :"Select Page",
60 '06933067aafd48425d67bcb01bba5cb6' :"Update",
61 '8adedb6a6226807ba810215dd3b3c61b' :"Menu links to Page",
62 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' :"Select Section",
63 '2ad41a2ff4f0dac97d63aff331d5e6e7' :"Downloads first Attachment",
64 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
65 '76eb64a1725ee953c664e15c9213b2fd' :"Extended Content",
66 '1351017ac6423911223bc19a8cb7c653' :"Filename",
67 'c9cc8cce247e49bae79f15173ce97354' :"Save",
68 'e659b52eba1f0299b2d8ca3483919e72' :"Type:",
69 'c70952e4ab3806c049737cd7d2b8896b' :"Interests",
70 'aa6356b678bc4fc78253c9edf65bff03' :"Edit Page / Blog Entry",
71 'd52f80f80467bb575253a5a39ca016a7' :"Page link / Name / Order",
72 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images",
73 '30269022e9d8f51beaabb52e5d0de2b7' :"Parent",
74 'fb3f11443065d5f4d8303ad913db9680' :"Replaces (ignore)"
77 'seq_id_fieldLabel' : 'b28a711cf7e94ec793ef926633997529' /* Seq */ ,
78 'to_replace_id_fieldLabel' : 'fb3f11443065d5f4d8303ad913db9680' /* Replaces (ignore) */ ,
79 'template_id_template_clean_fieldLabel' : 'ebd9bec4d70abc789d439c1f136b0538' /* Layout */ ,
80 'page_cls_name_fieldLabel' : 'cc6892c9705afcfa61c53698756ba51b' /* Page Class */ ,
81 'language_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
82 'template_id_template_clean_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
83 'author_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
84 'page_type_id_display_name_fieldLabel' : '6a5b847af3d97df722040debdbccfbed' /* Page Type */ ,
85 'has_extended_boxLabel' : '5834d26e96dbae06029496e5b111dca2' /* Has Extended content? */ ,
86 'language_name_emptyText' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
87 'author_id_name_qtip' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
88 'menu_page_id_page_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
89 'published_fieldLabel' : '69dd756ae9c23191a5bb9b61f0857432' /* Date to Publish */ ,
90 'author_id_name_fieldLabel' : 'a517747c3d12f99244ae598910d979c5' /* Author */ ,
91 'element_id_name_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
92 'parent_id_title_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
93 'element_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
94 'author_id_name_emptyText' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
95 'is_attachment_boxLabel' : '2ad41a2ff4f0dac97d63aff331d5e6e7' /* Downloads first Attachment */ ,
96 'extra_css_fieldLabel' : '39f64cc9436cacfbceda3b7bdeb8e24c' /* Styles (CSS) */ ,
97 'template_id_template_clean_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
98 'parent_id_title_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
99 'is_draft_fieldLabel' : '287234a1ff35a314b5b6bc4e5828e745' /* Attributes */ ,
100 'add_link_emptyText' : '580b21aac58f1b73cece26e272cdfbee' /* Add Link */ ,
101 'keywords_fieldLabel' : '867343577fa1f33caa632a19543bd252' /* Keywords */ ,
102 'descriptions_fieldLabel' : '8bc84316c4078bf66723fd019616d920' /* Descriptions */ ,
103 'add_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
104 'menu_page_id_page_link_emptyText' : '99e7707748ae048e17c5810fad119e0b' /* Select Page */ ,
105 'element_id_name_fieldLabel' : 'f3912172e6bf57f8979782f4a2342233' /* Appears in Block */ ,
106 'is_element_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ ,
107 'target_url_fieldLabel' : 'e64df1d7c22b9638f084ce8a4aff3ff3' /* Target URL */ ,
108 'interest_name_fieldLabel' : 'c70952e4ab3806c049737cd7d2b8896b' /* Interests */ ,
109 'language_name_qtip' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
110 'page_type_id_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
111 'language_name_fieldLabel' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
112 'element_id_name_emptyText' : 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' /* Select Section */ ,
113 'menu_page_id_page_link_fieldLabel' : '8adedb6a6226807ba810215dd3b3c61b' /* Menu links to Page */ ,
114 'page_type_id_display_name_emptyText' : '779e2624ddf330fb05b51ae59faf212d' /* Select Status Type */ ,
115 'template_id_template_clean_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
116 'menu_page_id_page_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
117 'extended_fieldLabel' : '57e195426892c5515935f21d97228814' /* Extended Contents */ ,
118 'add_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
119 'category_name_fieldLabel' : '3adbdb3ac060038aa0e6e6c138ef9873' /* Category */ ,
120 'page_type_id_display_name_qtip' : '20bec77364d863100a1f9325873a8504' /* Select Page Type */ ,
121 'body_fieldLabel' : 'c1df1da7a1ce305a3b60af9d5733ac1d' /* Contents */ ,
122 'parent_id_title_emptyText' : '95cb4f45ab7ff3984f25ab8668499020' /* Select Parent */ ,
123 'title_fieldLabel' : 'b78a3223503896721cca1303f776159b' /* Title */ ,
124 'is_draft_boxLabel' : 'f03ab16cd58372c77ba45a3d9a5a1cb9' /* Draft */ ,
125 'page_link_fieldLabel' : 'd52f80f80467bb575253a5a39ca016a7' /* Page link / Name / Order */ ,
126 'parent_id_title_fieldLabel' : '30269022e9d8f51beaabb52e5d0de2b7' /* Parent */
132 show : function(data, cb)
140 this.dialog.show(this.data._el);
143 this.form.setValues(data);
144 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
152 this.dialog = Roo.factory({
153 xtype : 'LayoutDialog',
160 setStylesheets : function() {
163 sheets.push(rootURL + '/Pman/Cms/templates/undoreset.css');
165 if(typeof(uiConfig) !== 'undefined' && typeof(uiConfig.cms_css) != 'undefined'){
166 Roo.each(uiConfig.cms_css, function(v){
167 sheets.push(rootURL + v);
172 url : baseURL + '/Roo/Cms_page.php',
177 success : function(res) {
179 if(res.data._stylesheets.length){
180 var setting = res.data._stylesheets.split("\n");
182 Roo.each(setting, function(s){
183 sheets.push(s.replace('{rootURL}', rootURL));
188 _this.form1.findField('body').removeStylesheets();
189 _this.form2.findField('extended').removeStylesheets();
191 _this.form1.findField('body').setStylesheets(sheets);
192 _this.form2.findField('extended').setStylesheets(sheets);
194 _this.trform1.findField('body').removeStylesheets();
195 _this.trform2.findField('extended').removeStylesheets();
197 _this.trform1.findField('body').setStylesheets(sheets);
198 _this.trform2.findField('extended').setStylesheets(sheets);
203 title : _this._strings['aa6356b678bc4fc78253c9edf65bff03'] /* Edit Page / Blog Entry */,
206 show : function (_self)
208 // @see the contentpanel - center - resize handler.
210 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
212 var w = Roo.lib.Dom.getViewWidth();
213 var h = Roo.lib.Dom.getViewHeight();
214 this.resizeTo(w-50, h-50);
217 _this.centerLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
218 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
220 Pman.Cms.pageEditAddCustomFields();
223 _this.dialog.getLayout().getRegion('east').collapse();
224 _this.dialog.getLayout().getRegion('west').collapse();
229 var ew = Math.max(250, w-150); // was 350?/ why?
230 //var eh = Math.max(250, h-350) ;
233 var bd = _this.form1.findField('body');
238 // since render delays resize..
239 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
240 //_this.bodycol.el.setWidth(bd.width+20);
242 var bd = _this.form2.findField('extended');
246 // since render delays resize..
247 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
248 // _this.extendcol.el.setWidth(bd.width+20);
250 var bd = _this.form3.findField('extra_css');
253 //_this.keywordscol.el.setWidth(ew+20);
256 // fix messed up scroll.
257 _this.dialog.layout.el.dom.scrollTop = 0;
265 xtype : 'LayoutRegion',
271 xtype : 'LayoutRegion',
273 collapsedTitle : 'Images / Attachments',
277 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
280 expanded : function (_self)
282 var id = _this.form.findField('id').getValue() * 1;
285 Roo.MessageBox.alert('Error', 'Save first');
290 var w = Roo.lib.Dom.getViewWidth();
291 var h = Roo.lib.Dom.getViewHeight();
293 _self.resizeTo.defer(110, _self,[ w-400, h] );
294 _this.dialog.getLayout().getRegion('west').collapse();
301 xtype : 'LayoutRegion',
303 collapsedTitle : 'Translations',
307 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
310 beforecollapse : function (_self)
312 if(!_this.trform || !_this.trform1 || !_this.trform2){
317 !_this.trform.isDirty() &&
318 !_this.trform1.isDirty() &&
319 !_this.trform2.isDirty() &&
320 !_this.trform3.isDirty()
325 Roo.MessageBox.confirm(
327 "Do you want to save the translation",
330 _self.collapse(true, true);
340 collapsed : function (_self)
342 if(_this.trform && _this.trform.isDirty()){
343 _this.trform.reset();
344 Roo.log('reset trform');
347 if(_this.trform1 && _this.trform1.isDirty()){
348 _this.trform1.reset();
349 Roo.log('reset trform1');
352 if(_this.trform2 && _this.trform2.isDirty()){
353 _this.trform2.reset();
354 Roo.log('reset trform2');
357 if(_this.trform3 && _this.trform3.isDirty()){
358 _this.trform3.reset();
359 Roo.log('reset trform3');
363 expanded : function (_self)
365 var id = _this.form.findField('id').getValue() * 1;
368 Roo.MessageBox.alert('Error', 'Save first');
373 var w = Roo.lib.Dom.getViewWidth();
374 var h = Roo.lib.Dom.getViewHeight();
376 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
378 _this.panel.region.collapse();
388 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
392 var page_link = _this.form.findField('page_link').getValue();
394 if(!page_link.length){
395 Roo.MessageBox.alert('Error', 'Please fill in the page link');
399 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
400 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
404 var url = uiConfig.cms_page_preview_base + page_link;
414 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
419 _this.trform.isDirty() ||
420 _this.trform1.isDirty() ||
421 _this.trform2.isDirty() ||
422 _this.trform3.isDirty()
424 Roo.MessageBox.confirm(
426 "Do you want to save the translation",
452 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
457 if(!_this.form1.findField('body').editorcore.sourceEditMode){
458 _this.form1.findField('body').syncValue();
459 _this.form2.findField('extended').syncValue();
460 Roo.log('syncValue');
462 _this.form1.findField('body').pushValue();
463 _this.form2.findField('extended').pushValue();
464 Roo.log('pushValue');
467 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
468 _this.interests.reset();
472 _this.trform.isDirty() ||
473 _this.trform1.isDirty() ||
474 _this.trform2.isDirty() ||
475 _this.trform3.isDirty()
477 Roo.MessageBox.confirm(
479 "Do you want to save the translation",
482 _this.dialog.el.mask("Saving");
483 _this.form.doAction("submit");
493 _this.dialog.el.mask("Saving");
494 _this.form.doAction("submit");
503 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
509 if(!_this.form1.findField('body').editorcore.sourceEditMode){
510 _this.form1.findField('body').syncValue();
511 _this.form2.findField('extended').syncValue();
513 _this.form1.findField('body').pushValue();
514 _this.form2.findField('extended').pushValue();
517 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
518 _this.interests.reset();
523 _this.trform.isDirty() ||
524 _this.trform1.isDirty() ||
525 _this.trform2.isDirty() ||
526 _this.trform3.isDirty()
528 Roo.MessageBox.confirm(
530 "Do you want to save the translation",
533 _this.dialog.el.mask("Saving");
534 _this.form.doAction("submit");
544 _this.dialog.el.mask("Saving");
545 _this.form.doAction("submit");
555 xtype : 'NestedLayoutPanel',
561 render : function (_self)
563 _this.centerLayoutPanel = this;
570 xtype : 'BorderLayout',
574 xtype : 'LayoutRegion',
580 xtype : 'LayoutRegion',
589 xtype : 'ContentPanel',
594 render : function (_self)
596 _this.cpanel = _self;
598 resize : function (_self, width, height)
600 Roo.log("RESIZE, " + width + ',' + height);
602 var ew = Math.max(250, width - 10);
603 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
610 bd = _this.form1.findField('body');
614 // since render delays resize..
615 Roo.log('resizing body to ' + bd.width);
616 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
617 // _this.bodycol.el.setWidth(bd.width+20);
622 bd = _this.form2.findField('extended');
628 Roo.log('resizing extended to ' + bd.width);
629 // since render delays resize..
630 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
631 // _this.extendcol.el.setWidth(bd.width+20);
636 bd = _this.form3.findField('extra_css');
640 // _this.keywordscol.el.setWidth(ew+20);
642 // fix for messed up rendering of dialog?
646 _this.dialog.layout.el.dom.scrollTop = 0;
648 // noop... - the above sometimes fails...
661 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
663 click : function (_self, e)
665 if (_this.dialog.getLayout().getRegion('west').collapsed) {
666 _this.dialog.getLayout().getRegion('west').expand();
668 _this.dialog.getLayout().getRegion('west').collapse();
674 '|xns' : 'Roo.Toolbar'
679 '|xns' : 'Roo.Toolbar'
683 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
685 click : function (_self, e)
687 if (_this.panel.region.collapsed) {
688 _this.panel.region.expand();
690 _this.panel.region.collapse();
696 '|xns' : 'Roo.Toolbar'
705 _this.form.setValues(_this.data);
709 _this.dialog.el.unmask();
710 _this.grid.getDataSource().load();
712 _this.trform.reset();
713 _this.trform1.reset();
714 _this.trform2.reset();
716 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
717 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
720 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
721 catlabel.dom.innerHTML = 'Category';
723 if(_this.data.page_type_id_name == 'category'){
724 catlabel.dom.innerHTML = 'Parent Category';
728 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
729 catlabel.dom.innerHTML = 'Parent page';
730 if(_this.data.page_type_id_name == 'category'){
731 catlabel.dom.innerHTML = 'Parent';
734 // better if this was not here... - not sure which project uses it?
736 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
737 _this.interestsCol.show();
740 if(typeof(d['interests']) != 'undefined'){
741 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
744 if(typeof(d['categories']) != 'undefined'){
745 _this.form.findField('category').setValue(Roo.decode(d['categories']));
748 if(typeof(d['page_classes']) != 'undefined'){
749 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
752 _this.trpanel.el.unmask();
753 _this.panel.el.unmask();
756 _this.cpanel.el.dom.scrollTop = 0;
758 // fix messed up scroll.
759 _this.dialog.layout.el.dom.scrollTop = 0;
762 labelAlign : 'right',
765 showHide : function()
772 var page_type_name = _this.form.findField('page_type_id_name').getValue();
774 switch(page_type_name){
797 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
798 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
799 var has_extended = _this.form.findField('has_extended').getValue() * 1;
802 is_attachment : !in_rss,
804 category_type_id : in_rss && !is_menu,
805 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
806 target_url : is_menu,
808 category : !is_category,
810 parent_id : !in_rss || is_category ,
813 to_replace_id :false, // !in_rss, // is this used.
814 is_draft : !is_system_page,
815 author_id : in_rss && !is_menu && !is_attachment,
817 template_id : !is_attachment && !is_menu && !is_system_page,
818 element_id : is_element && !is_menu,
819 menu_page_id : is_menu,
820 page_cls : is_element
822 // has_extended : !is_menu && !is_attachment, // always shown.
823 // extended : has_extended && !is_menu && !is_attachment,
824 // body : !is_attachment && !is_menu,
825 //keywords : !is_attachment && !is_menu,
826 // descriptions : !is_attachment && !is_menu
827 // extra_css : !is_attachment && !is_menu
831 var el = _this.form.findField(k);
834 Roo.log("missing field " + k);
838 el.actionMode = 'fieldEl';
848 _this.centerLayoutPanel.getLayout().getRegion('south').show();
849 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
850 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
851 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
852 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
854 if(is_attachment || is_menu){
856 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
860 if(!has_extended && !is_attachment && !is_menu){
861 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
862 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
866 _this.trform.showHide();
868 if(typeof(_this.form.editors) == 'undefined'){
869 _this.form.editors = {
870 body : _this.form1.findField('body').wrap.isVisible(),
871 extended : _this.form2.findField('extended').wrap.isVisible()
874 if(_this.form.editors.body){
875 setInterval(_this.form1.findField('body').autosave, 60000);
878 if(_this.form.editors.extended){
879 setInterval(_this.form2.findField('extended').autosave, 60000);
883 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
884 setInterval(_this.form1.findField('body').autosave, 60000);
885 _this.form.editors.body = true;
888 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
889 setInterval(_this.form2.findField('extended').autosave, 60000);
890 _this.form.editors.extended = true;
896 style : 'margin: 5px',
897 url : baseURL + '/Roo/cms_page.php',
899 actioncomplete : function (_self, action)
902 if (action.type == 'setdata') {
904 _this.form.addForm(_this.form1);
905 _this.form.addForm(_this.form2);
906 _this.form.addForm(_this.form3);
907 _this.form.addForm(_this.form4);
909 _this.dialog.setStylesheets();
911 _this.dialog.getLayout().getRegion('west').collapse();
912 _this.panel.region.collapse();
914 _this.trpanel.el.mask('Save first');
915 _this.panel.el.mask('Save first');
917 _this.loaded = false;
918 _this.interestsCol.hide();
920 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
922 if ( _this.data.id) {
923 _this.dialog.el.mask("Loading");
924 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
928 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
929 this.findField('is_draft').setValue(is_draft);
930 _this.page_type.setValue(_this.data.page_type_id);
931 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
933 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
934 _this.interestsCol.show();
937 _this.form.showHide();
940 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
941 catlabel.dom.innerHTML = 'Category';
942 if(_this.data.page_type_id_name == 'category'){
943 catlabel.dom.innerHTML = 'Parent Category';
948 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
949 catlabel.dom.innerHTML = 'Parent page';
950 if(_this.data.page_type_id_name == 'category'){
951 catlabel.dom.innerHTML = 'Parent';
957 if(_this.data._is_copy){
958 _this.form.is_copy();
964 if (action.type == 'load') {
966 //_this.data = action.result.data;
968 var d = action.result.data;
970 _this.dialog.el.unmask();
971 _this.grid.getDataSource().load();
973 _this.trform.reset();
974 _this.trform1.reset();
975 _this.trform2.reset();
976 _this.trform3.reset();
978 _this.trform.addForm(_this.trform1);
979 _this.trform.addForm(_this.trform2);
981 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
982 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
983 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
984 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
985 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
988 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
989 catlabel.dom.innerHTML = 'Category';
991 if(_this.data.page_type_id_name == 'category'){
992 catlabel.dom.innerHTML = 'Parent Category';
996 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
997 catlabel.dom.innerHTML = 'Parent page';
998 if(_this.data.page_type_id_name == 'category'){
999 catlabel.dom.innerHTML = 'Parent';
1002 // better if this was not here... - not sure which project uses it?
1004 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
1005 _this.interestsCol.show();
1008 if(typeof(d['interests']) != 'undefined'){
1009 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1012 if(typeof(d['categories']) != 'undefined'){
1013 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1016 if(typeof(d['page_classes']) != 'undefined'){
1017 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1020 _this.trpanel.el.unmask();
1021 _this.panel.el.unmask();
1024 _this.cpanel.el.dom.scrollTop = 0;
1026 // fix messed up scroll.
1027 _this.dialog.layout.el.dom.scrollTop = 0;
1031 if (action.type =='submit') {
1033 _this.dialog.el.unmask();
1036 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1040 _this.dialog.hide();
1043 if (_this.callback) {
1044 _this.callback.call(_this, action.result.data);
1050 actionfailed : function (_self, action)
1052 _this.dialog.el.unmask();
1053 Pman.standardActionFailed(_self, action);
1055 rendered : function (_self)
1061 '|xns' : 'Roo.form',
1068 '|xns' : 'Roo.form',
1073 labelAlign : 'right',
1075 style : 'height:30px;overflow:hidden',
1078 '|xns' : 'Roo.form',
1082 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1091 style : 'height:30px;overflow:hidden',
1094 '|xns' : 'Roo.form',
1099 displayField : 'display_name',
1101 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1102 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1103 forceSelection : true,
1104 hiddenName : 'page_type_id',
1106 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1108 name : 'page_type_id_display_name',
1110 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1111 selectOnFocus : true,
1112 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1113 triggerAction : 'all',
1117 render : function (_self)
1119 _this.page_type = _self;
1121 select : function (combo, record, index)
1123 // _this.grid.footer.onClick('first');
1124 var page_type_name = record.data.name;
1125 _this.form.findField('page_type_id_name').setValue(page_type_name);
1126 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1127 _this.form.findField('is_attachment').setValue(0);
1131 _this.form.showHide.defer(100, _this.form);
1137 '|xns' : 'Roo.form',
1141 sortInfo : { direction : 'ASC', field: 'seqid' },
1143 beforeload : function (_self, o){
1144 o.params = o.params || {};
1146 o.params.etype = 'cms_page_type';
1150 '|xns' : 'Roo.data',
1152 xtype : 'HttpProxy',
1154 url : baseURL + '/Roo/core_enum.php',
1159 xtype : 'JsonReader',
1160 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1163 totalProperty : 'total',
1172 style : 'padding-left: -70px;',
1175 '|xns' : 'Roo.form',
1178 xtype : 'NumberField',
1179 decimalPrecision : 0,
1180 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1195 labelAlign : 'right',
1197 style : 'height:30px;overflow:hidden',
1200 '|xns' : 'Roo.form',
1204 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1213 style : 'height:30px;overflow:hidden',
1216 '|xns' : 'Roo.form',
1220 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1221 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1229 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1231 name : 'has_extended',
1234 check : function (_self, checked)
1239 _this.form.showHide();
1240 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1251 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1253 name : 'is_attachment',
1256 check : function (_self, checked)
1260 _this.form.showHide.defer(100, _this.form);
1274 displayField : 'name',
1276 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1277 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1278 forceSelection : true,
1279 hiddenName : 'author_id',
1281 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1283 name : 'author_id_name',
1285 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1286 queryParam : 'query[name]',
1287 selectOnFocus : true,
1288 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1289 triggerAction : 'all',
1294 '|xns' : 'Roo.form',
1298 sortInfo : { direction : 'ASC', field: 'name' },
1300 beforeload : function (_self, o){
1301 o.params = o.params || {};
1303 o.params.active = 1;
1304 o.params['query[is_owner]'] = 1;
1308 '|xns' : 'Roo.data',
1310 xtype : 'HttpProxy',
1312 url : baseURL + '/Roo/core_person',
1317 xtype : 'JsonReader',
1318 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1321 totalProperty : 'total',
1328 xtype : 'ComboBoxArray',
1329 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1330 hiddenName : 'category',
1331 name : 'category_name',
1334 '|xns' : 'Roo.form',
1339 displayField : 'display_fullpath',
1341 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1342 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1343 forceSelection : true,
1347 queryParam : 'search[name]',
1348 selectOnFocus : true,
1349 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1350 triggerAction : 'all',
1354 '|xns' : 'Roo.form',
1358 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1360 beforeload : function (_self, o){
1361 o.params = o.params || {};
1363 o.params.page_type_id_name= 'CATEGORY';
1365 o.params._with_fullpath = 1;
1369 '|xns' : 'Roo.data',
1371 xtype : 'HttpProxy',
1373 url : baseURL + '/Roo/cms_page.php',
1378 xtype : 'JsonReader',
1380 {"name":"id","type":"int"},
1381 {"name":"name","type":"string"},
1382 {"name":"display_name","type":"string"}
1386 totalProperty : 'total',
1397 displayField : 'page_link',
1399 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1400 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1401 forceSelection : true,
1402 hiddenName : 'parent_id',
1404 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1406 name : 'parent_id_title',
1408 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1409 selectOnFocus : true,
1410 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1411 triggerAction : 'all',
1416 select : function (combo, record, index)
1418 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1419 if (page_type_name == 'page') { // page
1422 // do not default to put 'Home' at the beginning.
1423 if (!record || !(record.data.parent_id *1)) {
1426 var pl = _this.form.findField('page_link');
1427 var lk = pl.getValue();
1428 var new_link = record.data.page_link + '/';
1430 new_link += lk.split('/').pop();
1432 pl.setValue(new_link);
1437 '|xns' : 'Roo.form',
1441 sortInfo : { field: 'page_link', direction: 'ASC' },
1443 beforeload : function (_self, options)
1445 options.params['search[page_link_no_empty]'] =1;
1447 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1448 options.params._page_type = 'page,element';
1450 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1453 var id = _this.form.findField('id').getValue() * 1;
1456 options.params['!id'] = id;
1461 options.params.is_element = 0;
1462 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1463 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1468 '|xns' : 'Roo.data',
1470 xtype : 'HttpProxy',
1472 url : baseURL + '/Roo/cms_page.php',
1477 xtype : 'JsonReader',
1479 { name: 'id', type: 'int' },
1485 totalProperty : 'total',
1495 '|xns' : 'Roo.form',
1498 xtype : 'DateField',
1499 altFormats : 'Y-m-d H:i:s',
1500 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1508 xtype : 'TextField',
1509 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1510 name : 'to_replace_id',
1518 xtype : 'TextField',
1519 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1523 keyup : function (_self, e)
1525 if (_this.page_type.getRawValue() == 'Category') {
1527 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1536 xtype : 'TextField',
1537 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1544 xtype : 'TextField',
1545 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1546 name : 'target_url',
1555 displayField : 'template_clean',
1557 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1558 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1559 forceSelection : true,
1560 hiddenName : 'template_id',
1562 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1564 name : 'template_id_template_clean',
1566 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1567 selectOnFocus : true,
1568 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1569 triggerAction : 'all',
1574 '|xns' : 'Roo.form',
1578 sortInfo : { field: 'template', direction: 'ASC' },
1580 beforeload : function (_self, options)
1583 options.params._rescan = 1;
1584 options.params._clean_name = 1;
1585 // options.params.lang = 'en';
1586 options.params['!template[0]'] = 'master.html';
1587 //options.params['!template[1]'] = 'index.html';
1591 '|xns' : 'Roo.data',
1593 xtype : 'HttpProxy',
1595 url : baseURL + '/Roo/Cms_template',
1600 xtype : 'JsonReader',
1602 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1606 totalProperty : 'total',
1616 displayField : 'name',
1618 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1619 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1620 forceSelection : true,
1621 hiddenName : 'element_id',
1623 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1625 name : 'element_id_name',
1627 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1628 selectOnFocus : true,
1629 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1630 triggerAction : 'all',
1635 '|xns' : 'Roo.form',
1639 sortInfo : { field: 'name', direction: 'ASC' },
1641 beforeload : function (_self, options)
1643 var par = _this.form.findField('parent_id').getValue() * 1;
1645 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1649 options.params._cms_page_id = par;
1653 '|xns' : 'Roo.data',
1655 xtype : 'HttpProxy',
1657 url : baseURL + '/Roo/Cms_template_element',
1662 xtype : 'JsonReader',
1664 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1668 totalProperty : 'total',
1678 displayField : 'page_link',
1680 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1681 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1682 forceSelection : true,
1683 hiddenName : 'menu_page_id',
1685 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1687 name : 'menu_page_id_page_link',
1689 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1690 selectOnFocus : true,
1691 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>',
1692 triggerAction : 'all',
1697 '|xns' : 'Roo.form',
1701 sortInfo : { field: 'title', direction: 'ASC' },
1703 beforeload : function (_self, options)
1705 options.params = options.params || {};
1707 options.params['search[page_link_no_empty]'] =1;
1709 options.params['page_type_id_name[0]'] = 'page';
1710 options.params['page_type_id_name[1]'] = 'blog';
1712 options.params.is_element = 0;
1713 options.params.is_menuitem = 0;
1718 '|xns' : 'Roo.data',
1720 xtype : 'HttpProxy',
1722 url : baseURL + '/Roo/cms_page.php',
1727 xtype : 'JsonReader',
1742 "name":"page_type_id_display_name",
1748 totalProperty : 'total',
1755 xtype : 'ComboBoxArray',
1756 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1757 hiddenName : 'page_cls',
1758 name : 'page_cls_name',
1761 '|xns' : 'Roo.form',
1766 displayField : 'display_name',
1768 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1769 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1770 forceSelection : true,
1773 queryParam : 'query[search]',
1774 selectOnFocus : true,
1775 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1776 triggerAction : 'all',
1777 valueField : 'name',
1780 '|xns' : 'Roo.form',
1784 sortInfo : { direction : 'ASC', field: 'seqid' },
1786 beforeload : function (_self, o){
1787 o.params = o.params || {};
1789 o.params.etype = 'cms_page_class';
1793 '|xns' : 'Roo.data',
1795 xtype : 'HttpProxy',
1797 url : baseURL + '/Roo/core_enum.php',
1802 xtype : 'JsonReader',
1804 {"name":"id","type":"int"},
1805 {"name":"name","type":"string"},
1806 {"name":"display_name","type":"string"}
1810 totalProperty : 'total',
1824 '|xns' : 'Roo.form',
1830 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1831 style : 'width: 165px;',
1833 '|xns' : 'Roo.form',
1836 xtype : 'DisplayField',
1838 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1839 name : 'primary_image_id',
1840 style : 'border: 1px solid #ccc;',
1841 valueRenderer : function(v) {
1843 if (!v || v * 1 < 1) {
1844 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1847 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1860 render : function (_self)
1862 _this.interestsCol = _self;
1866 '|xns' : 'Roo.form',
1869 xtype : 'ComboBoxArray',
1870 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1871 hiddenName : 'interest',
1872 name : 'interest_name',
1875 render : function (_self)
1877 _this.interests = _self;
1879 _self.combo.addicon.setStyle( {
1880 position : 'absolute',
1889 '|xns' : 'Roo.form',
1894 displayField : 'display_name',
1896 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1897 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1898 forceSelection : true,
1901 queryParam : 'query[name]',
1902 selectOnFocus : true,
1903 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1904 triggerAction : 'all',
1908 '|xns' : 'Roo.form',
1912 sortInfo : { direction : 'ASC', field: 'name' },
1914 beforeload : function (_self, o){
1915 o.params = o.params || {};
1916 o.params.etype = 'crm_interest';
1920 '|xns' : 'Roo.data',
1922 xtype : 'HttpProxy',
1924 url : baseURL + '/Roo/Core_enum.php',
1929 xtype : 'JsonReader',
1931 {"name":"id","type":"int"},
1932 {"name":"name","type":"string"},
1933 {"name":"display_name","type":"string"}
1937 totalProperty : 'total',
1954 name : 'is_system_page',
1960 name : 'is_menuitem',
1966 name : 'page_type_id_name',
1973 render : function (_self)
1975 _this.user_defined_fields = _self;
1986 xtype : 'ContentPanel',
1988 fitContainer : true,
1991 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2000 url : baseURL + '/Roo/cms_page.php',
2002 rendered : function (form)
2008 '|xns' : 'Roo.form',
2014 '|xns' : 'Roo.form',
2017 xtype : 'HtmlEditor',
2018 autosave : function() {
2020 var body = _this.form1.findField('body');
2022 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2023 Roo.log('body not dirty');
2027 Roo.log('body dirty, auto save!');
2029 body.fireEvent('autosave', body);
2033 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2037 white : [ 'iframe' ],
2040 autosave : function (_self)
2042 Roo.log('autosave');
2044 var id = _this.form.findField('id').getValue() * 1;
2046 if(!_self.editorcore.sourceEditMode){
2053 url : baseURL + '/Roo/Events.php',
2057 action : 'AUTOSAVE',
2058 on_id : (id > 0) ? id : 0,
2059 on_table : 'cms_page',
2061 source: _self.getValue()
2063 success : function() {
2064 _self.originalValue = _self.getValue();
2067 failure : function()
2069 //Roo.MessageBox.alert("Error", "autosave failed");
2070 Roo.log('body autosave failed?!');
2075 savedpreview : function (_self)
2077 Roo.log('saved preview');
2079 var id = _this.form.findField('id').getValue() * 1;
2081 var successFn = function(res){
2082 return res.data.POST.source;
2086 action : 'AUTOSAVE',
2088 on_id : (id < 1) ? 0 : id,
2089 on_table : 'cms_page',
2090 successFn : successFn
2094 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2095 _self.setValue(res);
2096 _self.originalValue = res;
2099 stylesheetsclick : function (_self)
2101 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2102 _this.dialog.setStylesheets();
2108 '|xns' : 'Roo.form',
2111 xtype : 'ToolbarStandard',
2112 xns : Roo.form.HtmlEditor,
2113 '|xns' : 'Roo.form.HtmlEditor',
2118 displayField : 'name',
2120 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2121 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2122 forceSelection : true,
2124 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2127 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2128 queryParam : 'search',
2129 selectOnFocus : true,
2130 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>',
2131 triggerAction : 'all',
2136 beforequery : function (combo, query, forceAll, cancel, e)
2139 var id = _this.form.findField('id').getValue() * 1;
2141 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2145 render : function (_self)
2147 _this.bodyimgselect = _self;
2149 select : function (combo, record, index)
2156 var editor = _this.form.findField('body').editorcore;
2158 var curnode = editor.getSelectedNode();
2160 if (curnode && curnode.tagName == 'IMG') {
2161 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2162 baseURL, record.data.id, record.data.filename
2164 // note -forces an update... hopefully...
2165 editor.owner.fireEvent('editorevent', editor, false);
2168 editor.insertAtCursor(
2169 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2170 baseURL, record.data.id, record.data.filename
2179 '|xns' : 'Roo.form',
2183 sortInfo : { direction : 'ASC', field: 'id' },
2185 beforeload : function (_self, o){
2186 o.params = o.params || {};
2188 var id = _this.form.findField('id').getValue() * 1;
2190 Roo.MessageBox.alert("Error", "Save press release first");
2194 o.params.ontable = 'cms_page';
2195 // o.params.imgtype = 'PressRelease';
2196 //o.params['query[imagesize]'] = '150x150';
2201 '|xns' : 'Roo.data',
2203 xtype : 'HttpProxy',
2205 url : baseURL + '/Roo/Images.php',
2210 xtype : 'JsonReader',
2211 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2214 totalProperty : 'total',
2223 displayField : 'page_link',
2225 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2226 forceSelection : true,
2227 hiddenName : 'add_link_id',
2229 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2233 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2234 selectOnFocus : true,
2235 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2236 triggerAction : 'all',
2241 select : function (combo, record, index)
2247 var editor = _this.form.findField('body');
2248 editor.editorcore.insertAtCursor(
2249 String.format('<a href="#page-{0}">{1}</a>',
2250 record.data.page_link, record.data.title
2258 '|xns' : 'Roo.form',
2262 sortInfo : { field: 'page_link', direction: 'ASC' },
2264 beforeload : function (_self, options)
2266 options.params['search[page_link_no_empty]'] =1;
2268 options.params.is_element = 0;
2269 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2274 '|xns' : 'Roo.data',
2276 xtype : 'HttpProxy',
2278 url : baseURL + '/Roo/cms_page.php',
2283 xtype : 'JsonReader',
2285 { name: 'id', type: 'int' },
2291 totalProperty : 'total',
2298 xtype : 'Separator',
2300 '|xns' : 'Roo.Toolbar'
2304 cls : 'x-init-enable',
2305 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2307 click : function (_self, e)
2309 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2313 '|xns' : 'Roo.Toolbar'
2318 xtype : 'ToolbarContext',
2319 xns : Roo.form.HtmlEditor,
2320 '|xns' : 'Roo.form.HtmlEditor'
2331 xtype : 'ContentPanel',
2333 fitContainer : true,
2336 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2345 url : baseURL + '/Roo/cms_page.php',
2347 rendered : function (form)
2353 '|xns' : 'Roo.form',
2359 '|xns' : 'Roo.form',
2362 xtype : 'HtmlEditor',
2363 autosave : function() {
2365 var extended = _this.form2.findField('extended');
2367 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2368 Roo.log('extend not dirty');
2373 Roo.log('extend dirty, auto save!');
2375 extended.fireEvent('autosave', extended);
2377 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2381 white : [ 'iframe' ],
2384 autosave : function (_self)
2386 var id = _this.form.findField('id').getValue() * 1;
2389 if(!_self.editorcore.sourceEditMode){
2396 url : baseURL + '/Roo/Events.php',
2400 action : 'AUTOSAVE',
2401 on_id : (id > 0) ? id : 0,
2402 on_table : 'cms_page',
2403 remarks : 'EXTENDED',
2404 source: _self.getValue()
2406 success : function() {
2407 _self.originalValue = _self.getValue();
2410 failure : function()
2412 //Roo.MessageBox.alert("Error", "autosave failed");
2413 Roo.log('extended autosave failed?!');
2417 savedpreview : function (_self)
2419 var id = _this.form.findField('id').getValue() * 1;
2421 var successFn = function(res){
2422 return res.data.POST.source;
2426 action : 'AUTOSAVE',
2427 remarks : 'EXTENDED',
2428 on_id : (id < 1) ? 0 : id,
2429 on_table : 'cms_page',
2430 successFn : successFn
2434 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2435 _self.setValue(res);
2436 _self.originalValue = res;
2439 stylesheetsclick : function (_self)
2441 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2442 _this.dialog.setStylesheets();
2448 '|xns' : 'Roo.form',
2451 xtype : 'ToolbarStandard',
2452 xns : Roo.form.HtmlEditor,
2453 '|xns' : 'Roo.form.HtmlEditor',
2458 displayField : 'name',
2460 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2461 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2462 forceSelection : true,
2464 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2467 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2468 selectOnFocus : true,
2469 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2470 triggerAction : 'all',
2475 beforequery : function (combo, query, forceAll, cancel, e)
2478 var id = _this.form.findField('id').getValue() * 1;
2480 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2484 render : function (_self)
2486 _this.extendimgselect = _self;
2488 select : function (combo, record, index)
2495 var editor = _this.form.findField('extended').editorcore;
2497 var curnode = editor.getSelectedNode();
2499 if (curnode && curnode.tagName == 'IMG') {
2500 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2501 baseURL, record.data.id, record.data.filename
2503 // note -forces an update... hopefully...
2504 editor.owner.fireEvent('editorevent', editor, false);
2507 editor.insertAtCursor(
2508 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2509 baseURL, record.data.id, record.data.filename
2518 '|xns' : 'Roo.form',
2522 sortInfo : { direction : 'ASC', field: 'id' },
2524 beforeload : function (_self, o){
2525 o.params = o.params || {};
2527 var id = _this.form.findField('id').getValue() * 1;
2529 Roo.MessageBox.alert("Error", "Save press release first");
2533 o.params.ontable = 'cms_page';
2534 // o.params.imgtype = 'PressRelease';
2535 //o.params['query[imagesize]'] = '150x150';
2540 '|xns' : 'Roo.data',
2542 xtype : 'HttpProxy',
2544 url : baseURL + '/Roo/Images.php',
2549 xtype : 'JsonReader',
2550 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2553 totalProperty : 'total',
2562 displayField : 'page_link',
2564 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2565 forceSelection : true,
2566 hiddenName : 'add_link_id',
2568 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2572 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2573 selectOnFocus : true,
2574 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2575 triggerAction : 'all',
2580 select : function (combo, record, index)
2586 var editor = _this.form.findField('body');
2587 editor.editorcore.insertAtCursor(
2588 String.format('<a href="#page-{0}">{1}</a>',
2589 record.data.page_link, record.data.title
2597 '|xns' : 'Roo.form',
2601 sortInfo : { field: 'page_link', direction: 'ASC' },
2603 beforeload : function (_self, options)
2605 options.params['search[page_link_no_empty]'] =1;
2607 options.params.is_element = 0;
2608 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2613 '|xns' : 'Roo.data',
2615 xtype : 'HttpProxy',
2617 url : baseURL + '/Roo/cms_page.php',
2622 xtype : 'JsonReader',
2624 { name: 'id', type: 'int' },
2630 totalProperty : 'total',
2637 xtype : 'Separator',
2639 '|xns' : 'Roo.Toolbar'
2643 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2645 click : function (_self, e)
2647 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2651 '|xns' : 'Roo.Toolbar'
2656 xtype : 'ToolbarContext',
2657 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2658 xns : Roo.form.HtmlEditor,
2659 '|xns' : 'Roo.form.HtmlEditor'
2670 xtype : 'ContentPanel',
2672 fitContainer : true,
2675 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2684 url : baseURL + '/Roo/cms_page.php',
2686 rendered : function (form)
2692 '|xns' : 'Roo.form',
2698 '|xns' : 'Roo.form',
2702 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2716 xtype : 'ContentPanel',
2718 fitContainer : true,
2721 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2730 url : baseURL + '/Roo/cms_page.php',
2732 rendered : function (form)
2738 '|xns' : 'Roo.form',
2743 '|xns' : 'Roo.form',
2747 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2756 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2758 name : 'descriptions',
2773 xtype : 'GridPanel',
2775 fitContainer : true,
2778 tableName : 'Images',
2779 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2781 activate : function() {
2784 _this.grid.footer.onClick('first');
2791 xtype : 'EditorGrid',
2792 autoExpandColumn : 'title',
2796 render : function() {
2798 //_this.dialog = Pman.Dialog.FILL_IN
2799 if (_this.panel.active) {
2800 //this.footer.onClick('first');
2803 rowdblclick : function (_self, rowIndex, e)
2805 var rd = _this.grid.getDataSource().getAt(rowIndex);
2806 var id = rd.data.id;
2807 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2808 _this.form.findField('contents').execCmd('insertimage', url);
2813 '|xns' : 'Roo.grid',
2821 cls : 'x-btn-text-icon',
2822 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2823 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2827 var id = _this.form.findField('id').getValue() * 1;
2833 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2834 _this.grid.ds.load({});
2844 cls : 'x-btn-text-icon',
2845 icon : rootURL + '/Pman/templates/images/trash.gif',
2846 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2850 var selection = _this.grid.getSelectionModel().getSelectedCell();
2851 var sn = _this.grid.ds.getAt(selection[0]);
2852 if (!sn || isNaN(sn.id *1)) {
2853 Roo.MessageBox.alert("Error", "Select a image");
2856 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2862 url : baseURL + '/Roo/Images.php',
2867 success : function()
2869 Roo.log('Got Success!!');
2870 _this.grid.ds.load({});
2884 beforeload : function (_self, o)
2886 var id = _this.form.findField('id').getValue() * 1;
2892 o.params = o.params || {};
2893 o.params.limit = 9999;
2895 o.params.ontable = 'cms_page';
2897 update : function (_self, rec, operation)
2901 url : baseURL+'/Roo/Images.php',
2904 success: function(res)
2906 Roo.log("GOT success");
2907 // update the data...
2908 _this.grid.ds.load({});
2910 failure : function(res)
2912 Roo.MessageBox.alert('Error', res.errorMsg);
2913 _this.grid.ds.load({});
2921 '|xns' : 'Roo.data',
2923 xtype : 'HttpProxy',
2925 url : baseURL + '/Roo/Images.php',
2930 xtype : 'JsonReader',
2965 'name': 'displayorder',
2973 'name': 'parent_image_id',
2979 'dateFormat': 'Y-m-d'
2998 'name': 'parent_image_id_id',
3002 'name': 'parent_image_id_filename',
3006 'name': 'parent_image_id_ontable',
3010 'name': 'parent_image_id_onid',
3014 'name': 'parent_image_id_mimetype',
3018 'name': 'parent_image_id_width',
3022 'name': 'parent_image_id_height',
3026 'name': 'parent_image_id_filesize',
3030 'name': 'parent_image_id_displayorder',
3034 'name': 'parent_image_id_language',
3038 'name': 'parent_image_id_parent_image_id',
3042 'name': 'parent_image_id_created',
3046 'name': 'parent_image_id_imgtype',
3050 'name': 'parent_image_id_linkurl',
3054 'name': 'parent_image_id_descript',
3058 'name': 'parent_image_id_title',
3064 totalProperty : 'total',
3071 xtype : 'ColumnModel',
3073 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3074 renderer : function(v,x,r) {
3075 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3083 xtype : 'ColumnModel',
3084 dataIndex : 'filename',
3085 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3086 renderer : function(v) { return String.format('{0}', v); },
3092 xtype : 'ColumnModel',
3093 dataIndex : 'displayorder',
3094 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3095 renderer : function(v) { return String.format('{0}', v); },
3098 '|xns' : 'Roo.grid',
3100 xtype : 'GridEditor',
3102 '|xns' : 'Roo.grid',
3104 xtype : 'NumberField',
3105 decimalPrecision : 0,
3107 focus : function (_self)
3109 if (this.value == 0) {
3110 this.el.dom.value = '';
3120 xtype : 'ColumnModel',
3121 dataIndex : 'title',
3122 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3123 renderer : function(v) { return String.format('{0}', v); },
3126 '|xns' : 'Roo.grid',
3128 xtype : 'GridEditor',
3130 '|xns' : 'Roo.grid',
3132 xtype : 'TextField',
3139 xtype : 'ColumnModel',
3140 dataIndex : 'linkurl',
3141 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3142 renderer : function(v)
3144 return String.format('{0}', (v) ? v : '');
3148 '|xns' : 'Roo.grid',
3150 xtype : 'GridEditor',
3152 '|xns' : 'Roo.grid',
3154 xtype : 'TextField',
3164 xtype : 'NestedLayoutPanel',
3166 fitContainer : true,
3170 render : function (_self)
3172 _this.westLayoutPanel = this;
3179 xtype : 'BorderLayout',
3183 xtype : 'LayoutRegion',
3184 tabPosition : 'top',
3189 xtype : 'LayoutRegion',
3192 tabPosition : 'top',
3198 xtype : 'ContentPanel',
3203 render : function (_self)
3205 _this.trpanel = _self;
3207 resize : function (_self, width, height)
3209 Roo.log('resize called');
3211 var ew = Math.max(250, width - 10);
3212 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3215 if (!_this.trform) {
3219 var bd = _this.trform1.findField('body');
3224 // since render delays resize..
3225 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3226 // _this.trbodycol.el.setWidth(bd.width+20);
3228 var bd = _this.trform2.findField('extended');
3232 // since render delays resize..
3233 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3234 // _this.trextendcol.el.setWidth(bd.width+20);
3244 labelAlign : 'right',
3247 showHide : function() {
3249 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3250 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3251 var has_lang = _this.trform.findField('language').getValue().length;
3253 _this.westLayoutPanel.getLayout().getRegion('south').show();
3254 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3255 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3256 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3259 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3262 if(!has_extended && has_lang){
3263 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3264 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3272 var el = _this.trform.findField(k);
3273 el.actionMode = 'fieldEl';
3275 Roo.log("show: " + k);
3278 Roo.log("hide: " + k);
3283 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3286 if(typeof(_this.trform.editors) == 'undefined'){
3287 _this.trform.editors = {
3288 body : _this.trform1.findField('body').wrap.isVisible(),
3289 extended : _this.trform2.findField('extended').wrap.isVisible()
3291 if(_this.trform.editors.body){
3292 setInterval(_this.trform1.findField('body').autosave, 60000);
3295 if(_this.trform.editors.extended){
3296 setInterval(_this.trform2.findField('extended').autosave, 60000);
3300 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3301 setInterval(_this.trform1.findField('body').autosave, 60000);
3302 _this.trform.editors.body = true;
3305 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3306 setInterval(_this.trform2.findField('extended').autosave, 60000);
3307 _this.trform.editors.extended = true;
3312 style : 'margin: 5px',
3313 trackResetOnLoad : true,
3314 url : baseURL + '/Roo/cms_page.php',
3316 actioncomplete : function (_self, action)
3318 if (action.type =='submit') {
3322 if (action.type == 'setdata') {
3323 _this.trform.addForm(_this.trform1);
3324 _this.trform.addForm(_this.trform2);
3325 _this.trform.addForm(_this.trform3);
3327 if ( _this.data.id) {
3329 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3331 this.trpanel.el.mask("save first");
3338 if (action.type == 'load') {
3339 // _this.dialog.el.unmask();
3342 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3343 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3344 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3345 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3350 actionfailed : function (_self, action)
3352 _this.dialog.el.unmask();
3354 Pman.standardActionFailed(_self, action);
3356 rendered : function (_self)
3358 _this.trform = _self;
3362 '|xns' : 'Roo.form',
3369 '|xns' : 'Roo.form',
3376 '|xns' : 'Roo.form',
3381 displayField : 'language_name',
3383 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3384 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3385 forceSelection : true,
3386 hiddenName : 'language',
3388 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3390 name : 'language_name',
3392 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3393 selectOnFocus : true,
3394 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3395 triggerAction : 'all',
3397 valueField : 'language',
3399 add : function (combo)
3401 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3404 _this.trform.reset();
3405 _this.trform1.reset();
3406 _this.trform2.reset();
3408 combo.setValue(res.lang);
3409 combo.el.dom.value = res.lang_name;
3412 _this.trform.showHide();
3413 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3418 render : function (_self)
3420 _this.language = _self;
3422 select : function (combo, record, index)
3425 _this.trform.showHide();
3426 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3433 'lookup[language]' : record.data.language,
3434 'lookup[translation_of_id]' : _this.data.id,
3441 '|xns' : 'Roo.form',
3445 sortInfo : { direction : 'ASC', field: 'language' },
3447 beforeload : function (_self, o){
3448 o.params = o.params || {};
3450 o.params._distinct = 'language';
3451 o.params._columns ='language_name,language';
3452 o.params._with_name = true;
3454 if(_this.form.findField('id').getValue()*1 > 0){
3455 o.params.translation_of_id = _this.form.findField('id').getValue();
3461 '|xns' : 'Roo.data',
3463 xtype : 'HttpProxy',
3465 url : baseURL + '/Roo/Cms_page.php',
3470 xtype : 'JsonReader',
3471 fields : [{"name":"language","type":"string"}],
3474 totalProperty : 'total',
3482 style : 'padding-top:12px;padding-left:30px;float:left',
3485 render : function (_self)
3487 _this.updateRow = _self;
3491 '|xns' : 'Roo.form',
3495 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3499 // _this.dialog.el.mask("Saving");
3500 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3501 _this.trform1.findField('body').syncValue();
3502 _this.trform2.findField('extended').syncValue();
3504 _this.trform1.findField('body').pushValue();
3505 _this.trform2.findField('extended').pushValue();
3508 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3509 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3510 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3511 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3512 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3514 if(_this.trform.findField('element_id').getValue()*1 > 0){
3515 _this.trform.findField('is_element').setValue(1);
3518 _this.trform.doAction("submit");
3529 xtype : 'TextField',
3530 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3546 name : 'element_id',
3552 name : 'menu_page_id',
3558 name : 'is_menuitem',
3564 name : 'is_element',
3571 name : 'translation_of_id',
3586 xtype : 'ContentPanel',
3588 fitContainer : true,
3591 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3600 url : baseURL + '/Roo/cms_page.php',
3602 rendered : function (form)
3604 _this.trform1 = form;
3608 '|xns' : 'Roo.form',
3614 '|xns' : 'Roo.form',
3617 xtype : 'HtmlEditor',
3618 autosave : function() {
3620 var body = _this.trform1.findField('body');
3622 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3623 Roo.log('tr body not dirty');
3627 Roo.log('tr body dirty, auto save!');
3629 body.fireEvent('autosave', body);
3631 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3635 white : [ 'iframe' ],
3637 autosave : function (_self)
3639 var id = _this.trform.findField('id').getValue() * 1;
3642 if(!_self.editorcore.sourceEditMode){
3649 url : baseURL + '/Roo/Events.php',
3653 action : 'AUTOSAVE',
3654 on_id : (id > 0) ? id : 0,
3655 on_table : 'cms_page',
3657 source: _self.getValue()
3659 success : function() {
3660 _self.originalValue = _self.getValue();
3663 failure : function()
3665 //Roo.MessageBox.alert("Error", "autosave failed");
3666 Roo.log('tr body autosave failed?!');
3670 savedpreview : function (_self)
3672 var id = _this.trform.findField('id').getValue() * 1;
3674 var successFn = function(res){
3675 return res.data.POST.source;
3679 action : 'AUTOSAVE',
3681 on_id : (id < 1) ? 0 : id,
3682 on_table : 'cms_page',
3683 successFn : successFn
3687 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3688 _self.setValue(res);
3689 _self.originalValue = res;
3692 stylesheetsclick : function (_self)
3694 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3695 _this.dialog.setStylesheets();
3701 '|xns' : 'Roo.form',
3704 xtype : 'ToolbarStandard',
3705 xns : Roo.form.HtmlEditor,
3706 '|xns' : 'Roo.form.HtmlEditor',
3711 displayField : 'name',
3713 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3714 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3715 forceSelection : true,
3717 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3720 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3721 selectOnFocus : true,
3722 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>',
3723 triggerAction : 'all',
3728 beforequery : function (combo, query, forceAll, cancel, e)
3731 var id = _this.form.findField('id').getValue() * 1;
3733 Roo.MessageBox.alert("Error", "Save press release first");
3737 render : function (_self)
3739 _this.trbodyimgselect = _self;
3741 select : function (combo, record, index)
3748 var editor = _this.trform.findField('body').editorcore;
3750 var curnode = editor.getSelectedNode();
3752 if (curnode && curnode.tagName == 'IMG') {
3753 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3754 baseURL, record.data.id, record.data.filename
3756 // note -forces an update... hopefully...
3757 editor.owner.fireEvent('editorevent', editor, false);
3760 editor.insertAtCursor(
3761 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3762 baseURL, record.data.id, record.data.filename
3771 '|xns' : 'Roo.form',
3775 sortInfo : { direction : 'ASC', field: 'id' },
3777 beforeload : function (_self, o){
3778 o.params = o.params || {};
3780 var id = _this.form.findField('id').getValue() * 1;
3782 Roo.MessageBox.alert("Error", "Save press release first");
3786 o.params.ontable = 'cms_page';
3787 // o.params.imgtype = 'PressRelease';
3788 //o.params['query[imagesize]'] = '150x150';
3793 '|xns' : 'Roo.data',
3795 xtype : 'HttpProxy',
3797 url : baseURL + '/Roo/Images.php',
3802 xtype : 'JsonReader',
3803 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3806 totalProperty : 'total',
3815 displayField : 'page_link',
3817 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3818 forceSelection : true,
3819 hiddenName : 'add_link_id',
3821 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3825 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3826 selectOnFocus : true,
3827 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3828 triggerAction : 'all',
3833 select : function (combo, record, index)
3839 var editor = _this.form.findField('body');
3840 editor.insertAtCursor(
3841 String.format('<a href="#page-{0}">{1}</a>',
3842 record.data.page_link, record.data.title
3850 '|xns' : 'Roo.form',
3854 sortInfo : { field: 'page_link', direction: 'ASC' },
3856 beforeload : function (_self, options)
3858 options.params['search[page_link_no_empty]'] =1;
3860 options.params.is_element = 0;
3861 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3866 '|xns' : 'Roo.data',
3868 xtype : 'HttpProxy',
3870 url : baseURL + '/Roo/cms_page.php',
3875 xtype : 'JsonReader',
3877 { name: 'id', type: 'int' },
3883 totalProperty : 'total',
3890 xtype : 'Separator',
3892 '|xns' : 'Roo.Toolbar'
3896 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3898 click : function (_self, e)
3900 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3904 '|xns' : 'Roo.Toolbar'
3909 xtype : 'ToolbarContext',
3910 xns : Roo.form.HtmlEditor,
3911 '|xns' : 'Roo.form.HtmlEditor'
3922 xtype : 'ContentPanel',
3924 fitContainer : true,
3927 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3936 url : baseURL + '/Roo/cms_page.php',
3938 rendered : function (form)
3940 _this.trform2 = form;
3944 '|xns' : 'Roo.form',
3950 '|xns' : 'Roo.form',
3953 xtype : 'HtmlEditor',
3954 autosave : function() {
3956 var extended = _this.trform2.findField('extended');
3958 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3959 Roo.log('tr extend not dirty');
3964 Roo.log('tr extend dirty, auto save!');
3966 extended.fireEvent('autosave', extended);
3970 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3974 white : [ 'iframe' ],
3976 autosave : function (_self)
3978 var id = _this.trform.findField('id').getValue() * 1;
3981 if(!_self.editorcore.sourceEditMode){
3989 url : baseURL + '/Roo/Events.php',
3993 action : 'AUTOSAVE',
3994 on_id : (id > 0) ? id : 0,
3995 on_table : 'cms_page',
3996 remarks : 'EXTENDED',
3997 source: _self.getValue()
3999 success : function() {
4000 _self.originalValue = _self.getValue();
4003 failure : function()
4005 //Roo.MessageBox.alert("Error", "autosave failed");
4006 Roo.log('tr extended autosave failed?!');
4010 savedpreview : function (_self)
4012 var id = _this.trform.findField('id').getValue() * 1;
4014 var successFn = function(res){
4015 return res.data.POST.source;
4019 action : 'AUTOSAVE',
4020 remarks : 'EXTENDED',
4021 on_id : (id < 1) ? 0 : id,
4022 on_table : 'cms_page',
4023 successFn : successFn
4027 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4028 _self.setValue(res);
4029 _self.originalValue = res;
4032 stylesheetsclick : function (_self)
4034 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4035 _this.dialog.setStylesheets();
4041 '|xns' : 'Roo.form',
4044 xtype : 'ToolbarStandard',
4045 xns : Roo.form.HtmlEditor,
4046 '|xns' : 'Roo.form.HtmlEditor',
4049 xtype : 'Separator',
4051 '|xns' : 'Roo.Toolbar'
4055 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4057 click : function (_self, e)
4059 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4063 '|xns' : 'Roo.Toolbar'
4068 xtype : 'ToolbarContext',
4069 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4070 xns : Roo.form.HtmlEditor,
4071 '|xns' : 'Roo.form.HtmlEditor'
4082 xtype : 'ContentPanel',
4084 fitContainer : true,
4087 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4096 url : baseURL + '/Roo/cms_page.php',
4098 rendered : function (form)
4100 _this.trform3 = form;
4104 '|xns' : 'Roo.form',
4109 '|xns' : 'Roo.form',
4113 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4122 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4124 name : 'descriptions',