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();
1031 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1035 _this.dialog.hide();
1038 if (_this.callback) {
1039 _this.callback.call(_this, action.result.data);
1045 actionfailed : function (_self, action)
1047 _this.dialog.el.unmask();
1048 Pman.standardActionFailed(_self, action);
1050 rendered : function (_self)
1056 '|xns' : 'Roo.form',
1063 '|xns' : 'Roo.form',
1068 labelAlign : 'right',
1070 style : 'height:30px;overflow:hidden',
1073 '|xns' : 'Roo.form',
1077 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1086 style : 'height:30px;overflow:hidden',
1089 '|xns' : 'Roo.form',
1094 displayField : 'display_name',
1096 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1097 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1098 forceSelection : true,
1099 hiddenName : 'page_type_id',
1101 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1103 name : 'page_type_id_display_name',
1105 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1106 selectOnFocus : true,
1107 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1108 triggerAction : 'all',
1112 render : function (_self)
1114 _this.page_type = _self;
1116 select : function (combo, record, index)
1118 // _this.grid.footer.onClick('first');
1119 var page_type_name = record.data.name;
1120 _this.form.findField('page_type_id_name').setValue(page_type_name);
1121 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1122 _this.form.findField('is_attachment').setValue(0);
1126 _this.form.showHide.defer(100, _this.form);
1132 '|xns' : 'Roo.form',
1136 sortInfo : { direction : 'ASC', field: 'seqid' },
1138 beforeload : function (_self, o){
1139 o.params = o.params || {};
1141 o.params.etype = 'cms_page_type';
1145 '|xns' : 'Roo.data',
1147 xtype : 'HttpProxy',
1149 url : baseURL + '/Roo/core_enum.php',
1154 xtype : 'JsonReader',
1155 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1158 totalProperty : 'total',
1167 style : 'padding-left: -70px;',
1170 '|xns' : 'Roo.form',
1173 xtype : 'NumberField',
1174 decimalPrecision : 0,
1175 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1190 labelAlign : 'right',
1192 style : 'height:30px;overflow:hidden',
1195 '|xns' : 'Roo.form',
1199 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1208 style : 'height:30px;overflow:hidden',
1211 '|xns' : 'Roo.form',
1215 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1216 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1224 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1226 name : 'has_extended',
1229 check : function (_self, checked)
1234 _this.form.showHide();
1235 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1246 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1248 name : 'is_attachment',
1251 check : function (_self, checked)
1255 _this.form.showHide.defer(100, _this.form);
1269 displayField : 'name',
1271 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1272 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1273 forceSelection : true,
1274 hiddenName : 'author_id',
1276 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1278 name : 'author_id_name',
1280 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1281 queryParam : 'query[name]',
1282 selectOnFocus : true,
1283 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1284 triggerAction : 'all',
1289 '|xns' : 'Roo.form',
1293 sortInfo : { direction : 'ASC', field: 'name' },
1295 beforeload : function (_self, o){
1296 o.params = o.params || {};
1298 o.params.active = 1;
1299 o.params['query[is_owner]'] = 1;
1303 '|xns' : 'Roo.data',
1305 xtype : 'HttpProxy',
1307 url : baseURL + '/Roo/core_person',
1312 xtype : 'JsonReader',
1313 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1316 totalProperty : 'total',
1323 xtype : 'ComboBoxArray',
1324 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1325 hiddenName : 'category',
1326 name : 'category_name',
1329 '|xns' : 'Roo.form',
1334 displayField : 'display_fullpath',
1336 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1337 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1338 forceSelection : true,
1342 queryParam : 'search[name]',
1343 selectOnFocus : true,
1344 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1345 triggerAction : 'all',
1349 '|xns' : 'Roo.form',
1353 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1355 beforeload : function (_self, o){
1356 o.params = o.params || {};
1358 o.params.page_type_id_name= 'CATEGORY';
1360 o.params._with_fullpath = 1;
1364 '|xns' : 'Roo.data',
1366 xtype : 'HttpProxy',
1368 url : baseURL + '/Roo/cms_page.php',
1373 xtype : 'JsonReader',
1375 {"name":"id","type":"int"},
1376 {"name":"name","type":"string"},
1377 {"name":"display_name","type":"string"}
1381 totalProperty : 'total',
1392 displayField : 'page_link',
1394 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1395 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1396 forceSelection : true,
1397 hiddenName : 'parent_id',
1399 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1401 name : 'parent_id_title',
1403 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1404 selectOnFocus : true,
1405 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1406 triggerAction : 'all',
1411 select : function (combo, record, index)
1413 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1414 if (page_type_name == 'page') { // page
1417 // do not default to put 'Home' at the beginning.
1418 if (!record || !(record.data.parent_id *1)) {
1421 var pl = _this.form.findField('page_link');
1422 var lk = pl.getValue();
1423 var new_link = record.data.page_link + '/';
1425 new_link += lk.split('/').pop();
1427 pl.setValue(new_link);
1432 '|xns' : 'Roo.form',
1436 sortInfo : { field: 'page_link', direction: 'ASC' },
1438 beforeload : function (_self, options)
1440 options.params['search[page_link_no_empty]'] =1;
1442 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1443 options.params._page_type = 'page,element';
1445 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1448 var id = _this.form.findField('id').getValue() * 1;
1451 options.params['!id'] = id;
1456 options.params.is_element = 0;
1457 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1458 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1463 '|xns' : 'Roo.data',
1465 xtype : 'HttpProxy',
1467 url : baseURL + '/Roo/cms_page.php',
1472 xtype : 'JsonReader',
1474 { name: 'id', type: 'int' },
1480 totalProperty : 'total',
1490 '|xns' : 'Roo.form',
1493 xtype : 'DateField',
1494 altFormats : 'Y-m-d H:i:s',
1495 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1503 xtype : 'TextField',
1504 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1505 name : 'to_replace_id',
1513 xtype : 'TextField',
1514 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1518 keyup : function (_self, e)
1520 if (_this.page_type.getRawValue() == 'Category') {
1522 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1531 xtype : 'TextField',
1532 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1539 xtype : 'TextField',
1540 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1541 name : 'target_url',
1550 displayField : 'template_clean',
1552 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1553 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1554 forceSelection : true,
1555 hiddenName : 'template_id',
1557 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1559 name : 'template_id_template_clean',
1561 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1562 selectOnFocus : true,
1563 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1564 triggerAction : 'all',
1569 '|xns' : 'Roo.form',
1573 sortInfo : { field: 'template', direction: 'ASC' },
1575 beforeload : function (_self, options)
1578 options.params._rescan = 1;
1579 options.params._clean_name = 1;
1580 // options.params.lang = 'en';
1581 options.params['!template[0]'] = 'master.html';
1582 //options.params['!template[1]'] = 'index.html';
1586 '|xns' : 'Roo.data',
1588 xtype : 'HttpProxy',
1590 url : baseURL + '/Roo/Cms_template',
1595 xtype : 'JsonReader',
1597 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1601 totalProperty : 'total',
1611 displayField : 'name',
1613 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1614 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1615 forceSelection : true,
1616 hiddenName : 'element_id',
1618 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1620 name : 'element_id_name',
1622 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1623 selectOnFocus : true,
1624 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1625 triggerAction : 'all',
1630 '|xns' : 'Roo.form',
1634 sortInfo : { field: 'name', direction: 'ASC' },
1636 beforeload : function (_self, options)
1638 var par = _this.form.findField('parent_id').getValue() * 1;
1640 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1644 options.params._cms_page_id = par;
1648 '|xns' : 'Roo.data',
1650 xtype : 'HttpProxy',
1652 url : baseURL + '/Roo/Cms_template_element',
1657 xtype : 'JsonReader',
1659 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1663 totalProperty : 'total',
1673 displayField : 'page_link',
1675 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1676 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1677 forceSelection : true,
1678 hiddenName : 'menu_page_id',
1680 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1682 name : 'menu_page_id_page_link',
1684 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1685 selectOnFocus : true,
1686 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>',
1687 triggerAction : 'all',
1692 '|xns' : 'Roo.form',
1696 sortInfo : { field: 'title', direction: 'ASC' },
1698 beforeload : function (_self, options)
1700 options.params = options.params || {};
1702 options.params['search[page_link_no_empty]'] =1;
1704 options.params['page_type_id_name[0]'] = 'page';
1705 options.params['page_type_id_name[1]'] = 'blog';
1707 options.params.is_element = 0;
1708 options.params.is_menuitem = 0;
1713 '|xns' : 'Roo.data',
1715 xtype : 'HttpProxy',
1717 url : baseURL + '/Roo/cms_page.php',
1722 xtype : 'JsonReader',
1737 "name":"page_type_id_display_name",
1743 totalProperty : 'total',
1750 xtype : 'ComboBoxArray',
1751 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1752 hiddenName : 'page_cls',
1753 name : 'page_cls_name',
1756 '|xns' : 'Roo.form',
1761 displayField : 'display_name',
1763 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1764 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1765 forceSelection : true,
1768 queryParam : 'query[search]',
1769 selectOnFocus : true,
1770 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1771 triggerAction : 'all',
1772 valueField : 'name',
1775 '|xns' : 'Roo.form',
1779 sortInfo : { direction : 'ASC', field: 'seqid' },
1781 beforeload : function (_self, o){
1782 o.params = o.params || {};
1784 o.params.etype = 'cms_page_class';
1788 '|xns' : 'Roo.data',
1790 xtype : 'HttpProxy',
1792 url : baseURL + '/Roo/core_enum.php',
1797 xtype : 'JsonReader',
1799 {"name":"id","type":"int"},
1800 {"name":"name","type":"string"},
1801 {"name":"display_name","type":"string"}
1805 totalProperty : 'total',
1819 '|xns' : 'Roo.form',
1825 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1826 style : 'width: 165px;',
1828 '|xns' : 'Roo.form',
1831 xtype : 'DisplayField',
1833 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1834 name : 'primary_image_id',
1835 style : 'border: 1px solid #ccc;',
1836 valueRenderer : function(v) {
1838 if (!v || v * 1 < 1) {
1839 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1842 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1855 render : function (_self)
1857 _this.interestsCol = _self;
1861 '|xns' : 'Roo.form',
1864 xtype : 'ComboBoxArray',
1865 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1866 hiddenName : 'interest',
1867 name : 'interest_name',
1870 render : function (_self)
1872 _this.interests = _self;
1874 _self.combo.addicon.setStyle( {
1875 position : 'absolute',
1884 '|xns' : 'Roo.form',
1889 displayField : 'display_name',
1891 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1892 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1893 forceSelection : true,
1896 queryParam : 'query[name]',
1897 selectOnFocus : true,
1898 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1899 triggerAction : 'all',
1903 '|xns' : 'Roo.form',
1907 sortInfo : { direction : 'ASC', field: 'name' },
1909 beforeload : function (_self, o){
1910 o.params = o.params || {};
1911 o.params.etype = 'crm_interest';
1915 '|xns' : 'Roo.data',
1917 xtype : 'HttpProxy',
1919 url : baseURL + '/Roo/Core_enum.php',
1924 xtype : 'JsonReader',
1926 {"name":"id","type":"int"},
1927 {"name":"name","type":"string"},
1928 {"name":"display_name","type":"string"}
1932 totalProperty : 'total',
1949 name : 'is_system_page',
1955 name : 'is_menuitem',
1961 name : 'page_type_id_name',
1968 render : function (_self)
1970 _this.user_defined_fields = _self;
1981 xtype : 'ContentPanel',
1983 fitContainer : true,
1986 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1995 url : baseURL + '/Roo/cms_page.php',
1997 rendered : function (form)
2003 '|xns' : 'Roo.form',
2009 '|xns' : 'Roo.form',
2012 xtype : 'HtmlEditor',
2013 autosave : function() {
2015 var body = _this.form1.findField('body');
2017 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2018 Roo.log('body not dirty');
2022 Roo.log('body dirty, auto save!');
2024 body.fireEvent('autosave', body);
2028 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2032 white : [ 'iframe' ],
2035 autosave : function (_self)
2037 Roo.log('autosave');
2039 var id = _this.form.findField('id').getValue() * 1;
2041 if(!_self.editorcore.sourceEditMode){
2048 url : baseURL + '/Roo/Events.php',
2052 action : 'AUTOSAVE',
2053 on_id : (id > 0) ? id : 0,
2054 on_table : 'cms_page',
2056 source: _self.getValue()
2058 success : function() {
2059 _self.originalValue = _self.getValue();
2062 failure : function()
2064 //Roo.MessageBox.alert("Error", "autosave failed");
2065 Roo.log('body autosave failed?!');
2070 savedpreview : function (_self)
2072 Roo.log('saved preview');
2074 var id = _this.form.findField('id').getValue() * 1;
2076 var successFn = function(res){
2077 return res.data.POST.source;
2081 action : 'AUTOSAVE',
2083 on_id : (id < 1) ? 0 : id,
2084 on_table : 'cms_page',
2085 successFn : successFn
2089 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2090 _self.setValue(res);
2091 _self.originalValue = res;
2094 stylesheetsclick : function (_self)
2096 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2097 _this.dialog.setStylesheets();
2103 '|xns' : 'Roo.form',
2106 xtype : 'ToolbarStandard',
2107 xns : Roo.form.HtmlEditor,
2108 '|xns' : 'Roo.form.HtmlEditor',
2113 displayField : 'name',
2115 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2116 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2117 forceSelection : true,
2119 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2122 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2123 queryParam : 'search',
2124 selectOnFocus : true,
2125 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>',
2126 triggerAction : 'all',
2131 beforequery : function (combo, query, forceAll, cancel, e)
2134 var id = _this.form.findField('id').getValue() * 1;
2136 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2140 render : function (_self)
2142 _this.bodyimgselect = _self;
2144 select : function (combo, record, index)
2151 var editor = _this.form.findField('body').editorcore;
2153 var curnode = editor.getSelectedNode();
2155 if (curnode && curnode.tagName == 'IMG') {
2156 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2157 baseURL, record.data.id, record.data.filename
2159 // note -forces an update... hopefully...
2160 editor.owner.fireEvent('editorevent', editor, false);
2163 editor.insertAtCursor(
2164 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2165 baseURL, record.data.id, record.data.filename
2174 '|xns' : 'Roo.form',
2178 sortInfo : { direction : 'ASC', field: 'id' },
2180 beforeload : function (_self, o){
2181 o.params = o.params || {};
2183 var id = _this.form.findField('id').getValue() * 1;
2185 Roo.MessageBox.alert("Error", "Save press release first");
2189 o.params.ontable = 'cms_page';
2190 // o.params.imgtype = 'PressRelease';
2191 //o.params['query[imagesize]'] = '150x150';
2196 '|xns' : 'Roo.data',
2198 xtype : 'HttpProxy',
2200 url : baseURL + '/Roo/Images.php',
2205 xtype : 'JsonReader',
2206 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2209 totalProperty : 'total',
2218 displayField : 'page_link',
2220 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2221 forceSelection : true,
2222 hiddenName : 'add_link_id',
2224 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2228 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2229 selectOnFocus : true,
2230 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2231 triggerAction : 'all',
2236 select : function (combo, record, index)
2242 var editor = _this.form.findField('body');
2243 editor.editorcore.insertAtCursor(
2244 String.format('<a href="#page-{0}">{1}</a>',
2245 record.data.page_link, record.data.title
2253 '|xns' : 'Roo.form',
2257 sortInfo : { field: 'page_link', direction: 'ASC' },
2259 beforeload : function (_self, options)
2261 options.params['search[page_link_no_empty]'] =1;
2263 options.params.is_element = 0;
2264 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2269 '|xns' : 'Roo.data',
2271 xtype : 'HttpProxy',
2273 url : baseURL + '/Roo/cms_page.php',
2278 xtype : 'JsonReader',
2280 { name: 'id', type: 'int' },
2286 totalProperty : 'total',
2293 xtype : 'Separator',
2295 '|xns' : 'Roo.Toolbar'
2299 cls : 'x-init-enable',
2300 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2302 click : function (_self, e)
2304 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2308 '|xns' : 'Roo.Toolbar'
2313 xtype : 'ToolbarContext',
2314 xns : Roo.form.HtmlEditor,
2315 '|xns' : 'Roo.form.HtmlEditor'
2326 xtype : 'ContentPanel',
2328 fitContainer : true,
2331 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2340 url : baseURL + '/Roo/cms_page.php',
2342 rendered : function (form)
2348 '|xns' : 'Roo.form',
2354 '|xns' : 'Roo.form',
2357 xtype : 'HtmlEditor',
2358 autosave : function() {
2360 var extended = _this.form2.findField('extended');
2362 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2363 Roo.log('extend not dirty');
2368 Roo.log('extend dirty, auto save!');
2370 extended.fireEvent('autosave', extended);
2372 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2376 white : [ 'iframe' ],
2379 autosave : function (_self)
2381 var id = _this.form.findField('id').getValue() * 1;
2384 if(!_self.editorcore.sourceEditMode){
2391 url : baseURL + '/Roo/Events.php',
2395 action : 'AUTOSAVE',
2396 on_id : (id > 0) ? id : 0,
2397 on_table : 'cms_page',
2398 remarks : 'EXTENDED',
2399 source: _self.getValue()
2401 success : function() {
2402 _self.originalValue = _self.getValue();
2405 failure : function()
2407 //Roo.MessageBox.alert("Error", "autosave failed");
2408 Roo.log('extended autosave failed?!');
2412 savedpreview : function (_self)
2414 var id = _this.form.findField('id').getValue() * 1;
2416 var successFn = function(res){
2417 return res.data.POST.source;
2421 action : 'AUTOSAVE',
2422 remarks : 'EXTENDED',
2423 on_id : (id < 1) ? 0 : id,
2424 on_table : 'cms_page',
2425 successFn : successFn
2429 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2430 _self.setValue(res);
2431 _self.originalValue = res;
2434 stylesheetsclick : function (_self)
2436 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2437 _this.dialog.setStylesheets();
2443 '|xns' : 'Roo.form',
2446 xtype : 'ToolbarStandard',
2447 xns : Roo.form.HtmlEditor,
2448 '|xns' : 'Roo.form.HtmlEditor',
2453 displayField : 'name',
2455 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2456 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2457 forceSelection : true,
2459 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2462 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2463 selectOnFocus : true,
2464 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2465 triggerAction : 'all',
2470 beforequery : function (combo, query, forceAll, cancel, e)
2473 var id = _this.form.findField('id').getValue() * 1;
2475 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2479 render : function (_self)
2481 _this.extendimgselect = _self;
2483 select : function (combo, record, index)
2490 var editor = _this.form.findField('extended').editorcore;
2492 var curnode = editor.getSelectedNode();
2494 if (curnode && curnode.tagName == 'IMG') {
2495 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2496 baseURL, record.data.id, record.data.filename
2498 // note -forces an update... hopefully...
2499 editor.owner.fireEvent('editorevent', editor, false);
2502 editor.insertAtCursor(
2503 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2504 baseURL, record.data.id, record.data.filename
2513 '|xns' : 'Roo.form',
2517 sortInfo : { direction : 'ASC', field: 'id' },
2519 beforeload : function (_self, o){
2520 o.params = o.params || {};
2522 var id = _this.form.findField('id').getValue() * 1;
2524 Roo.MessageBox.alert("Error", "Save press release first");
2528 o.params.ontable = 'cms_page';
2529 // o.params.imgtype = 'PressRelease';
2530 //o.params['query[imagesize]'] = '150x150';
2535 '|xns' : 'Roo.data',
2537 xtype : 'HttpProxy',
2539 url : baseURL + '/Roo/Images.php',
2544 xtype : 'JsonReader',
2545 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2548 totalProperty : 'total',
2557 displayField : 'page_link',
2559 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2560 forceSelection : true,
2561 hiddenName : 'add_link_id',
2563 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2567 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2568 selectOnFocus : true,
2569 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2570 triggerAction : 'all',
2575 select : function (combo, record, index)
2581 var editor = _this.form.findField('body');
2582 editor.editorcore.insertAtCursor(
2583 String.format('<a href="#page-{0}">{1}</a>',
2584 record.data.page_link, record.data.title
2592 '|xns' : 'Roo.form',
2596 sortInfo : { field: 'page_link', direction: 'ASC' },
2598 beforeload : function (_self, options)
2600 options.params['search[page_link_no_empty]'] =1;
2602 options.params.is_element = 0;
2603 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2608 '|xns' : 'Roo.data',
2610 xtype : 'HttpProxy',
2612 url : baseURL + '/Roo/cms_page.php',
2617 xtype : 'JsonReader',
2619 { name: 'id', type: 'int' },
2625 totalProperty : 'total',
2632 xtype : 'Separator',
2634 '|xns' : 'Roo.Toolbar'
2638 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2640 click : function (_self, e)
2642 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2646 '|xns' : 'Roo.Toolbar'
2651 xtype : 'ToolbarContext',
2652 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2653 xns : Roo.form.HtmlEditor,
2654 '|xns' : 'Roo.form.HtmlEditor'
2665 xtype : 'ContentPanel',
2667 fitContainer : true,
2670 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2679 url : baseURL + '/Roo/cms_page.php',
2681 rendered : function (form)
2687 '|xns' : 'Roo.form',
2693 '|xns' : 'Roo.form',
2697 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2711 xtype : 'ContentPanel',
2713 fitContainer : true,
2716 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2725 url : baseURL + '/Roo/cms_page.php',
2727 rendered : function (form)
2733 '|xns' : 'Roo.form',
2738 '|xns' : 'Roo.form',
2742 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2751 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2753 name : 'descriptions',
2768 xtype : 'GridPanel',
2770 fitContainer : true,
2773 tableName : 'Images',
2774 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2776 activate : function() {
2779 _this.grid.footer.onClick('first');
2786 xtype : 'EditorGrid',
2787 autoExpandColumn : 'title',
2791 render : function() {
2793 //_this.dialog = Pman.Dialog.FILL_IN
2794 if (_this.panel.active) {
2795 //this.footer.onClick('first');
2798 rowdblclick : function (_self, rowIndex, e)
2800 var rd = _this.grid.getDataSource().getAt(rowIndex);
2801 var id = rd.data.id;
2802 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2803 _this.form.findField('contents').execCmd('insertimage', url);
2808 '|xns' : 'Roo.grid',
2816 cls : 'x-btn-text-icon',
2817 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2818 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2822 var id = _this.form.findField('id').getValue() * 1;
2828 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2829 _this.grid.ds.load({});
2839 cls : 'x-btn-text-icon',
2840 icon : rootURL + '/Pman/templates/images/trash.gif',
2841 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2845 var selection = _this.grid.getSelectionModel().getSelectedCell();
2846 var sn = _this.grid.ds.getAt(selection[0]);
2847 if (!sn || isNaN(sn.id *1)) {
2848 Roo.MessageBox.alert("Error", "Select a image");
2851 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2857 url : baseURL + '/Roo/Images.php',
2862 success : function()
2864 Roo.log('Got Success!!');
2865 _this.grid.ds.load({});
2879 beforeload : function (_self, o)
2881 var id = _this.form.findField('id').getValue() * 1;
2887 o.params = o.params || {};
2888 o.params.limit = 9999;
2890 o.params.ontable = 'cms_page';
2892 update : function (_self, rec, operation)
2896 url : baseURL+'/Roo/Images.php',
2899 success: function(res)
2901 Roo.log("GOT success");
2902 // update the data...
2903 _this.grid.ds.load({});
2905 failure : function(res)
2907 Roo.MessageBox.alert('Error', res.errorMsg);
2908 _this.grid.ds.load({});
2916 '|xns' : 'Roo.data',
2918 xtype : 'HttpProxy',
2920 url : baseURL + '/Roo/Images.php',
2925 xtype : 'JsonReader',
2960 'name': 'displayorder',
2968 'name': 'parent_image_id',
2974 'dateFormat': 'Y-m-d'
2993 'name': 'parent_image_id_id',
2997 'name': 'parent_image_id_filename',
3001 'name': 'parent_image_id_ontable',
3005 'name': 'parent_image_id_onid',
3009 'name': 'parent_image_id_mimetype',
3013 'name': 'parent_image_id_width',
3017 'name': 'parent_image_id_height',
3021 'name': 'parent_image_id_filesize',
3025 'name': 'parent_image_id_displayorder',
3029 'name': 'parent_image_id_language',
3033 'name': 'parent_image_id_parent_image_id',
3037 'name': 'parent_image_id_created',
3041 'name': 'parent_image_id_imgtype',
3045 'name': 'parent_image_id_linkurl',
3049 'name': 'parent_image_id_descript',
3053 'name': 'parent_image_id_title',
3059 totalProperty : 'total',
3066 xtype : 'ColumnModel',
3068 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3069 renderer : function(v,x,r) {
3070 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3078 xtype : 'ColumnModel',
3079 dataIndex : 'filename',
3080 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3081 renderer : function(v) { return String.format('{0}', v); },
3087 xtype : 'ColumnModel',
3088 dataIndex : 'displayorder',
3089 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3090 renderer : function(v) { return String.format('{0}', v); },
3093 '|xns' : 'Roo.grid',
3095 xtype : 'GridEditor',
3097 '|xns' : 'Roo.grid',
3099 xtype : 'NumberField',
3100 decimalPrecision : 0,
3102 focus : function (_self)
3104 if (this.value == 0) {
3105 this.el.dom.value = '';
3115 xtype : 'ColumnModel',
3116 dataIndex : 'title',
3117 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3118 renderer : function(v) { return String.format('{0}', v); },
3121 '|xns' : 'Roo.grid',
3123 xtype : 'GridEditor',
3125 '|xns' : 'Roo.grid',
3127 xtype : 'TextField',
3134 xtype : 'ColumnModel',
3135 dataIndex : 'linkurl',
3136 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3137 renderer : function(v)
3139 return String.format('{0}', (v) ? v : '');
3143 '|xns' : 'Roo.grid',
3145 xtype : 'GridEditor',
3147 '|xns' : 'Roo.grid',
3149 xtype : 'TextField',
3159 xtype : 'NestedLayoutPanel',
3161 fitContainer : true,
3165 render : function (_self)
3167 _this.westLayoutPanel = this;
3174 xtype : 'BorderLayout',
3178 xtype : 'LayoutRegion',
3179 tabPosition : 'top',
3184 xtype : 'LayoutRegion',
3187 tabPosition : 'top',
3193 xtype : 'ContentPanel',
3198 render : function (_self)
3200 _this.trpanel = _self;
3202 resize : function (_self, width, height)
3204 Roo.log('resize called');
3206 var ew = Math.max(250, width - 10);
3207 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3210 if (!_this.trform) {
3214 var bd = _this.trform1.findField('body');
3219 // since render delays resize..
3220 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3221 // _this.trbodycol.el.setWidth(bd.width+20);
3223 var bd = _this.trform2.findField('extended');
3227 // since render delays resize..
3228 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3229 // _this.trextendcol.el.setWidth(bd.width+20);
3239 labelAlign : 'right',
3242 showHide : function() {
3244 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3245 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3246 var has_lang = _this.trform.findField('language').getValue().length;
3248 _this.westLayoutPanel.getLayout().getRegion('south').show();
3249 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3250 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3251 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3254 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3257 if(!has_extended && has_lang){
3258 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3259 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3267 var el = _this.trform.findField(k);
3268 el.actionMode = 'fieldEl';
3270 Roo.log("show: " + k);
3273 Roo.log("hide: " + k);
3278 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3281 if(typeof(_this.trform.editors) == 'undefined'){
3282 _this.trform.editors = {
3283 body : _this.trform1.findField('body').wrap.isVisible(),
3284 extended : _this.trform2.findField('extended').wrap.isVisible()
3286 if(_this.trform.editors.body){
3287 setInterval(_this.trform1.findField('body').autosave, 60000);
3290 if(_this.trform.editors.extended){
3291 setInterval(_this.trform2.findField('extended').autosave, 60000);
3295 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3296 setInterval(_this.trform1.findField('body').autosave, 60000);
3297 _this.trform.editors.body = true;
3300 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3301 setInterval(_this.trform2.findField('extended').autosave, 60000);
3302 _this.trform.editors.extended = true;
3307 style : 'margin: 5px',
3308 trackResetOnLoad : true,
3309 url : baseURL + '/Roo/cms_page.php',
3311 actioncomplete : function (_self, action)
3313 if (action.type =='submit') {
3317 if (action.type == 'setdata') {
3318 _this.trform.addForm(_this.trform1);
3319 _this.trform.addForm(_this.trform2);
3320 _this.trform.addForm(_this.trform3);
3322 if ( _this.data.id) {
3324 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3326 this.trpanel.el.mask("save first");
3333 if (action.type == 'load') {
3334 // _this.dialog.el.unmask();
3337 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3338 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3339 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3340 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3345 actionfailed : function (_self, action)
3347 _this.dialog.el.unmask();
3349 Pman.standardActionFailed(_self, action);
3351 rendered : function (_self)
3353 _this.trform = _self;
3357 '|xns' : 'Roo.form',
3364 '|xns' : 'Roo.form',
3371 '|xns' : 'Roo.form',
3376 displayField : 'language_name',
3378 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3379 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3380 forceSelection : true,
3381 hiddenName : 'language',
3383 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3385 name : 'language_name',
3387 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3388 selectOnFocus : true,
3389 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3390 triggerAction : 'all',
3392 valueField : 'language',
3394 add : function (combo)
3396 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3399 _this.trform.reset();
3400 _this.trform1.reset();
3401 _this.trform2.reset();
3403 combo.setValue(res.lang);
3404 combo.el.dom.value = res.lang_name;
3407 _this.trform.showHide();
3408 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3413 render : function (_self)
3415 _this.language = _self;
3417 select : function (combo, record, index)
3420 _this.trform.showHide();
3421 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3428 'lookup[language]' : record.data.language,
3429 'lookup[translation_of_id]' : _this.data.id,
3436 '|xns' : 'Roo.form',
3440 sortInfo : { direction : 'ASC', field: 'language' },
3442 beforeload : function (_self, o){
3443 o.params = o.params || {};
3445 o.params._distinct = 'language';
3446 o.params._columns ='language_name,language';
3447 o.params._with_name = true;
3449 if(_this.form.findField('id').getValue()*1 > 0){
3450 o.params.translation_of_id = _this.form.findField('id').getValue();
3456 '|xns' : 'Roo.data',
3458 xtype : 'HttpProxy',
3460 url : baseURL + '/Roo/Cms_page.php',
3465 xtype : 'JsonReader',
3466 fields : [{"name":"language","type":"string"}],
3469 totalProperty : 'total',
3477 style : 'padding-top:12px;padding-left:30px;float:left',
3480 render : function (_self)
3482 _this.updateRow = _self;
3486 '|xns' : 'Roo.form',
3490 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3494 // _this.dialog.el.mask("Saving");
3495 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3496 _this.trform1.findField('body').syncValue();
3497 _this.trform2.findField('extended').syncValue();
3499 _this.trform1.findField('body').pushValue();
3500 _this.trform2.findField('extended').pushValue();
3503 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3504 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3505 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3506 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3507 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3509 if(_this.trform.findField('element_id').getValue()*1 > 0){
3510 _this.trform.findField('is_element').setValue(1);
3513 _this.trform.doAction("submit");
3524 xtype : 'TextField',
3525 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3541 name : 'element_id',
3547 name : 'menu_page_id',
3553 name : 'is_menuitem',
3559 name : 'is_element',
3566 name : 'translation_of_id',
3581 xtype : 'ContentPanel',
3583 fitContainer : true,
3586 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3595 url : baseURL + '/Roo/cms_page.php',
3597 rendered : function (form)
3599 _this.trform1 = form;
3603 '|xns' : 'Roo.form',
3609 '|xns' : 'Roo.form',
3612 xtype : 'HtmlEditor',
3613 autosave : function() {
3615 var body = _this.trform1.findField('body');
3617 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3618 Roo.log('tr body not dirty');
3622 Roo.log('tr body dirty, auto save!');
3624 body.fireEvent('autosave', body);
3626 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3630 white : [ 'iframe' ],
3632 autosave : function (_self)
3634 var id = _this.trform.findField('id').getValue() * 1;
3637 if(!_self.editorcore.sourceEditMode){
3644 url : baseURL + '/Roo/Events.php',
3648 action : 'AUTOSAVE',
3649 on_id : (id > 0) ? id : 0,
3650 on_table : 'cms_page',
3652 source: _self.getValue()
3654 success : function() {
3655 _self.originalValue = _self.getValue();
3658 failure : function()
3660 //Roo.MessageBox.alert("Error", "autosave failed");
3661 Roo.log('tr body autosave failed?!');
3665 savedpreview : function (_self)
3667 var id = _this.trform.findField('id').getValue() * 1;
3669 var successFn = function(res){
3670 return res.data.POST.source;
3674 action : 'AUTOSAVE',
3676 on_id : (id < 1) ? 0 : id,
3677 on_table : 'cms_page',
3678 successFn : successFn
3682 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3683 _self.setValue(res);
3684 _self.originalValue = res;
3687 stylesheetsclick : function (_self)
3689 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3690 _this.dialog.setStylesheets();
3696 '|xns' : 'Roo.form',
3699 xtype : 'ToolbarStandard',
3700 xns : Roo.form.HtmlEditor,
3701 '|xns' : 'Roo.form.HtmlEditor',
3706 displayField : 'name',
3708 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3709 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3710 forceSelection : true,
3712 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3715 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3716 selectOnFocus : true,
3717 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>',
3718 triggerAction : 'all',
3723 beforequery : function (combo, query, forceAll, cancel, e)
3726 var id = _this.form.findField('id').getValue() * 1;
3728 Roo.MessageBox.alert("Error", "Save press release first");
3732 render : function (_self)
3734 _this.trbodyimgselect = _self;
3736 select : function (combo, record, index)
3743 var editor = _this.trform.findField('body').editorcore;
3745 var curnode = editor.getSelectedNode();
3747 if (curnode && curnode.tagName == 'IMG') {
3748 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3749 baseURL, record.data.id, record.data.filename
3751 // note -forces an update... hopefully...
3752 editor.owner.fireEvent('editorevent', editor, false);
3755 editor.insertAtCursor(
3756 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3757 baseURL, record.data.id, record.data.filename
3766 '|xns' : 'Roo.form',
3770 sortInfo : { direction : 'ASC', field: 'id' },
3772 beforeload : function (_self, o){
3773 o.params = o.params || {};
3775 var id = _this.form.findField('id').getValue() * 1;
3777 Roo.MessageBox.alert("Error", "Save press release first");
3781 o.params.ontable = 'cms_page';
3782 // o.params.imgtype = 'PressRelease';
3783 //o.params['query[imagesize]'] = '150x150';
3788 '|xns' : 'Roo.data',
3790 xtype : 'HttpProxy',
3792 url : baseURL + '/Roo/Images.php',
3797 xtype : 'JsonReader',
3798 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3801 totalProperty : 'total',
3810 displayField : 'page_link',
3812 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3813 forceSelection : true,
3814 hiddenName : 'add_link_id',
3816 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3820 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3821 selectOnFocus : true,
3822 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3823 triggerAction : 'all',
3828 select : function (combo, record, index)
3834 var editor = _this.form.findField('body');
3835 editor.insertAtCursor(
3836 String.format('<a href="#page-{0}">{1}</a>',
3837 record.data.page_link, record.data.title
3845 '|xns' : 'Roo.form',
3849 sortInfo : { field: 'page_link', direction: 'ASC' },
3851 beforeload : function (_self, options)
3853 options.params['search[page_link_no_empty]'] =1;
3855 options.params.is_element = 0;
3856 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3861 '|xns' : 'Roo.data',
3863 xtype : 'HttpProxy',
3865 url : baseURL + '/Roo/cms_page.php',
3870 xtype : 'JsonReader',
3872 { name: 'id', type: 'int' },
3878 totalProperty : 'total',
3885 xtype : 'Separator',
3887 '|xns' : 'Roo.Toolbar'
3891 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3893 click : function (_self, e)
3895 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3899 '|xns' : 'Roo.Toolbar'
3904 xtype : 'ToolbarContext',
3905 xns : Roo.form.HtmlEditor,
3906 '|xns' : 'Roo.form.HtmlEditor'
3917 xtype : 'ContentPanel',
3919 fitContainer : true,
3922 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3931 url : baseURL + '/Roo/cms_page.php',
3933 rendered : function (form)
3935 _this.trform2 = form;
3939 '|xns' : 'Roo.form',
3945 '|xns' : 'Roo.form',
3948 xtype : 'HtmlEditor',
3949 autosave : function() {
3951 var extended = _this.trform2.findField('extended');
3953 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3954 Roo.log('tr extend not dirty');
3959 Roo.log('tr extend dirty, auto save!');
3961 extended.fireEvent('autosave', extended);
3965 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3969 white : [ 'iframe' ],
3971 autosave : function (_self)
3973 var id = _this.trform.findField('id').getValue() * 1;
3976 if(!_self.editorcore.sourceEditMode){
3984 url : baseURL + '/Roo/Events.php',
3988 action : 'AUTOSAVE',
3989 on_id : (id > 0) ? id : 0,
3990 on_table : 'cms_page',
3991 remarks : 'EXTENDED',
3992 source: _self.getValue()
3994 success : function() {
3995 _self.originalValue = _self.getValue();
3998 failure : function()
4000 //Roo.MessageBox.alert("Error", "autosave failed");
4001 Roo.log('tr extended autosave failed?!');
4005 savedpreview : function (_self)
4007 var id = _this.trform.findField('id').getValue() * 1;
4009 var successFn = function(res){
4010 return res.data.POST.source;
4014 action : 'AUTOSAVE',
4015 remarks : 'EXTENDED',
4016 on_id : (id < 1) ? 0 : id,
4017 on_table : 'cms_page',
4018 successFn : successFn
4022 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4023 _self.setValue(res);
4024 _self.originalValue = res;
4027 stylesheetsclick : function (_self)
4029 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4030 _this.dialog.setStylesheets();
4036 '|xns' : 'Roo.form',
4039 xtype : 'ToolbarStandard',
4040 xns : Roo.form.HtmlEditor,
4041 '|xns' : 'Roo.form.HtmlEditor',
4044 xtype : 'Separator',
4046 '|xns' : 'Roo.Toolbar'
4050 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4052 click : function (_self, e)
4054 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4058 '|xns' : 'Roo.Toolbar'
4063 xtype : 'ToolbarContext',
4064 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4065 xns : Roo.form.HtmlEditor,
4066 '|xns' : 'Roo.form.HtmlEditor'
4077 xtype : 'ContentPanel',
4079 fitContainer : true,
4082 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4091 url : baseURL + '/Roo/cms_page.php',
4093 rendered : function (form)
4095 _this.trform3 = form;
4099 '|xns' : 'Roo.form',
4104 '|xns' : 'Roo.form',
4108 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4117 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4119 name : 'descriptions',