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();
222 _this.dialog.getLayout().getRegion('east').collapse();
223 _this.dialog.getLayout().getRegion('west').collapse();
226 var ew = Math.max(250, w-150); // was 350?/ why?
227 //var eh = Math.max(250, h-350) ;
230 var bd = _this.form1.findField('body');
235 // since render delays resize..
236 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
237 //_this.bodycol.el.setWidth(bd.width+20);
239 var bd = _this.form2.findField('extended');
243 // since render delays resize..
244 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
245 // _this.extendcol.el.setWidth(bd.width+20);
247 var bd = _this.form3.findField('extra_css');
250 //_this.keywordscol.el.setWidth(ew+20);
253 // fix messed up scroll.
254 _this.dialog.layout.el.dom.scrollTop = 0;
262 xtype : 'LayoutRegion',
268 xtype : 'LayoutRegion',
270 collapsedTitle : 'Images / Attachments',
274 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
277 expanded : function (_self)
279 var id = _this.form.findField('id').getValue() * 1;
282 Roo.MessageBox.alert('Error', 'Save first');
287 var w = Roo.lib.Dom.getViewWidth();
288 var h = Roo.lib.Dom.getViewHeight();
290 _self.resizeTo.defer(110, _self,[ w-400, h] );
291 _this.dialog.getLayout().getRegion('west').collapse();
298 xtype : 'LayoutRegion',
300 collapsedTitle : 'Translations',
304 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
307 beforecollapse : function (_self)
309 if(!_this.trform || !_this.trform1 || !_this.trform2){
314 !_this.trform.isDirty() &&
315 !_this.trform1.isDirty() &&
316 !_this.trform2.isDirty() &&
317 !_this.trform3.isDirty()
322 Roo.MessageBox.confirm(
324 "Do you want to save the translation",
327 _self.collapse(true, true);
337 collapsed : function (_self)
339 if(_this.trform && _this.trform.isDirty()){
340 _this.trform.reset();
341 Roo.log('reset trform');
344 if(_this.trform1 && _this.trform1.isDirty()){
345 _this.trform1.reset();
346 Roo.log('reset trform1');
349 if(_this.trform2 && _this.trform2.isDirty()){
350 _this.trform2.reset();
351 Roo.log('reset trform2');
354 if(_this.trform3 && _this.trform3.isDirty()){
355 _this.trform3.reset();
356 Roo.log('reset trform3');
360 expanded : function (_self)
362 var id = _this.form.findField('id').getValue() * 1;
365 Roo.MessageBox.alert('Error', 'Save first');
370 var w = Roo.lib.Dom.getViewWidth();
371 var h = Roo.lib.Dom.getViewHeight();
373 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
375 _this.panel.region.collapse();
385 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
389 var page_link = _this.form.findField('page_link').getValue();
391 if(!page_link.length){
392 Roo.MessageBox.alert('Error', 'Please fill in the page link');
396 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
397 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
401 var url = uiConfig.cms_page_preview_base + page_link;
411 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
416 _this.trform.isDirty() ||
417 _this.trform1.isDirty() ||
418 _this.trform2.isDirty() ||
419 _this.trform3.isDirty()
421 Roo.MessageBox.confirm(
423 "Do you want to save the translation",
447 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
452 if(!_this.form1.findField('body').editorcore.sourceEditMode){
453 _this.form1.findField('body').syncValue();
454 _this.form2.findField('extended').syncValue();
455 Roo.log('syncValue');
457 _this.form1.findField('body').pushValue();
458 _this.form2.findField('extended').pushValue();
459 Roo.log('pushValue');
462 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
463 _this.interests.reset();
467 _this.trform.isDirty() ||
468 _this.trform1.isDirty() ||
469 _this.trform2.isDirty() ||
470 _this.trform3.isDirty()
472 Roo.MessageBox.confirm(
474 "Do you want to save the translation",
477 _this.dialog.el.mask("Saving");
478 _this.form.doAction("submit");
488 _this.dialog.el.mask("Saving");
489 _this.form.doAction("submit");
498 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
504 if(!_this.form1.findField('body').editorcore.sourceEditMode){
505 _this.form1.findField('body').syncValue();
506 _this.form2.findField('extended').syncValue();
508 _this.form1.findField('body').pushValue();
509 _this.form2.findField('extended').pushValue();
512 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
513 _this.interests.reset();
518 _this.trform.isDirty() ||
519 _this.trform1.isDirty() ||
520 _this.trform2.isDirty() ||
521 _this.trform3.isDirty()
523 Roo.MessageBox.confirm(
525 "Do you want to save the translation",
528 _this.dialog.el.mask("Saving");
529 _this.form.doAction("submit");
539 _this.dialog.el.mask("Saving");
540 _this.form.doAction("submit");
550 xtype : 'NestedLayoutPanel',
556 render : function (_self)
558 _this.centerLayoutPanel = this;
565 xtype : 'BorderLayout',
569 xtype : 'LayoutRegion',
575 xtype : 'LayoutRegion',
584 xtype : 'ContentPanel',
589 render : function (_self)
591 _this.cpanel = _self;
593 resize : function (_self, width, height)
595 Roo.log("RESIZE, " + width + ',' + height);
597 var ew = Math.max(250, width - 10);
598 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
605 bd = _this.form1.findField('body');
609 // since render delays resize..
610 Roo.log('resizing body to ' + bd.width);
611 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
612 // _this.bodycol.el.setWidth(bd.width+20);
617 bd = _this.form2.findField('extended');
623 Roo.log('resizing extended to ' + bd.width);
624 // since render delays resize..
625 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
626 // _this.extendcol.el.setWidth(bd.width+20);
631 bd = _this.form3.findField('extra_css');
635 // _this.keywordscol.el.setWidth(ew+20);
637 // fix for messed up rendering of dialog?
641 _this.dialog.layout.el.dom.scrollTop = 0;
643 // noop... - the above sometimes fails...
656 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
658 click : function (_self, e)
660 if (_this.dialog.getLayout().getRegion('west').collapsed) {
661 _this.dialog.getLayout().getRegion('west').expand();
663 _this.dialog.getLayout().getRegion('west').collapse();
669 '|xns' : 'Roo.Toolbar'
674 '|xns' : 'Roo.Toolbar'
678 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
680 click : function (_self, e)
682 if (_this.panel.region.collapsed) {
683 _this.panel.region.expand();
685 _this.panel.region.collapse();
691 '|xns' : 'Roo.Toolbar'
700 _this.form.setValues(_this.data);
704 _this.dialog.el.unmask();
705 _this.grid.getDataSource().load();
707 _this.trform.reset();
708 _this.trform1.reset();
709 _this.trform2.reset();
711 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
712 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
715 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
716 catlabel.dom.innerHTML = 'Category';
718 if(_this.data.page_type_id_name == 'category'){
719 catlabel.dom.innerHTML = 'Parent Category';
723 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
724 catlabel.dom.innerHTML = 'Parent page';
725 if(_this.data.page_type_id_name == 'category'){
726 catlabel.dom.innerHTML = 'Parent';
729 // better if this was not here... - not sure which project uses it?
731 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
732 _this.interestsCol.show();
735 if(typeof(d['interests']) != 'undefined'){
736 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
739 if(typeof(d['categories']) != 'undefined'){
740 _this.form.findField('category').setValue(Roo.decode(d['categories']));
743 if(typeof(d['page_classes']) != 'undefined'){
744 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
747 _this.trpanel.el.unmask();
748 _this.panel.el.unmask();
751 _this.cpanel.el.dom.scrollTop = 0;
753 // fix messed up scroll.
754 _this.dialog.layout.el.dom.scrollTop = 0;
757 labelAlign : 'right',
760 showHide : function()
767 var page_type_name = _this.form.findField('page_type_id_name').getValue();
769 switch(page_type_name){
792 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
793 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
794 var has_extended = _this.form.findField('has_extended').getValue() * 1;
797 is_attachment : !in_rss,
799 category_type_id : in_rss && !is_menu,
800 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
801 target_url : is_menu,
803 category : !is_category,
805 parent_id : !in_rss || is_category ,
808 to_replace_id :false, // !in_rss, // is this used.
809 is_draft : !is_system_page,
810 author_id : in_rss && !is_menu && !is_attachment,
812 template_id : !is_attachment && !is_menu && !is_system_page,
813 element_id : is_element && !is_menu,
814 menu_page_id : is_menu,
815 page_cls : is_element
817 // has_extended : !is_menu && !is_attachment, // always shown.
818 // extended : has_extended && !is_menu && !is_attachment,
819 // body : !is_attachment && !is_menu,
820 //keywords : !is_attachment && !is_menu,
821 // descriptions : !is_attachment && !is_menu
822 // extra_css : !is_attachment && !is_menu
826 var el = _this.form.findField(k);
829 Roo.log("missing field " + k);
833 el.actionMode = 'fieldEl';
843 _this.centerLayoutPanel.getLayout().getRegion('south').show();
844 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
845 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
846 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
847 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
849 if(is_attachment || is_menu){
851 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
855 if(!has_extended && !is_attachment && !is_menu){
856 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
857 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
861 _this.trform.showHide();
863 if(typeof(_this.form.editors) == 'undefined'){
864 _this.form.editors = {
865 body : _this.form1.findField('body').wrap.isVisible(),
866 extended : _this.form2.findField('extended').wrap.isVisible()
869 if(_this.form.editors.body){
870 setInterval(_this.form1.findField('body').autosave, 60000);
873 if(_this.form.editors.extended){
874 setInterval(_this.form2.findField('extended').autosave, 60000);
878 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
879 setInterval(_this.form1.findField('body').autosave, 60000);
880 _this.form.editors.body = true;
883 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
884 setInterval(_this.form2.findField('extended').autosave, 60000);
885 _this.form.editors.extended = true;
891 style : 'margin: 5px',
892 url : baseURL + '/Roo/cms_page.php',
894 actioncomplete : function (_self, action)
897 if (action.type == 'setdata') {
899 _this.form.addForm(_this.form1);
900 _this.form.addForm(_this.form2);
901 _this.form.addForm(_this.form3);
902 _this.form.addForm(_this.form4);
904 _this.dialog.setStylesheets();
906 _this.dialog.getLayout().getRegion('west').collapse();
907 _this.panel.region.collapse();
909 _this.trpanel.el.mask('Save first');
910 _this.panel.el.mask('Save first');
912 _this.loaded = false;
913 _this.interestsCol.hide();
915 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
917 if ( _this.data.id) {
918 _this.dialog.el.mask("Loading");
919 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
923 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
924 this.findField('is_draft').setValue(is_draft);
925 _this.page_type.setValue(_this.data.page_type_id);
926 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
928 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
929 _this.interestsCol.show();
932 _this.form.showHide();
935 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
936 catlabel.dom.innerHTML = 'Category';
937 if(_this.data.page_type_id_name == 'category'){
938 catlabel.dom.innerHTML = 'Parent Category';
943 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
944 catlabel.dom.innerHTML = 'Parent page';
945 if(_this.data.page_type_id_name == 'category'){
946 catlabel.dom.innerHTML = 'Parent';
952 if(_this.data._is_copy){
953 _this.form.is_copy();
959 if (action.type == 'load') {
961 //_this.data = action.result.data;
963 var d = action.result.data;
965 _this.dialog.el.unmask();
966 _this.grid.getDataSource().load();
968 _this.trform.reset();
969 _this.trform1.reset();
970 _this.trform2.reset();
971 _this.trform3.reset();
973 _this.trform.addForm(_this.trform1);
974 _this.trform.addForm(_this.trform2);
976 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
977 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
978 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
979 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
980 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
983 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
984 catlabel.dom.innerHTML = 'Category';
986 if(_this.data.page_type_id_name == 'category'){
987 catlabel.dom.innerHTML = 'Parent Category';
991 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
992 catlabel.dom.innerHTML = 'Parent page';
993 if(_this.data.page_type_id_name == 'category'){
994 catlabel.dom.innerHTML = 'Parent';
997 // better if this was not here... - not sure which project uses it?
999 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
1000 _this.interestsCol.show();
1003 if(typeof(d['interests']) != 'undefined'){
1004 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1007 if(typeof(d['categories']) != 'undefined'){
1008 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1011 if(typeof(d['page_classes']) != 'undefined'){
1012 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1015 _this.trpanel.el.unmask();
1016 _this.panel.el.unmask();
1019 _this.cpanel.el.dom.scrollTop = 0;
1021 // fix messed up scroll.
1022 _this.dialog.layout.el.dom.scrollTop = 0;
1026 if (action.type =='submit') {
1028 _this.dialog.el.unmask();
1030 _this.dialog.getLayout().getRegion('west').collapse();
1033 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1037 _this.dialog.hide();
1040 if (_this.callback) {
1041 _this.callback.call(_this, action.result.data);
1047 actionfailed : function (_self, action)
1049 _this.dialog.el.unmask();
1050 Pman.standardActionFailed(_self, action);
1052 rendered : function (_self)
1058 '|xns' : 'Roo.form',
1065 '|xns' : 'Roo.form',
1070 labelAlign : 'right',
1072 style : 'height:30px;overflow:hidden',
1075 '|xns' : 'Roo.form',
1079 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1088 style : 'height:30px;overflow:hidden',
1091 '|xns' : 'Roo.form',
1096 displayField : 'display_name',
1098 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1099 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1100 forceSelection : true,
1101 hiddenName : 'page_type_id',
1103 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1105 name : 'page_type_id_display_name',
1107 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1108 selectOnFocus : true,
1109 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1110 triggerAction : 'all',
1114 render : function (_self)
1116 _this.page_type = _self;
1118 select : function (combo, record, index)
1120 // _this.grid.footer.onClick('first');
1121 var page_type_name = record.data.name;
1122 _this.form.findField('page_type_id_name').setValue(page_type_name);
1123 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1124 _this.form.findField('is_attachment').setValue(0);
1128 _this.form.showHide.defer(100, _this.form);
1134 '|xns' : 'Roo.form',
1138 sortInfo : { direction : 'ASC', field: 'seqid' },
1140 beforeload : function (_self, o){
1141 o.params = o.params || {};
1143 o.params.etype = 'cms_page_type';
1147 '|xns' : 'Roo.data',
1149 xtype : 'HttpProxy',
1151 url : baseURL + '/Roo/core_enum.php',
1156 xtype : 'JsonReader',
1157 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1160 totalProperty : 'total',
1169 style : 'padding-left: -70px;',
1172 '|xns' : 'Roo.form',
1175 xtype : 'NumberField',
1176 decimalPrecision : 0,
1177 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1192 labelAlign : 'right',
1194 style : 'height:30px;overflow:hidden',
1197 '|xns' : 'Roo.form',
1201 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1210 style : 'height:30px;overflow:hidden',
1213 '|xns' : 'Roo.form',
1217 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1218 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1226 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1228 name : 'has_extended',
1231 check : function (_self, checked)
1236 _this.form.showHide();
1237 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1248 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1250 name : 'is_attachment',
1253 check : function (_self, checked)
1257 _this.form.showHide.defer(100, _this.form);
1271 displayField : 'name',
1273 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1274 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1275 forceSelection : true,
1276 hiddenName : 'author_id',
1278 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1280 name : 'author_id_name',
1282 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1283 queryParam : 'query[name]',
1284 selectOnFocus : true,
1285 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1286 triggerAction : 'all',
1291 '|xns' : 'Roo.form',
1295 sortInfo : { direction : 'ASC', field: 'name' },
1297 beforeload : function (_self, o){
1298 o.params = o.params || {};
1300 o.params.active = 1;
1301 o.params['query[is_owner]'] = 1;
1305 '|xns' : 'Roo.data',
1307 xtype : 'HttpProxy',
1309 url : baseURL + '/Roo/core_person',
1314 xtype : 'JsonReader',
1315 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1318 totalProperty : 'total',
1325 xtype : 'ComboBoxArray',
1326 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1327 hiddenName : 'category',
1328 name : 'category_name',
1331 '|xns' : 'Roo.form',
1336 displayField : 'display_fullpath',
1338 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1339 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1340 forceSelection : true,
1344 queryParam : 'search[name]',
1345 selectOnFocus : true,
1346 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1347 triggerAction : 'all',
1351 '|xns' : 'Roo.form',
1355 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1357 beforeload : function (_self, o){
1358 o.params = o.params || {};
1360 o.params.page_type_id_name= 'CATEGORY';
1362 o.params._with_fullpath = 1;
1366 '|xns' : 'Roo.data',
1368 xtype : 'HttpProxy',
1370 url : baseURL + '/Roo/cms_page.php',
1375 xtype : 'JsonReader',
1377 {"name":"id","type":"int"},
1378 {"name":"name","type":"string"},
1379 {"name":"display_name","type":"string"}
1383 totalProperty : 'total',
1394 displayField : 'page_link',
1396 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1397 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1398 forceSelection : true,
1399 hiddenName : 'parent_id',
1401 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1403 name : 'parent_id_title',
1405 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1406 selectOnFocus : true,
1407 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1408 triggerAction : 'all',
1413 select : function (combo, record, index)
1415 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1416 if (page_type_name == 'page') { // page
1419 // do not default to put 'Home' at the beginning.
1420 if (!record || !(record.data.parent_id *1)) {
1423 var pl = _this.form.findField('page_link');
1424 var lk = pl.getValue();
1425 var new_link = record.data.page_link + '/';
1427 new_link += lk.split('/').pop();
1429 pl.setValue(new_link);
1434 '|xns' : 'Roo.form',
1438 sortInfo : { field: 'page_link', direction: 'ASC' },
1440 beforeload : function (_self, options)
1442 options.params['search[page_link_no_empty]'] =1;
1444 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1445 options.params._page_type = 'page,element';
1447 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1450 var id = _this.form.findField('id').getValue() * 1;
1453 options.params['!id'] = id;
1458 options.params.is_element = 0;
1459 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1460 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1465 '|xns' : 'Roo.data',
1467 xtype : 'HttpProxy',
1469 url : baseURL + '/Roo/cms_page.php',
1474 xtype : 'JsonReader',
1476 { name: 'id', type: 'int' },
1482 totalProperty : 'total',
1492 '|xns' : 'Roo.form',
1495 xtype : 'DateField',
1496 altFormats : 'Y-m-d H:i:s',
1497 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1505 xtype : 'TextField',
1506 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1507 name : 'to_replace_id',
1515 xtype : 'TextField',
1516 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1520 keyup : function (_self, e)
1522 if (_this.page_type.getRawValue() == 'Category') {
1524 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1533 xtype : 'TextField',
1534 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1541 xtype : 'TextField',
1542 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1543 name : 'target_url',
1552 displayField : 'template_clean',
1554 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1555 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1556 forceSelection : true,
1557 hiddenName : 'template_id',
1559 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1561 name : 'template_id_template_clean',
1563 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1564 selectOnFocus : true,
1565 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1566 triggerAction : 'all',
1571 '|xns' : 'Roo.form',
1575 sortInfo : { field: 'template', direction: 'ASC' },
1577 beforeload : function (_self, options)
1580 options.params._rescan = 1;
1581 options.params._clean_name = 1;
1582 // options.params.lang = 'en';
1583 options.params['!template[0]'] = 'master.html';
1584 //options.params['!template[1]'] = 'index.html';
1588 '|xns' : 'Roo.data',
1590 xtype : 'HttpProxy',
1592 url : baseURL + '/Roo/Cms_template',
1597 xtype : 'JsonReader',
1599 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1603 totalProperty : 'total',
1613 displayField : 'name',
1615 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1616 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1617 forceSelection : true,
1618 hiddenName : 'element_id',
1620 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1622 name : 'element_id_name',
1624 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1625 selectOnFocus : true,
1626 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1627 triggerAction : 'all',
1632 '|xns' : 'Roo.form',
1636 sortInfo : { field: 'name', direction: 'ASC' },
1638 beforeload : function (_self, options)
1640 var par = _this.form.findField('parent_id').getValue() * 1;
1642 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1646 options.params._cms_page_id = par;
1650 '|xns' : 'Roo.data',
1652 xtype : 'HttpProxy',
1654 url : baseURL + '/Roo/Cms_template_element',
1659 xtype : 'JsonReader',
1661 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1665 totalProperty : 'total',
1675 displayField : 'page_link',
1677 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1678 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1679 forceSelection : true,
1680 hiddenName : 'menu_page_id',
1682 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1684 name : 'menu_page_id_page_link',
1686 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1687 selectOnFocus : true,
1688 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>',
1689 triggerAction : 'all',
1694 '|xns' : 'Roo.form',
1698 sortInfo : { field: 'title', direction: 'ASC' },
1700 beforeload : function (_self, options)
1702 options.params = options.params || {};
1704 options.params['search[page_link_no_empty]'] =1;
1706 options.params['page_type_id_name[0]'] = 'page';
1707 options.params['page_type_id_name[1]'] = 'blog';
1709 options.params.is_element = 0;
1710 options.params.is_menuitem = 0;
1715 '|xns' : 'Roo.data',
1717 xtype : 'HttpProxy',
1719 url : baseURL + '/Roo/cms_page.php',
1724 xtype : 'JsonReader',
1739 "name":"page_type_id_display_name",
1745 totalProperty : 'total',
1752 xtype : 'ComboBoxArray',
1753 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1754 hiddenName : 'page_cls',
1755 name : 'page_cls_name',
1758 '|xns' : 'Roo.form',
1763 displayField : 'display_name',
1765 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1766 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1767 forceSelection : true,
1770 queryParam : 'query[search]',
1771 selectOnFocus : true,
1772 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1773 triggerAction : 'all',
1774 valueField : 'name',
1777 '|xns' : 'Roo.form',
1781 sortInfo : { direction : 'ASC', field: 'seqid' },
1783 beforeload : function (_self, o){
1784 o.params = o.params || {};
1786 o.params.etype = 'cms_page_class';
1790 '|xns' : 'Roo.data',
1792 xtype : 'HttpProxy',
1794 url : baseURL + '/Roo/core_enum.php',
1799 xtype : 'JsonReader',
1801 {"name":"id","type":"int"},
1802 {"name":"name","type":"string"},
1803 {"name":"display_name","type":"string"}
1807 totalProperty : 'total',
1821 '|xns' : 'Roo.form',
1827 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1828 style : 'width: 165px;',
1830 '|xns' : 'Roo.form',
1833 xtype : 'DisplayField',
1835 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1836 name : 'primary_image_id',
1837 style : 'border: 1px solid #ccc;',
1838 valueRenderer : function(v) {
1840 if (!v || v * 1 < 1) {
1841 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1844 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1857 render : function (_self)
1859 _this.interestsCol = _self;
1863 '|xns' : 'Roo.form',
1866 xtype : 'ComboBoxArray',
1867 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1868 hiddenName : 'interest',
1869 name : 'interest_name',
1872 render : function (_self)
1874 _this.interests = _self;
1876 _self.combo.addicon.setStyle( {
1877 position : 'absolute',
1886 '|xns' : 'Roo.form',
1891 displayField : 'display_name',
1893 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1894 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1895 forceSelection : true,
1898 queryParam : 'query[name]',
1899 selectOnFocus : true,
1900 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1901 triggerAction : 'all',
1905 '|xns' : 'Roo.form',
1909 sortInfo : { direction : 'ASC', field: 'name' },
1911 beforeload : function (_self, o){
1912 o.params = o.params || {};
1913 o.params.etype = 'crm_interest';
1917 '|xns' : 'Roo.data',
1919 xtype : 'HttpProxy',
1921 url : baseURL + '/Roo/Core_enum.php',
1926 xtype : 'JsonReader',
1928 {"name":"id","type":"int"},
1929 {"name":"name","type":"string"},
1930 {"name":"display_name","type":"string"}
1934 totalProperty : 'total',
1951 name : 'is_system_page',
1957 name : 'is_menuitem',
1963 name : 'page_type_id_name',
1970 render : function (_self)
1972 _this.user_defined_fields = _self;
1983 xtype : 'ContentPanel',
1985 fitContainer : true,
1988 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1997 url : baseURL + '/Roo/cms_page.php',
1999 rendered : function (form)
2005 '|xns' : 'Roo.form',
2011 '|xns' : 'Roo.form',
2014 xtype : 'HtmlEditor',
2015 autosave : function() {
2017 var body = _this.form1.findField('body');
2019 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2020 Roo.log('body not dirty');
2024 Roo.log('body dirty, auto save!');
2026 body.fireEvent('autosave', body);
2030 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2034 white : [ 'iframe' ],
2037 autosave : function (_self)
2039 Roo.log('autosave');
2041 var id = _this.form.findField('id').getValue() * 1;
2043 if(!_self.editorcore.sourceEditMode){
2050 url : baseURL + '/Roo/Events.php',
2054 action : 'AUTOSAVE',
2055 on_id : (id > 0) ? id : 0,
2056 on_table : 'cms_page',
2058 source: _self.getValue()
2060 success : function() {
2061 _self.originalValue = _self.getValue();
2064 failure : function()
2066 //Roo.MessageBox.alert("Error", "autosave failed");
2067 Roo.log('body autosave failed?!');
2072 savedpreview : function (_self)
2074 Roo.log('saved preview');
2076 var id = _this.form.findField('id').getValue() * 1;
2078 var successFn = function(res){
2079 return res.data.POST.source;
2083 action : 'AUTOSAVE',
2085 on_id : (id < 1) ? 0 : id,
2086 on_table : 'cms_page',
2087 successFn : successFn
2091 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2092 _self.setValue(res);
2093 _self.originalValue = res;
2096 stylesheetsclick : function (_self)
2098 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2099 _this.dialog.setStylesheets();
2105 '|xns' : 'Roo.form',
2108 xtype : 'ToolbarStandard',
2109 xns : Roo.form.HtmlEditor,
2110 '|xns' : 'Roo.form.HtmlEditor',
2115 displayField : 'name',
2117 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2118 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2119 forceSelection : true,
2121 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2124 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2125 queryParam : 'search',
2126 selectOnFocus : true,
2127 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>',
2128 triggerAction : 'all',
2133 beforequery : function (combo, query, forceAll, cancel, e)
2136 var id = _this.form.findField('id').getValue() * 1;
2138 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2142 render : function (_self)
2144 _this.bodyimgselect = _self;
2146 select : function (combo, record, index)
2153 var editor = _this.form.findField('body').editorcore;
2155 var curnode = editor.getSelectedNode();
2157 if (curnode && curnode.tagName == 'IMG') {
2158 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2159 baseURL, record.data.id, record.data.filename
2161 // note -forces an update... hopefully...
2162 editor.owner.fireEvent('editorevent', editor, false);
2165 editor.insertAtCursor(
2166 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2167 baseURL, record.data.id, record.data.filename
2176 '|xns' : 'Roo.form',
2180 sortInfo : { direction : 'ASC', field: 'id' },
2182 beforeload : function (_self, o){
2183 o.params = o.params || {};
2185 var id = _this.form.findField('id').getValue() * 1;
2187 Roo.MessageBox.alert("Error", "Save press release first");
2191 o.params.ontable = 'cms_page';
2192 // o.params.imgtype = 'PressRelease';
2193 //o.params['query[imagesize]'] = '150x150';
2198 '|xns' : 'Roo.data',
2200 xtype : 'HttpProxy',
2202 url : baseURL + '/Roo/Images.php',
2207 xtype : 'JsonReader',
2208 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2211 totalProperty : 'total',
2220 displayField : 'page_link',
2222 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2223 forceSelection : true,
2224 hiddenName : 'add_link_id',
2226 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2230 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2231 selectOnFocus : true,
2232 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2233 triggerAction : 'all',
2238 select : function (combo, record, index)
2244 var editor = _this.form.findField('body');
2245 editor.editorcore.insertAtCursor(
2246 String.format('<a href="#page-{0}">{1}</a>',
2247 record.data.page_link, record.data.title
2255 '|xns' : 'Roo.form',
2259 sortInfo : { field: 'page_link', direction: 'ASC' },
2261 beforeload : function (_self, options)
2263 options.params['search[page_link_no_empty]'] =1;
2265 options.params.is_element = 0;
2266 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2271 '|xns' : 'Roo.data',
2273 xtype : 'HttpProxy',
2275 url : baseURL + '/Roo/cms_page.php',
2280 xtype : 'JsonReader',
2282 { name: 'id', type: 'int' },
2288 totalProperty : 'total',
2295 xtype : 'Separator',
2297 '|xns' : 'Roo.Toolbar'
2301 cls : 'x-init-enable',
2302 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2304 click : function (_self, e)
2306 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2310 '|xns' : 'Roo.Toolbar'
2315 xtype : 'ToolbarContext',
2316 xns : Roo.form.HtmlEditor,
2317 '|xns' : 'Roo.form.HtmlEditor'
2328 xtype : 'ContentPanel',
2330 fitContainer : true,
2333 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2342 url : baseURL + '/Roo/cms_page.php',
2344 rendered : function (form)
2350 '|xns' : 'Roo.form',
2356 '|xns' : 'Roo.form',
2359 xtype : 'HtmlEditor',
2360 autosave : function() {
2362 var extended = _this.form2.findField('extended');
2364 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2365 Roo.log('extend not dirty');
2370 Roo.log('extend dirty, auto save!');
2372 extended.fireEvent('autosave', extended);
2374 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2378 white : [ 'iframe' ],
2381 autosave : function (_self)
2383 var id = _this.form.findField('id').getValue() * 1;
2386 if(!_self.editorcore.sourceEditMode){
2393 url : baseURL + '/Roo/Events.php',
2397 action : 'AUTOSAVE',
2398 on_id : (id > 0) ? id : 0,
2399 on_table : 'cms_page',
2400 remarks : 'EXTENDED',
2401 source: _self.getValue()
2403 success : function() {
2404 _self.originalValue = _self.getValue();
2407 failure : function()
2409 //Roo.MessageBox.alert("Error", "autosave failed");
2410 Roo.log('extended autosave failed?!');
2414 savedpreview : function (_self)
2416 var id = _this.form.findField('id').getValue() * 1;
2418 var successFn = function(res){
2419 return res.data.POST.source;
2423 action : 'AUTOSAVE',
2424 remarks : 'EXTENDED',
2425 on_id : (id < 1) ? 0 : id,
2426 on_table : 'cms_page',
2427 successFn : successFn
2431 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2432 _self.setValue(res);
2433 _self.originalValue = res;
2436 stylesheetsclick : function (_self)
2438 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2439 _this.dialog.setStylesheets();
2445 '|xns' : 'Roo.form',
2448 xtype : 'ToolbarStandard',
2449 xns : Roo.form.HtmlEditor,
2450 '|xns' : 'Roo.form.HtmlEditor',
2455 displayField : 'name',
2457 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2458 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2459 forceSelection : true,
2461 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2464 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2465 selectOnFocus : true,
2466 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2467 triggerAction : 'all',
2472 beforequery : function (combo, query, forceAll, cancel, e)
2475 var id = _this.form.findField('id').getValue() * 1;
2477 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2481 render : function (_self)
2483 _this.extendimgselect = _self;
2485 select : function (combo, record, index)
2492 var editor = _this.form.findField('extended').editorcore;
2494 var curnode = editor.getSelectedNode();
2496 if (curnode && curnode.tagName == 'IMG') {
2497 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2498 baseURL, record.data.id, record.data.filename
2500 // note -forces an update... hopefully...
2501 editor.owner.fireEvent('editorevent', editor, false);
2504 editor.insertAtCursor(
2505 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2506 baseURL, record.data.id, record.data.filename
2515 '|xns' : 'Roo.form',
2519 sortInfo : { direction : 'ASC', field: 'id' },
2521 beforeload : function (_self, o){
2522 o.params = o.params || {};
2524 var id = _this.form.findField('id').getValue() * 1;
2526 Roo.MessageBox.alert("Error", "Save press release first");
2530 o.params.ontable = 'cms_page';
2531 // o.params.imgtype = 'PressRelease';
2532 //o.params['query[imagesize]'] = '150x150';
2537 '|xns' : 'Roo.data',
2539 xtype : 'HttpProxy',
2541 url : baseURL + '/Roo/Images.php',
2546 xtype : 'JsonReader',
2547 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2550 totalProperty : 'total',
2559 displayField : 'page_link',
2561 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2562 forceSelection : true,
2563 hiddenName : 'add_link_id',
2565 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2569 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2570 selectOnFocus : true,
2571 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2572 triggerAction : 'all',
2577 select : function (combo, record, index)
2583 var editor = _this.form.findField('body');
2584 editor.editorcore.insertAtCursor(
2585 String.format('<a href="#page-{0}">{1}</a>',
2586 record.data.page_link, record.data.title
2594 '|xns' : 'Roo.form',
2598 sortInfo : { field: 'page_link', direction: 'ASC' },
2600 beforeload : function (_self, options)
2602 options.params['search[page_link_no_empty]'] =1;
2604 options.params.is_element = 0;
2605 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2610 '|xns' : 'Roo.data',
2612 xtype : 'HttpProxy',
2614 url : baseURL + '/Roo/cms_page.php',
2619 xtype : 'JsonReader',
2621 { name: 'id', type: 'int' },
2627 totalProperty : 'total',
2634 xtype : 'Separator',
2636 '|xns' : 'Roo.Toolbar'
2640 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2642 click : function (_self, e)
2644 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2648 '|xns' : 'Roo.Toolbar'
2653 xtype : 'ToolbarContext',
2654 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2655 xns : Roo.form.HtmlEditor,
2656 '|xns' : 'Roo.form.HtmlEditor'
2667 xtype : 'ContentPanel',
2669 fitContainer : true,
2672 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2681 url : baseURL + '/Roo/cms_page.php',
2683 rendered : function (form)
2689 '|xns' : 'Roo.form',
2695 '|xns' : 'Roo.form',
2699 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2713 xtype : 'ContentPanel',
2715 fitContainer : true,
2718 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2727 url : baseURL + '/Roo/cms_page.php',
2729 rendered : function (form)
2735 '|xns' : 'Roo.form',
2740 '|xns' : 'Roo.form',
2744 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2753 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2755 name : 'descriptions',
2770 xtype : 'GridPanel',
2772 fitContainer : true,
2775 tableName : 'Images',
2776 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2778 activate : function() {
2781 _this.grid.footer.onClick('first');
2788 xtype : 'EditorGrid',
2789 autoExpandColumn : 'title',
2793 render : function() {
2795 //_this.dialog = Pman.Dialog.FILL_IN
2796 if (_this.panel.active) {
2797 //this.footer.onClick('first');
2800 rowdblclick : function (_self, rowIndex, e)
2802 var rd = _this.grid.getDataSource().getAt(rowIndex);
2803 var id = rd.data.id;
2804 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2805 _this.form.findField('contents').execCmd('insertimage', url);
2810 '|xns' : 'Roo.grid',
2818 cls : 'x-btn-text-icon',
2819 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2820 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2824 var id = _this.form.findField('id').getValue() * 1;
2830 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2831 _this.grid.ds.load({});
2841 cls : 'x-btn-text-icon',
2842 icon : rootURL + '/Pman/templates/images/trash.gif',
2843 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2847 var selection = _this.grid.getSelectionModel().getSelectedCell();
2848 var sn = _this.grid.ds.getAt(selection[0]);
2849 if (!sn || isNaN(sn.id *1)) {
2850 Roo.MessageBox.alert("Error", "Select a image");
2853 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2859 url : baseURL + '/Roo/Images.php',
2864 success : function()
2866 Roo.log('Got Success!!');
2867 _this.grid.ds.load({});
2881 beforeload : function (_self, o)
2883 var id = _this.form.findField('id').getValue() * 1;
2889 o.params = o.params || {};
2890 o.params.limit = 9999;
2892 o.params.ontable = 'cms_page';
2894 update : function (_self, rec, operation)
2898 url : baseURL+'/Roo/Images.php',
2901 success: function(res)
2903 Roo.log("GOT success");
2904 // update the data...
2905 _this.grid.ds.load({});
2907 failure : function(res)
2909 Roo.MessageBox.alert('Error', res.errorMsg);
2910 _this.grid.ds.load({});
2918 '|xns' : 'Roo.data',
2920 xtype : 'HttpProxy',
2922 url : baseURL + '/Roo/Images.php',
2927 xtype : 'JsonReader',
2962 'name': 'displayorder',
2970 'name': 'parent_image_id',
2976 'dateFormat': 'Y-m-d'
2995 'name': 'parent_image_id_id',
2999 'name': 'parent_image_id_filename',
3003 'name': 'parent_image_id_ontable',
3007 'name': 'parent_image_id_onid',
3011 'name': 'parent_image_id_mimetype',
3015 'name': 'parent_image_id_width',
3019 'name': 'parent_image_id_height',
3023 'name': 'parent_image_id_filesize',
3027 'name': 'parent_image_id_displayorder',
3031 'name': 'parent_image_id_language',
3035 'name': 'parent_image_id_parent_image_id',
3039 'name': 'parent_image_id_created',
3043 'name': 'parent_image_id_imgtype',
3047 'name': 'parent_image_id_linkurl',
3051 'name': 'parent_image_id_descript',
3055 'name': 'parent_image_id_title',
3061 totalProperty : 'total',
3068 xtype : 'ColumnModel',
3070 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3071 renderer : function(v,x,r) {
3072 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3080 xtype : 'ColumnModel',
3081 dataIndex : 'filename',
3082 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3083 renderer : function(v) { return String.format('{0}', v); },
3089 xtype : 'ColumnModel',
3090 dataIndex : 'displayorder',
3091 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3092 renderer : function(v) { return String.format('{0}', v); },
3095 '|xns' : 'Roo.grid',
3097 xtype : 'GridEditor',
3099 '|xns' : 'Roo.grid',
3101 xtype : 'NumberField',
3102 decimalPrecision : 0,
3104 focus : function (_self)
3106 if (this.value == 0) {
3107 this.el.dom.value = '';
3117 xtype : 'ColumnModel',
3118 dataIndex : 'title',
3119 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3120 renderer : function(v) { return String.format('{0}', v); },
3123 '|xns' : 'Roo.grid',
3125 xtype : 'GridEditor',
3127 '|xns' : 'Roo.grid',
3129 xtype : 'TextField',
3136 xtype : 'ColumnModel',
3137 dataIndex : 'linkurl',
3138 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3139 renderer : function(v)
3141 return String.format('{0}', (v) ? v : '');
3145 '|xns' : 'Roo.grid',
3147 xtype : 'GridEditor',
3149 '|xns' : 'Roo.grid',
3151 xtype : 'TextField',
3161 xtype : 'NestedLayoutPanel',
3163 fitContainer : true,
3167 render : function (_self)
3169 _this.westLayoutPanel = this;
3176 xtype : 'BorderLayout',
3180 xtype : 'LayoutRegion',
3181 tabPosition : 'top',
3186 xtype : 'LayoutRegion',
3189 tabPosition : 'top',
3195 xtype : 'ContentPanel',
3200 render : function (_self)
3202 _this.trpanel = _self;
3204 resize : function (_self, width, height)
3206 Roo.log('resize called');
3208 var ew = Math.max(250, width - 10);
3209 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3212 if (!_this.trform) {
3216 var bd = _this.trform1.findField('body');
3221 // since render delays resize..
3222 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3223 // _this.trbodycol.el.setWidth(bd.width+20);
3225 var bd = _this.trform2.findField('extended');
3229 // since render delays resize..
3230 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3231 // _this.trextendcol.el.setWidth(bd.width+20);
3241 labelAlign : 'right',
3244 showHide : function() {
3246 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3247 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3248 var has_lang = _this.trform.findField('language').getValue().length;
3250 _this.westLayoutPanel.getLayout().getRegion('south').show();
3251 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3252 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3253 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3256 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3259 if(!has_extended && has_lang){
3260 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3261 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3269 var el = _this.trform.findField(k);
3270 el.actionMode = 'fieldEl';
3272 Roo.log("show: " + k);
3275 Roo.log("hide: " + k);
3280 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3283 if(typeof(_this.trform.editors) == 'undefined'){
3284 _this.trform.editors = {
3285 body : _this.trform1.findField('body').wrap.isVisible(),
3286 extended : _this.trform2.findField('extended').wrap.isVisible()
3288 if(_this.trform.editors.body){
3289 setInterval(_this.trform1.findField('body').autosave, 60000);
3292 if(_this.trform.editors.extended){
3293 setInterval(_this.trform2.findField('extended').autosave, 60000);
3297 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3298 setInterval(_this.trform1.findField('body').autosave, 60000);
3299 _this.trform.editors.body = true;
3302 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3303 setInterval(_this.trform2.findField('extended').autosave, 60000);
3304 _this.trform.editors.extended = true;
3309 style : 'margin: 5px',
3310 trackResetOnLoad : true,
3311 url : baseURL + '/Roo/cms_page.php',
3313 actioncomplete : function (_self, action)
3315 if (action.type =='submit') {
3319 if (action.type == 'setdata') {
3320 _this.trform.addForm(_this.trform1);
3321 _this.trform.addForm(_this.trform2);
3322 _this.trform.addForm(_this.trform3);
3324 if ( _this.data.id) {
3326 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3328 this.trpanel.el.mask("save first");
3335 if (action.type == 'load') {
3336 // _this.dialog.el.unmask();
3339 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3340 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3341 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3342 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3347 actionfailed : function (_self, action)
3349 _this.dialog.el.unmask();
3351 Pman.standardActionFailed(_self, action);
3353 rendered : function (_self)
3355 _this.trform = _self;
3359 '|xns' : 'Roo.form',
3366 '|xns' : 'Roo.form',
3373 '|xns' : 'Roo.form',
3378 displayField : 'language_name',
3380 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3381 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3382 forceSelection : true,
3383 hiddenName : 'language',
3385 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3387 name : 'language_name',
3389 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3390 selectOnFocus : true,
3391 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3392 triggerAction : 'all',
3394 valueField : 'language',
3396 add : function (combo)
3398 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3401 _this.trform.reset();
3402 _this.trform1.reset();
3403 _this.trform2.reset();
3405 combo.setValue(res.lang);
3406 combo.el.dom.value = res.lang_name;
3409 _this.trform.showHide();
3410 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3415 render : function (_self)
3417 _this.language = _self;
3419 select : function (combo, record, index)
3422 _this.trform.showHide();
3423 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3430 'lookup[language]' : record.data.language,
3431 'lookup[translation_of_id]' : _this.data.id,
3438 '|xns' : 'Roo.form',
3442 sortInfo : { direction : 'ASC', field: 'language' },
3444 beforeload : function (_self, o){
3445 o.params = o.params || {};
3447 o.params._distinct = 'language';
3448 o.params._columns ='language_name,language';
3449 o.params._with_name = true;
3451 if(_this.form.findField('id').getValue()*1 > 0){
3452 o.params.translation_of_id = _this.form.findField('id').getValue();
3458 '|xns' : 'Roo.data',
3460 xtype : 'HttpProxy',
3462 url : baseURL + '/Roo/Cms_page.php',
3467 xtype : 'JsonReader',
3468 fields : [{"name":"language","type":"string"}],
3471 totalProperty : 'total',
3479 style : 'padding-top:12px;padding-left:30px;float:left',
3482 render : function (_self)
3484 _this.updateRow = _self;
3488 '|xns' : 'Roo.form',
3492 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3496 // _this.dialog.el.mask("Saving");
3497 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3498 _this.trform1.findField('body').syncValue();
3499 _this.trform2.findField('extended').syncValue();
3501 _this.trform1.findField('body').pushValue();
3502 _this.trform2.findField('extended').pushValue();
3505 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3506 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3507 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3508 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3509 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3511 if(_this.trform.findField('element_id').getValue()*1 > 0){
3512 _this.trform.findField('is_element').setValue(1);
3515 _this.trform.doAction("submit");
3526 xtype : 'TextField',
3527 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3543 name : 'element_id',
3549 name : 'menu_page_id',
3555 name : 'is_menuitem',
3561 name : 'is_element',
3568 name : 'translation_of_id',
3583 xtype : 'ContentPanel',
3585 fitContainer : true,
3588 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3597 url : baseURL + '/Roo/cms_page.php',
3599 rendered : function (form)
3601 _this.trform1 = form;
3605 '|xns' : 'Roo.form',
3611 '|xns' : 'Roo.form',
3614 xtype : 'HtmlEditor',
3615 autosave : function() {
3617 var body = _this.trform1.findField('body');
3619 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3620 Roo.log('tr body not dirty');
3624 Roo.log('tr body dirty, auto save!');
3626 body.fireEvent('autosave', body);
3628 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3632 white : [ 'iframe' ],
3634 autosave : function (_self)
3636 var id = _this.trform.findField('id').getValue() * 1;
3639 if(!_self.editorcore.sourceEditMode){
3646 url : baseURL + '/Roo/Events.php',
3650 action : 'AUTOSAVE',
3651 on_id : (id > 0) ? id : 0,
3652 on_table : 'cms_page',
3654 source: _self.getValue()
3656 success : function() {
3657 _self.originalValue = _self.getValue();
3660 failure : function()
3662 //Roo.MessageBox.alert("Error", "autosave failed");
3663 Roo.log('tr body autosave failed?!');
3667 savedpreview : function (_self)
3669 var id = _this.trform.findField('id').getValue() * 1;
3671 var successFn = function(res){
3672 return res.data.POST.source;
3676 action : 'AUTOSAVE',
3678 on_id : (id < 1) ? 0 : id,
3679 on_table : 'cms_page',
3680 successFn : successFn
3684 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3685 _self.setValue(res);
3686 _self.originalValue = res;
3689 stylesheetsclick : function (_self)
3691 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3692 _this.dialog.setStylesheets();
3698 '|xns' : 'Roo.form',
3701 xtype : 'ToolbarStandard',
3702 xns : Roo.form.HtmlEditor,
3703 '|xns' : 'Roo.form.HtmlEditor',
3708 displayField : 'name',
3710 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3711 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3712 forceSelection : true,
3714 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3717 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3718 selectOnFocus : true,
3719 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>',
3720 triggerAction : 'all',
3725 beforequery : function (combo, query, forceAll, cancel, e)
3728 var id = _this.form.findField('id').getValue() * 1;
3730 Roo.MessageBox.alert("Error", "Save press release first");
3734 render : function (_self)
3736 _this.trbodyimgselect = _self;
3738 select : function (combo, record, index)
3745 var editor = _this.trform.findField('body').editorcore;
3747 var curnode = editor.getSelectedNode();
3749 if (curnode && curnode.tagName == 'IMG') {
3750 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3751 baseURL, record.data.id, record.data.filename
3753 // note -forces an update... hopefully...
3754 editor.owner.fireEvent('editorevent', editor, false);
3757 editor.insertAtCursor(
3758 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3759 baseURL, record.data.id, record.data.filename
3768 '|xns' : 'Roo.form',
3772 sortInfo : { direction : 'ASC', field: 'id' },
3774 beforeload : function (_self, o){
3775 o.params = o.params || {};
3777 var id = _this.form.findField('id').getValue() * 1;
3779 Roo.MessageBox.alert("Error", "Save press release first");
3783 o.params.ontable = 'cms_page';
3784 // o.params.imgtype = 'PressRelease';
3785 //o.params['query[imagesize]'] = '150x150';
3790 '|xns' : 'Roo.data',
3792 xtype : 'HttpProxy',
3794 url : baseURL + '/Roo/Images.php',
3799 xtype : 'JsonReader',
3800 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3803 totalProperty : 'total',
3812 displayField : 'page_link',
3814 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3815 forceSelection : true,
3816 hiddenName : 'add_link_id',
3818 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3822 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3823 selectOnFocus : true,
3824 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3825 triggerAction : 'all',
3830 select : function (combo, record, index)
3836 var editor = _this.form.findField('body');
3837 editor.insertAtCursor(
3838 String.format('<a href="#page-{0}">{1}</a>',
3839 record.data.page_link, record.data.title
3847 '|xns' : 'Roo.form',
3851 sortInfo : { field: 'page_link', direction: 'ASC' },
3853 beforeload : function (_self, options)
3855 options.params['search[page_link_no_empty]'] =1;
3857 options.params.is_element = 0;
3858 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3863 '|xns' : 'Roo.data',
3865 xtype : 'HttpProxy',
3867 url : baseURL + '/Roo/cms_page.php',
3872 xtype : 'JsonReader',
3874 { name: 'id', type: 'int' },
3880 totalProperty : 'total',
3887 xtype : 'Separator',
3889 '|xns' : 'Roo.Toolbar'
3893 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3895 click : function (_self, e)
3897 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3901 '|xns' : 'Roo.Toolbar'
3906 xtype : 'ToolbarContext',
3907 xns : Roo.form.HtmlEditor,
3908 '|xns' : 'Roo.form.HtmlEditor'
3919 xtype : 'ContentPanel',
3921 fitContainer : true,
3924 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3933 url : baseURL + '/Roo/cms_page.php',
3935 rendered : function (form)
3937 _this.trform2 = form;
3941 '|xns' : 'Roo.form',
3947 '|xns' : 'Roo.form',
3950 xtype : 'HtmlEditor',
3951 autosave : function() {
3953 var extended = _this.trform2.findField('extended');
3955 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3956 Roo.log('tr extend not dirty');
3961 Roo.log('tr extend dirty, auto save!');
3963 extended.fireEvent('autosave', extended);
3967 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3971 white : [ 'iframe' ],
3973 autosave : function (_self)
3975 var id = _this.trform.findField('id').getValue() * 1;
3978 if(!_self.editorcore.sourceEditMode){
3986 url : baseURL + '/Roo/Events.php',
3990 action : 'AUTOSAVE',
3991 on_id : (id > 0) ? id : 0,
3992 on_table : 'cms_page',
3993 remarks : 'EXTENDED',
3994 source: _self.getValue()
3996 success : function() {
3997 _self.originalValue = _self.getValue();
4000 failure : function()
4002 //Roo.MessageBox.alert("Error", "autosave failed");
4003 Roo.log('tr extended autosave failed?!');
4007 savedpreview : function (_self)
4009 var id = _this.trform.findField('id').getValue() * 1;
4011 var successFn = function(res){
4012 return res.data.POST.source;
4016 action : 'AUTOSAVE',
4017 remarks : 'EXTENDED',
4018 on_id : (id < 1) ? 0 : id,
4019 on_table : 'cms_page',
4020 successFn : successFn
4024 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4025 _self.setValue(res);
4026 _self.originalValue = res;
4029 stylesheetsclick : function (_self)
4031 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4032 _this.dialog.setStylesheets();
4038 '|xns' : 'Roo.form',
4041 xtype : 'ToolbarStandard',
4042 xns : Roo.form.HtmlEditor,
4043 '|xns' : 'Roo.form.HtmlEditor',
4046 xtype : 'Separator',
4048 '|xns' : 'Roo.Toolbar'
4052 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4054 click : function (_self, e)
4056 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4060 '|xns' : 'Roo.Toolbar'
4065 xtype : 'ToolbarContext',
4066 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4067 xns : Roo.form.HtmlEditor,
4068 '|xns' : 'Roo.form.HtmlEditor'
4079 xtype : 'ContentPanel',
4081 fitContainer : true,
4084 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4093 url : baseURL + '/Roo/cms_page.php',
4095 rendered : function (form)
4097 _this.trform3 = form;
4101 '|xns' : 'Roo.form',
4106 '|xns' : 'Roo.form',
4110 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4119 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4121 name : 'descriptions',