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",
427 _this.dialog.getLayout().getRegion('west').collapse();
439 _this.dialog.getLayout().getRegion('west').collapse();
449 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
454 if(!_this.form1.findField('body').editorcore.sourceEditMode){
455 _this.form1.findField('body').syncValue();
456 _this.form2.findField('extended').syncValue();
457 Roo.log('syncValue');
459 _this.form1.findField('body').pushValue();
460 _this.form2.findField('extended').pushValue();
461 Roo.log('pushValue');
464 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
465 _this.interests.reset();
469 _this.trform.isDirty() ||
470 _this.trform1.isDirty() ||
471 _this.trform2.isDirty() ||
472 _this.trform3.isDirty()
474 Roo.MessageBox.confirm(
476 "Do you want to save the translation",
479 _this.dialog.el.mask("Saving");
480 _this.form.doAction("submit");
490 _this.dialog.el.mask("Saving");
491 _this.form.doAction("submit");
500 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
506 if(!_this.form1.findField('body').editorcore.sourceEditMode){
507 _this.form1.findField('body').syncValue();
508 _this.form2.findField('extended').syncValue();
510 _this.form1.findField('body').pushValue();
511 _this.form2.findField('extended').pushValue();
514 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
515 _this.interests.reset();
520 _this.trform.isDirty() ||
521 _this.trform1.isDirty() ||
522 _this.trform2.isDirty() ||
523 _this.trform3.isDirty()
525 Roo.MessageBox.confirm(
527 "Do you want to save the translation",
530 _this.dialog.el.mask("Saving");
531 _this.form.doAction("submit");
541 _this.dialog.el.mask("Saving");
542 _this.form.doAction("submit");
552 xtype : 'NestedLayoutPanel',
558 render : function (_self)
560 _this.centerLayoutPanel = this;
567 xtype : 'BorderLayout',
571 xtype : 'LayoutRegion',
577 xtype : 'LayoutRegion',
586 xtype : 'ContentPanel',
591 render : function (_self)
593 _this.cpanel = _self;
595 resize : function (_self, width, height)
597 Roo.log("RESIZE, " + width + ',' + height);
599 var ew = Math.max(250, width - 10);
600 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
607 bd = _this.form1.findField('body');
611 // since render delays resize..
612 Roo.log('resizing body to ' + bd.width);
613 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
614 // _this.bodycol.el.setWidth(bd.width+20);
619 bd = _this.form2.findField('extended');
625 Roo.log('resizing extended to ' + bd.width);
626 // since render delays resize..
627 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
628 // _this.extendcol.el.setWidth(bd.width+20);
633 bd = _this.form3.findField('extra_css');
637 // _this.keywordscol.el.setWidth(ew+20);
639 // fix for messed up rendering of dialog?
643 _this.dialog.layout.el.dom.scrollTop = 0;
645 // noop... - the above sometimes fails...
658 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
660 click : function (_self, e)
662 if (_this.dialog.getLayout().getRegion('west').collapsed) {
663 _this.dialog.getLayout().getRegion('west').expand();
665 _this.dialog.getLayout().getRegion('west').collapse();
671 '|xns' : 'Roo.Toolbar'
676 '|xns' : 'Roo.Toolbar'
680 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
682 click : function (_self, e)
684 if (_this.panel.region.collapsed) {
685 _this.panel.region.expand();
687 _this.panel.region.collapse();
693 '|xns' : 'Roo.Toolbar'
702 _this.form.setValues(_this.data);
706 _this.dialog.el.unmask();
707 _this.grid.getDataSource().load();
709 _this.trform.reset();
710 _this.trform1.reset();
711 _this.trform2.reset();
713 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
714 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
717 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
718 catlabel.dom.innerHTML = 'Category';
720 if(_this.data.page_type_id_name == 'category'){
721 catlabel.dom.innerHTML = 'Parent Category';
725 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
726 catlabel.dom.innerHTML = 'Parent page';
727 if(_this.data.page_type_id_name == 'category'){
728 catlabel.dom.innerHTML = 'Parent';
731 // better if this was not here... - not sure which project uses it?
733 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
734 _this.interestsCol.show();
737 if(typeof(d['interests']) != 'undefined'){
738 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
741 if(typeof(d['categories']) != 'undefined'){
742 _this.form.findField('category').setValue(Roo.decode(d['categories']));
745 if(typeof(d['page_classes']) != 'undefined'){
746 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
749 _this.trpanel.el.unmask();
750 _this.panel.el.unmask();
753 _this.cpanel.el.dom.scrollTop = 0;
755 // fix messed up scroll.
756 _this.dialog.layout.el.dom.scrollTop = 0;
759 labelAlign : 'right',
762 showHide : function()
769 var page_type_name = _this.form.findField('page_type_id_name').getValue();
771 switch(page_type_name){
794 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
795 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
796 var has_extended = _this.form.findField('has_extended').getValue() * 1;
799 is_attachment : !in_rss,
801 category_type_id : in_rss && !is_menu,
802 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
803 target_url : is_menu,
805 category : !is_category,
807 parent_id : !in_rss || is_category ,
810 to_replace_id :false, // !in_rss, // is this used.
811 is_draft : !is_system_page,
812 author_id : in_rss && !is_menu && !is_attachment,
814 template_id : !is_attachment && !is_menu && !is_system_page,
815 element_id : is_element && !is_menu,
816 menu_page_id : is_menu,
817 page_cls : is_element
819 // has_extended : !is_menu && !is_attachment, // always shown.
820 // extended : has_extended && !is_menu && !is_attachment,
821 // body : !is_attachment && !is_menu,
822 //keywords : !is_attachment && !is_menu,
823 // descriptions : !is_attachment && !is_menu
824 // extra_css : !is_attachment && !is_menu
828 var el = _this.form.findField(k);
831 Roo.log("missing field " + k);
835 el.actionMode = 'fieldEl';
845 _this.centerLayoutPanel.getLayout().getRegion('south').show();
846 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
847 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
848 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
849 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
851 if(is_attachment || is_menu){
853 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
857 if(!has_extended && !is_attachment && !is_menu){
858 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
859 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
863 _this.trform.showHide();
865 if(typeof(_this.form.editors) == 'undefined'){
866 _this.form.editors = {
867 body : _this.form1.findField('body').wrap.isVisible(),
868 extended : _this.form2.findField('extended').wrap.isVisible()
871 if(_this.form.editors.body){
872 setInterval(_this.form1.findField('body').autosave, 60000);
875 if(_this.form.editors.extended){
876 setInterval(_this.form2.findField('extended').autosave, 60000);
880 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
881 setInterval(_this.form1.findField('body').autosave, 60000);
882 _this.form.editors.body = true;
885 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
886 setInterval(_this.form2.findField('extended').autosave, 60000);
887 _this.form.editors.extended = true;
893 style : 'margin: 5px',
894 url : baseURL + '/Roo/cms_page.php',
896 actioncomplete : function (_self, action)
899 if (action.type == 'setdata') {
901 _this.form.addForm(_this.form1);
902 _this.form.addForm(_this.form2);
903 _this.form.addForm(_this.form3);
904 _this.form.addForm(_this.form4);
906 _this.dialog.setStylesheets();
908 _this.dialog.getLayout().getRegion('west').collapse();
909 _this.panel.region.collapse();
911 _this.trpanel.el.mask('Save first');
912 _this.panel.el.mask('Save first');
914 _this.loaded = false;
915 _this.interestsCol.hide();
917 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
919 if ( _this.data.id) {
920 _this.dialog.el.mask("Loading");
921 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
925 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
926 this.findField('is_draft').setValue(is_draft);
927 _this.page_type.setValue(_this.data.page_type_id);
928 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
930 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
931 _this.interestsCol.show();
934 _this.form.showHide();
937 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
938 catlabel.dom.innerHTML = 'Category';
939 if(_this.data.page_type_id_name == 'category'){
940 catlabel.dom.innerHTML = 'Parent Category';
945 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
946 catlabel.dom.innerHTML = 'Parent page';
947 if(_this.data.page_type_id_name == 'category'){
948 catlabel.dom.innerHTML = 'Parent';
954 if(_this.data._is_copy){
955 _this.form.is_copy();
961 if (action.type == 'load') {
963 //_this.data = action.result.data;
965 var d = action.result.data;
967 _this.dialog.el.unmask();
968 _this.grid.getDataSource().load();
970 _this.trform.reset();
971 _this.trform1.reset();
972 _this.trform2.reset();
973 _this.trform3.reset();
975 _this.trform.addForm(_this.trform1);
976 _this.trform.addForm(_this.trform2);
978 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
979 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
980 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
981 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
982 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
985 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
986 catlabel.dom.innerHTML = 'Category';
988 if(_this.data.page_type_id_name == 'category'){
989 catlabel.dom.innerHTML = 'Parent Category';
993 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
994 catlabel.dom.innerHTML = 'Parent page';
995 if(_this.data.page_type_id_name == 'category'){
996 catlabel.dom.innerHTML = 'Parent';
999 // better if this was not here... - not sure which project uses it?
1001 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
1002 _this.interestsCol.show();
1005 if(typeof(d['interests']) != 'undefined'){
1006 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1009 if(typeof(d['categories']) != 'undefined'){
1010 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1013 if(typeof(d['page_classes']) != 'undefined'){
1014 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1017 _this.trpanel.el.unmask();
1018 _this.panel.el.unmask();
1021 _this.cpanel.el.dom.scrollTop = 0;
1023 // fix messed up scroll.
1024 _this.dialog.layout.el.dom.scrollTop = 0;
1028 if (action.type =='submit') {
1030 _this.dialog.el.unmask();
1032 _this.dialog.getLayout().getRegion('west').collapse();
1035 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1039 _this.dialog.hide();
1042 if (_this.callback) {
1043 _this.callback.call(_this, action.result.data);
1049 actionfailed : function (_self, action)
1051 _this.dialog.el.unmask();
1052 Pman.standardActionFailed(_self, action);
1054 rendered : function (_self)
1060 '|xns' : 'Roo.form',
1067 '|xns' : 'Roo.form',
1072 labelAlign : 'right',
1074 style : 'height:30px;overflow:hidden',
1077 '|xns' : 'Roo.form',
1081 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1090 style : 'height:30px;overflow:hidden',
1093 '|xns' : 'Roo.form',
1098 displayField : 'display_name',
1100 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1101 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1102 forceSelection : true,
1103 hiddenName : 'page_type_id',
1105 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1107 name : 'page_type_id_display_name',
1109 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1110 selectOnFocus : true,
1111 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1112 triggerAction : 'all',
1116 render : function (_self)
1118 _this.page_type = _self;
1120 select : function (combo, record, index)
1122 // _this.grid.footer.onClick('first');
1123 var page_type_name = record.data.name;
1124 _this.form.findField('page_type_id_name').setValue(page_type_name);
1125 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1126 _this.form.findField('is_attachment').setValue(0);
1130 _this.form.showHide.defer(100, _this.form);
1136 '|xns' : 'Roo.form',
1140 sortInfo : { direction : 'ASC', field: 'seqid' },
1142 beforeload : function (_self, o){
1143 o.params = o.params || {};
1145 o.params.etype = 'cms_page_type';
1149 '|xns' : 'Roo.data',
1151 xtype : 'HttpProxy',
1153 url : baseURL + '/Roo/core_enum.php',
1158 xtype : 'JsonReader',
1159 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1162 totalProperty : 'total',
1171 style : 'padding-left: -70px;',
1174 '|xns' : 'Roo.form',
1177 xtype : 'NumberField',
1178 decimalPrecision : 0,
1179 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1194 labelAlign : 'right',
1196 style : 'height:30px;overflow:hidden',
1199 '|xns' : 'Roo.form',
1203 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1212 style : 'height:30px;overflow:hidden',
1215 '|xns' : 'Roo.form',
1219 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1220 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1228 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1230 name : 'has_extended',
1233 check : function (_self, checked)
1238 _this.form.showHide();
1239 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1250 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1252 name : 'is_attachment',
1255 check : function (_self, checked)
1259 _this.form.showHide.defer(100, _this.form);
1273 displayField : 'name',
1275 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1276 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1277 forceSelection : true,
1278 hiddenName : 'author_id',
1280 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1282 name : 'author_id_name',
1284 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1285 queryParam : 'query[name]',
1286 selectOnFocus : true,
1287 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1288 triggerAction : 'all',
1293 '|xns' : 'Roo.form',
1297 sortInfo : { direction : 'ASC', field: 'name' },
1299 beforeload : function (_self, o){
1300 o.params = o.params || {};
1302 o.params.active = 1;
1303 o.params['query[is_owner]'] = 1;
1307 '|xns' : 'Roo.data',
1309 xtype : 'HttpProxy',
1311 url : baseURL + '/Roo/core_person',
1316 xtype : 'JsonReader',
1317 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1320 totalProperty : 'total',
1327 xtype : 'ComboBoxArray',
1328 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1329 hiddenName : 'category',
1330 name : 'category_name',
1333 '|xns' : 'Roo.form',
1338 displayField : 'display_fullpath',
1340 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1341 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1342 forceSelection : true,
1346 queryParam : 'search[name]',
1347 selectOnFocus : true,
1348 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1349 triggerAction : 'all',
1353 '|xns' : 'Roo.form',
1357 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1359 beforeload : function (_self, o){
1360 o.params = o.params || {};
1362 o.params.page_type_id_name= 'CATEGORY';
1364 o.params._with_fullpath = 1;
1368 '|xns' : 'Roo.data',
1370 xtype : 'HttpProxy',
1372 url : baseURL + '/Roo/cms_page.php',
1377 xtype : 'JsonReader',
1379 {"name":"id","type":"int"},
1380 {"name":"name","type":"string"},
1381 {"name":"display_name","type":"string"}
1385 totalProperty : 'total',
1396 displayField : 'page_link',
1398 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1399 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1400 forceSelection : true,
1401 hiddenName : 'parent_id',
1403 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1405 name : 'parent_id_title',
1407 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1408 selectOnFocus : true,
1409 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1410 triggerAction : 'all',
1415 select : function (combo, record, index)
1417 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1418 if (page_type_name == 'page') { // page
1421 // do not default to put 'Home' at the beginning.
1422 if (!record || !(record.data.parent_id *1)) {
1425 var pl = _this.form.findField('page_link');
1426 var lk = pl.getValue();
1427 var new_link = record.data.page_link + '/';
1429 new_link += lk.split('/').pop();
1431 pl.setValue(new_link);
1436 '|xns' : 'Roo.form',
1440 sortInfo : { field: 'page_link', direction: 'ASC' },
1442 beforeload : function (_self, options)
1444 options.params['search[page_link_no_empty]'] =1;
1446 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1447 options.params._page_type = 'page,element';
1449 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1452 var id = _this.form.findField('id').getValue() * 1;
1455 options.params['!id'] = id;
1460 options.params.is_element = 0;
1461 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1462 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1467 '|xns' : 'Roo.data',
1469 xtype : 'HttpProxy',
1471 url : baseURL + '/Roo/cms_page.php',
1476 xtype : 'JsonReader',
1478 { name: 'id', type: 'int' },
1484 totalProperty : 'total',
1494 '|xns' : 'Roo.form',
1497 xtype : 'DateField',
1498 altFormats : 'Y-m-d H:i:s',
1499 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1507 xtype : 'TextField',
1508 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1509 name : 'to_replace_id',
1517 xtype : 'TextField',
1518 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1522 keyup : function (_self, e)
1524 if (_this.page_type.getRawValue() == 'Category') {
1526 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1535 xtype : 'TextField',
1536 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1543 xtype : 'TextField',
1544 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1545 name : 'target_url',
1554 displayField : 'template_clean',
1556 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1557 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1558 forceSelection : true,
1559 hiddenName : 'template_id',
1561 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1563 name : 'template_id_template_clean',
1565 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1566 selectOnFocus : true,
1567 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1568 triggerAction : 'all',
1573 '|xns' : 'Roo.form',
1577 sortInfo : { field: 'template', direction: 'ASC' },
1579 beforeload : function (_self, options)
1582 options.params._rescan = 1;
1583 options.params._clean_name = 1;
1584 // options.params.lang = 'en';
1585 options.params['!template[0]'] = 'master.html';
1586 //options.params['!template[1]'] = 'index.html';
1590 '|xns' : 'Roo.data',
1592 xtype : 'HttpProxy',
1594 url : baseURL + '/Roo/Cms_template',
1599 xtype : 'JsonReader',
1601 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1605 totalProperty : 'total',
1615 displayField : 'name',
1617 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1618 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1619 forceSelection : true,
1620 hiddenName : 'element_id',
1622 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1624 name : 'element_id_name',
1626 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1627 selectOnFocus : true,
1628 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1629 triggerAction : 'all',
1634 '|xns' : 'Roo.form',
1638 sortInfo : { field: 'name', direction: 'ASC' },
1640 beforeload : function (_self, options)
1642 var par = _this.form.findField('parent_id').getValue() * 1;
1644 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1648 options.params._cms_page_id = par;
1652 '|xns' : 'Roo.data',
1654 xtype : 'HttpProxy',
1656 url : baseURL + '/Roo/Cms_template_element',
1661 xtype : 'JsonReader',
1663 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1667 totalProperty : 'total',
1677 displayField : 'page_link',
1679 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1680 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1681 forceSelection : true,
1682 hiddenName : 'menu_page_id',
1684 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1686 name : 'menu_page_id_page_link',
1688 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1689 selectOnFocus : true,
1690 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>',
1691 triggerAction : 'all',
1696 '|xns' : 'Roo.form',
1700 sortInfo : { field: 'title', direction: 'ASC' },
1702 beforeload : function (_self, options)
1704 options.params = options.params || {};
1706 options.params['search[page_link_no_empty]'] =1;
1708 options.params['page_type_id_name[0]'] = 'page';
1709 options.params['page_type_id_name[1]'] = 'blog';
1711 options.params.is_element = 0;
1712 options.params.is_menuitem = 0;
1717 '|xns' : 'Roo.data',
1719 xtype : 'HttpProxy',
1721 url : baseURL + '/Roo/cms_page.php',
1726 xtype : 'JsonReader',
1741 "name":"page_type_id_display_name",
1747 totalProperty : 'total',
1754 xtype : 'ComboBoxArray',
1755 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1756 hiddenName : 'page_cls',
1757 name : 'page_cls_name',
1760 '|xns' : 'Roo.form',
1765 displayField : 'display_name',
1767 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1768 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1769 forceSelection : true,
1772 queryParam : 'query[search]',
1773 selectOnFocus : true,
1774 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1775 triggerAction : 'all',
1776 valueField : 'name',
1779 '|xns' : 'Roo.form',
1783 sortInfo : { direction : 'ASC', field: 'seqid' },
1785 beforeload : function (_self, o){
1786 o.params = o.params || {};
1788 o.params.etype = 'cms_page_class';
1792 '|xns' : 'Roo.data',
1794 xtype : 'HttpProxy',
1796 url : baseURL + '/Roo/core_enum.php',
1801 xtype : 'JsonReader',
1803 {"name":"id","type":"int"},
1804 {"name":"name","type":"string"},
1805 {"name":"display_name","type":"string"}
1809 totalProperty : 'total',
1823 '|xns' : 'Roo.form',
1829 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1830 style : 'width: 165px;',
1832 '|xns' : 'Roo.form',
1835 xtype : 'DisplayField',
1837 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1838 name : 'primary_image_id',
1839 style : 'border: 1px solid #ccc;',
1840 valueRenderer : function(v) {
1842 if (!v || v * 1 < 1) {
1843 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1846 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1859 render : function (_self)
1861 _this.interestsCol = _self;
1865 '|xns' : 'Roo.form',
1868 xtype : 'ComboBoxArray',
1869 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1870 hiddenName : 'interest',
1871 name : 'interest_name',
1874 render : function (_self)
1876 _this.interests = _self;
1878 _self.combo.addicon.setStyle( {
1879 position : 'absolute',
1888 '|xns' : 'Roo.form',
1893 displayField : 'display_name',
1895 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1896 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1897 forceSelection : true,
1900 queryParam : 'query[name]',
1901 selectOnFocus : true,
1902 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1903 triggerAction : 'all',
1907 '|xns' : 'Roo.form',
1911 sortInfo : { direction : 'ASC', field: 'name' },
1913 beforeload : function (_self, o){
1914 o.params = o.params || {};
1915 o.params.etype = 'crm_interest';
1919 '|xns' : 'Roo.data',
1921 xtype : 'HttpProxy',
1923 url : baseURL + '/Roo/Core_enum.php',
1928 xtype : 'JsonReader',
1930 {"name":"id","type":"int"},
1931 {"name":"name","type":"string"},
1932 {"name":"display_name","type":"string"}
1936 totalProperty : 'total',
1953 name : 'is_system_page',
1959 name : 'is_menuitem',
1965 name : 'page_type_id_name',
1972 render : function (_self)
1974 _this.user_defined_fields = _self;
1985 xtype : 'ContentPanel',
1987 fitContainer : true,
1990 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1999 url : baseURL + '/Roo/cms_page.php',
2001 rendered : function (form)
2007 '|xns' : 'Roo.form',
2013 '|xns' : 'Roo.form',
2016 xtype : 'HtmlEditor',
2017 autosave : function() {
2019 var body = _this.form1.findField('body');
2021 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2022 Roo.log('body not dirty');
2026 Roo.log('body dirty, auto save!');
2028 body.fireEvent('autosave', body);
2032 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2036 white : [ 'iframe' ],
2039 autosave : function (_self)
2041 Roo.log('autosave');
2043 var id = _this.form.findField('id').getValue() * 1;
2045 if(!_self.editorcore.sourceEditMode){
2052 url : baseURL + '/Roo/Events.php',
2056 action : 'AUTOSAVE',
2057 on_id : (id > 0) ? id : 0,
2058 on_table : 'cms_page',
2060 source: _self.getValue()
2062 success : function() {
2063 _self.originalValue = _self.getValue();
2066 failure : function()
2068 //Roo.MessageBox.alert("Error", "autosave failed");
2069 Roo.log('body autosave failed?!');
2074 savedpreview : function (_self)
2076 Roo.log('saved preview');
2078 var id = _this.form.findField('id').getValue() * 1;
2080 var successFn = function(res){
2081 return res.data.POST.source;
2085 action : 'AUTOSAVE',
2087 on_id : (id < 1) ? 0 : id,
2088 on_table : 'cms_page',
2089 successFn : successFn
2093 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2094 _self.setValue(res);
2095 _self.originalValue = res;
2098 stylesheetsclick : function (_self)
2100 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2101 _this.dialog.setStylesheets();
2107 '|xns' : 'Roo.form',
2110 xtype : 'ToolbarStandard',
2111 xns : Roo.form.HtmlEditor,
2112 '|xns' : 'Roo.form.HtmlEditor',
2117 displayField : 'name',
2119 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2120 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2121 forceSelection : true,
2123 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2126 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2127 queryParam : 'search',
2128 selectOnFocus : true,
2129 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>',
2130 triggerAction : 'all',
2135 beforequery : function (combo, query, forceAll, cancel, e)
2138 var id = _this.form.findField('id').getValue() * 1;
2140 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2144 render : function (_self)
2146 _this.bodyimgselect = _self;
2148 select : function (combo, record, index)
2155 var editor = _this.form.findField('body').editorcore;
2157 var curnode = editor.getSelectedNode();
2159 if (curnode && curnode.tagName == 'IMG') {
2160 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2161 baseURL, record.data.id, record.data.filename
2163 // note -forces an update... hopefully...
2164 editor.owner.fireEvent('editorevent', editor, false);
2167 editor.insertAtCursor(
2168 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2169 baseURL, record.data.id, record.data.filename
2178 '|xns' : 'Roo.form',
2182 sortInfo : { direction : 'ASC', field: 'id' },
2184 beforeload : function (_self, o){
2185 o.params = o.params || {};
2187 var id = _this.form.findField('id').getValue() * 1;
2189 Roo.MessageBox.alert("Error", "Save press release first");
2193 o.params.ontable = 'cms_page';
2194 // o.params.imgtype = 'PressRelease';
2195 //o.params['query[imagesize]'] = '150x150';
2200 '|xns' : 'Roo.data',
2202 xtype : 'HttpProxy',
2204 url : baseURL + '/Roo/Images.php',
2209 xtype : 'JsonReader',
2210 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2213 totalProperty : 'total',
2222 displayField : 'page_link',
2224 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2225 forceSelection : true,
2226 hiddenName : 'add_link_id',
2228 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2232 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2233 selectOnFocus : true,
2234 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2235 triggerAction : 'all',
2240 select : function (combo, record, index)
2246 var editor = _this.form.findField('body');
2247 editor.editorcore.insertAtCursor(
2248 String.format('<a href="#page-{0}">{1}</a>',
2249 record.data.page_link, record.data.title
2257 '|xns' : 'Roo.form',
2261 sortInfo : { field: 'page_link', direction: 'ASC' },
2263 beforeload : function (_self, options)
2265 options.params['search[page_link_no_empty]'] =1;
2267 options.params.is_element = 0;
2268 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2273 '|xns' : 'Roo.data',
2275 xtype : 'HttpProxy',
2277 url : baseURL + '/Roo/cms_page.php',
2282 xtype : 'JsonReader',
2284 { name: 'id', type: 'int' },
2290 totalProperty : 'total',
2297 xtype : 'Separator',
2299 '|xns' : 'Roo.Toolbar'
2303 cls : 'x-init-enable',
2304 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2306 click : function (_self, e)
2308 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2312 '|xns' : 'Roo.Toolbar'
2317 xtype : 'ToolbarContext',
2318 xns : Roo.form.HtmlEditor,
2319 '|xns' : 'Roo.form.HtmlEditor'
2330 xtype : 'ContentPanel',
2332 fitContainer : true,
2335 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2344 url : baseURL + '/Roo/cms_page.php',
2346 rendered : function (form)
2352 '|xns' : 'Roo.form',
2358 '|xns' : 'Roo.form',
2361 xtype : 'HtmlEditor',
2362 autosave : function() {
2364 var extended = _this.form2.findField('extended');
2366 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2367 Roo.log('extend not dirty');
2372 Roo.log('extend dirty, auto save!');
2374 extended.fireEvent('autosave', extended);
2376 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2380 white : [ 'iframe' ],
2383 autosave : function (_self)
2385 var id = _this.form.findField('id').getValue() * 1;
2388 if(!_self.editorcore.sourceEditMode){
2395 url : baseURL + '/Roo/Events.php',
2399 action : 'AUTOSAVE',
2400 on_id : (id > 0) ? id : 0,
2401 on_table : 'cms_page',
2402 remarks : 'EXTENDED',
2403 source: _self.getValue()
2405 success : function() {
2406 _self.originalValue = _self.getValue();
2409 failure : function()
2411 //Roo.MessageBox.alert("Error", "autosave failed");
2412 Roo.log('extended autosave failed?!');
2416 savedpreview : function (_self)
2418 var id = _this.form.findField('id').getValue() * 1;
2420 var successFn = function(res){
2421 return res.data.POST.source;
2425 action : 'AUTOSAVE',
2426 remarks : 'EXTENDED',
2427 on_id : (id < 1) ? 0 : id,
2428 on_table : 'cms_page',
2429 successFn : successFn
2433 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2434 _self.setValue(res);
2435 _self.originalValue = res;
2438 stylesheetsclick : function (_self)
2440 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2441 _this.dialog.setStylesheets();
2447 '|xns' : 'Roo.form',
2450 xtype : 'ToolbarStandard',
2451 xns : Roo.form.HtmlEditor,
2452 '|xns' : 'Roo.form.HtmlEditor',
2457 displayField : 'name',
2459 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2460 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2461 forceSelection : true,
2463 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2466 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2467 selectOnFocus : true,
2468 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2469 triggerAction : 'all',
2474 beforequery : function (combo, query, forceAll, cancel, e)
2477 var id = _this.form.findField('id').getValue() * 1;
2479 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2483 render : function (_self)
2485 _this.extendimgselect = _self;
2487 select : function (combo, record, index)
2494 var editor = _this.form.findField('extended').editorcore;
2496 var curnode = editor.getSelectedNode();
2498 if (curnode && curnode.tagName == 'IMG') {
2499 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2500 baseURL, record.data.id, record.data.filename
2502 // note -forces an update... hopefully...
2503 editor.owner.fireEvent('editorevent', editor, false);
2506 editor.insertAtCursor(
2507 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2508 baseURL, record.data.id, record.data.filename
2517 '|xns' : 'Roo.form',
2521 sortInfo : { direction : 'ASC', field: 'id' },
2523 beforeload : function (_self, o){
2524 o.params = o.params || {};
2526 var id = _this.form.findField('id').getValue() * 1;
2528 Roo.MessageBox.alert("Error", "Save press release first");
2532 o.params.ontable = 'cms_page';
2533 // o.params.imgtype = 'PressRelease';
2534 //o.params['query[imagesize]'] = '150x150';
2539 '|xns' : 'Roo.data',
2541 xtype : 'HttpProxy',
2543 url : baseURL + '/Roo/Images.php',
2548 xtype : 'JsonReader',
2549 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2552 totalProperty : 'total',
2561 displayField : 'page_link',
2563 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2564 forceSelection : true,
2565 hiddenName : 'add_link_id',
2567 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2571 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2572 selectOnFocus : true,
2573 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2574 triggerAction : 'all',
2579 select : function (combo, record, index)
2585 var editor = _this.form.findField('body');
2586 editor.editorcore.insertAtCursor(
2587 String.format('<a href="#page-{0}">{1}</a>',
2588 record.data.page_link, record.data.title
2596 '|xns' : 'Roo.form',
2600 sortInfo : { field: 'page_link', direction: 'ASC' },
2602 beforeload : function (_self, options)
2604 options.params['search[page_link_no_empty]'] =1;
2606 options.params.is_element = 0;
2607 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2612 '|xns' : 'Roo.data',
2614 xtype : 'HttpProxy',
2616 url : baseURL + '/Roo/cms_page.php',
2621 xtype : 'JsonReader',
2623 { name: 'id', type: 'int' },
2629 totalProperty : 'total',
2636 xtype : 'Separator',
2638 '|xns' : 'Roo.Toolbar'
2642 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2644 click : function (_self, e)
2646 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2650 '|xns' : 'Roo.Toolbar'
2655 xtype : 'ToolbarContext',
2656 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2657 xns : Roo.form.HtmlEditor,
2658 '|xns' : 'Roo.form.HtmlEditor'
2669 xtype : 'ContentPanel',
2671 fitContainer : true,
2674 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2683 url : baseURL + '/Roo/cms_page.php',
2685 rendered : function (form)
2691 '|xns' : 'Roo.form',
2697 '|xns' : 'Roo.form',
2701 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2715 xtype : 'ContentPanel',
2717 fitContainer : true,
2720 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2729 url : baseURL + '/Roo/cms_page.php',
2731 rendered : function (form)
2737 '|xns' : 'Roo.form',
2742 '|xns' : 'Roo.form',
2746 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2755 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2757 name : 'descriptions',
2772 xtype : 'GridPanel',
2774 fitContainer : true,
2777 tableName : 'Images',
2778 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2780 activate : function() {
2783 _this.grid.footer.onClick('first');
2790 xtype : 'EditorGrid',
2791 autoExpandColumn : 'title',
2795 render : function() {
2797 //_this.dialog = Pman.Dialog.FILL_IN
2798 if (_this.panel.active) {
2799 //this.footer.onClick('first');
2802 rowdblclick : function (_self, rowIndex, e)
2804 var rd = _this.grid.getDataSource().getAt(rowIndex);
2805 var id = rd.data.id;
2806 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2807 _this.form.findField('contents').execCmd('insertimage', url);
2812 '|xns' : 'Roo.grid',
2820 cls : 'x-btn-text-icon',
2821 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2822 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2826 var id = _this.form.findField('id').getValue() * 1;
2832 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2833 _this.grid.ds.load({});
2843 cls : 'x-btn-text-icon',
2844 icon : rootURL + '/Pman/templates/images/trash.gif',
2845 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2849 var selection = _this.grid.getSelectionModel().getSelectedCell();
2850 var sn = _this.grid.ds.getAt(selection[0]);
2851 if (!sn || isNaN(sn.id *1)) {
2852 Roo.MessageBox.alert("Error", "Select a image");
2855 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2861 url : baseURL + '/Roo/Images.php',
2866 success : function()
2868 Roo.log('Got Success!!');
2869 _this.grid.ds.load({});
2883 beforeload : function (_self, o)
2885 var id = _this.form.findField('id').getValue() * 1;
2891 o.params = o.params || {};
2892 o.params.limit = 9999;
2894 o.params.ontable = 'cms_page';
2896 update : function (_self, rec, operation)
2900 url : baseURL+'/Roo/Images.php',
2903 success: function(res)
2905 Roo.log("GOT success");
2906 // update the data...
2907 _this.grid.ds.load({});
2909 failure : function(res)
2911 Roo.MessageBox.alert('Error', res.errorMsg);
2912 _this.grid.ds.load({});
2920 '|xns' : 'Roo.data',
2922 xtype : 'HttpProxy',
2924 url : baseURL + '/Roo/Images.php',
2929 xtype : 'JsonReader',
2964 'name': 'displayorder',
2972 'name': 'parent_image_id',
2978 'dateFormat': 'Y-m-d'
2997 'name': 'parent_image_id_id',
3001 'name': 'parent_image_id_filename',
3005 'name': 'parent_image_id_ontable',
3009 'name': 'parent_image_id_onid',
3013 'name': 'parent_image_id_mimetype',
3017 'name': 'parent_image_id_width',
3021 'name': 'parent_image_id_height',
3025 'name': 'parent_image_id_filesize',
3029 'name': 'parent_image_id_displayorder',
3033 'name': 'parent_image_id_language',
3037 'name': 'parent_image_id_parent_image_id',
3041 'name': 'parent_image_id_created',
3045 'name': 'parent_image_id_imgtype',
3049 'name': 'parent_image_id_linkurl',
3053 'name': 'parent_image_id_descript',
3057 'name': 'parent_image_id_title',
3063 totalProperty : 'total',
3070 xtype : 'ColumnModel',
3072 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3073 renderer : function(v,x,r) {
3074 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3082 xtype : 'ColumnModel',
3083 dataIndex : 'filename',
3084 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3085 renderer : function(v) { return String.format('{0}', v); },
3091 xtype : 'ColumnModel',
3092 dataIndex : 'displayorder',
3093 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3094 renderer : function(v) { return String.format('{0}', v); },
3097 '|xns' : 'Roo.grid',
3099 xtype : 'GridEditor',
3101 '|xns' : 'Roo.grid',
3103 xtype : 'NumberField',
3104 decimalPrecision : 0,
3106 focus : function (_self)
3108 if (this.value == 0) {
3109 this.el.dom.value = '';
3119 xtype : 'ColumnModel',
3120 dataIndex : 'title',
3121 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3122 renderer : function(v) { return String.format('{0}', v); },
3125 '|xns' : 'Roo.grid',
3127 xtype : 'GridEditor',
3129 '|xns' : 'Roo.grid',
3131 xtype : 'TextField',
3138 xtype : 'ColumnModel',
3139 dataIndex : 'linkurl',
3140 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3141 renderer : function(v)
3143 return String.format('{0}', (v) ? v : '');
3147 '|xns' : 'Roo.grid',
3149 xtype : 'GridEditor',
3151 '|xns' : 'Roo.grid',
3153 xtype : 'TextField',
3163 xtype : 'NestedLayoutPanel',
3165 fitContainer : true,
3169 render : function (_self)
3171 _this.westLayoutPanel = this;
3178 xtype : 'BorderLayout',
3182 xtype : 'LayoutRegion',
3183 tabPosition : 'top',
3188 xtype : 'LayoutRegion',
3191 tabPosition : 'top',
3197 xtype : 'ContentPanel',
3202 render : function (_self)
3204 _this.trpanel = _self;
3206 resize : function (_self, width, height)
3208 Roo.log('resize called');
3210 var ew = Math.max(250, width - 10);
3211 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3214 if (!_this.trform) {
3218 var bd = _this.trform1.findField('body');
3223 // since render delays resize..
3224 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3225 // _this.trbodycol.el.setWidth(bd.width+20);
3227 var bd = _this.trform2.findField('extended');
3231 // since render delays resize..
3232 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3233 // _this.trextendcol.el.setWidth(bd.width+20);
3243 labelAlign : 'right',
3246 showHide : function() {
3248 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3249 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3250 var has_lang = _this.trform.findField('language').getValue().length;
3252 _this.westLayoutPanel.getLayout().getRegion('south').show();
3253 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3254 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3255 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3258 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3261 if(!has_extended && has_lang){
3262 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3263 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3271 var el = _this.trform.findField(k);
3272 el.actionMode = 'fieldEl';
3274 Roo.log("show: " + k);
3277 Roo.log("hide: " + k);
3282 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3285 if(typeof(_this.trform.editors) == 'undefined'){
3286 _this.trform.editors = {
3287 body : _this.trform1.findField('body').wrap.isVisible(),
3288 extended : _this.trform2.findField('extended').wrap.isVisible()
3290 if(_this.trform.editors.body){
3291 setInterval(_this.trform1.findField('body').autosave, 60000);
3294 if(_this.trform.editors.extended){
3295 setInterval(_this.trform2.findField('extended').autosave, 60000);
3299 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3300 setInterval(_this.trform1.findField('body').autosave, 60000);
3301 _this.trform.editors.body = true;
3304 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3305 setInterval(_this.trform2.findField('extended').autosave, 60000);
3306 _this.trform.editors.extended = true;
3311 style : 'margin: 5px',
3312 trackResetOnLoad : true,
3313 url : baseURL + '/Roo/cms_page.php',
3315 actioncomplete : function (_self, action)
3317 if (action.type =='submit') {
3321 if (action.type == 'setdata') {
3322 _this.trform.addForm(_this.trform1);
3323 _this.trform.addForm(_this.trform2);
3324 _this.trform.addForm(_this.trform3);
3326 if ( _this.data.id) {
3328 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3330 this.trpanel.el.mask("save first");
3337 if (action.type == 'load') {
3338 // _this.dialog.el.unmask();
3341 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3342 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3343 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3344 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3349 actionfailed : function (_self, action)
3351 _this.dialog.el.unmask();
3353 Pman.standardActionFailed(_self, action);
3355 rendered : function (_self)
3357 _this.trform = _self;
3361 '|xns' : 'Roo.form',
3368 '|xns' : 'Roo.form',
3375 '|xns' : 'Roo.form',
3380 displayField : 'language_name',
3382 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3383 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3384 forceSelection : true,
3385 hiddenName : 'language',
3387 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3389 name : 'language_name',
3391 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3392 selectOnFocus : true,
3393 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3394 triggerAction : 'all',
3396 valueField : 'language',
3398 add : function (combo)
3400 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3403 _this.trform.reset();
3404 _this.trform1.reset();
3405 _this.trform2.reset();
3407 combo.setValue(res.lang);
3408 combo.el.dom.value = res.lang_name;
3411 _this.trform.showHide();
3412 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3417 render : function (_self)
3419 _this.language = _self;
3421 select : function (combo, record, index)
3424 _this.trform.showHide();
3425 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3432 'lookup[language]' : record.data.language,
3433 'lookup[translation_of_id]' : _this.data.id,
3440 '|xns' : 'Roo.form',
3444 sortInfo : { direction : 'ASC', field: 'language' },
3446 beforeload : function (_self, o){
3447 o.params = o.params || {};
3449 o.params._distinct = 'language';
3450 o.params._columns ='language_name,language';
3451 o.params._with_name = true;
3453 if(_this.form.findField('id').getValue()*1 > 0){
3454 o.params.translation_of_id = _this.form.findField('id').getValue();
3460 '|xns' : 'Roo.data',
3462 xtype : 'HttpProxy',
3464 url : baseURL + '/Roo/Cms_page.php',
3469 xtype : 'JsonReader',
3470 fields : [{"name":"language","type":"string"}],
3473 totalProperty : 'total',
3481 style : 'padding-top:12px;padding-left:30px;float:left',
3484 render : function (_self)
3486 _this.updateRow = _self;
3490 '|xns' : 'Roo.form',
3494 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3498 // _this.dialog.el.mask("Saving");
3499 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3500 _this.trform1.findField('body').syncValue();
3501 _this.trform2.findField('extended').syncValue();
3503 _this.trform1.findField('body').pushValue();
3504 _this.trform2.findField('extended').pushValue();
3507 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3508 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3509 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3510 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3511 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3513 if(_this.trform.findField('element_id').getValue()*1 > 0){
3514 _this.trform.findField('is_element').setValue(1);
3517 _this.trform.doAction("submit");
3528 xtype : 'TextField',
3529 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3545 name : 'element_id',
3551 name : 'menu_page_id',
3557 name : 'is_menuitem',
3563 name : 'is_element',
3570 name : 'translation_of_id',
3585 xtype : 'ContentPanel',
3587 fitContainer : true,
3590 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3599 url : baseURL + '/Roo/cms_page.php',
3601 rendered : function (form)
3603 _this.trform1 = form;
3607 '|xns' : 'Roo.form',
3613 '|xns' : 'Roo.form',
3616 xtype : 'HtmlEditor',
3617 autosave : function() {
3619 var body = _this.trform1.findField('body');
3621 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3622 Roo.log('tr body not dirty');
3626 Roo.log('tr body dirty, auto save!');
3628 body.fireEvent('autosave', body);
3630 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3634 white : [ 'iframe' ],
3636 autosave : function (_self)
3638 var id = _this.trform.findField('id').getValue() * 1;
3641 if(!_self.editorcore.sourceEditMode){
3648 url : baseURL + '/Roo/Events.php',
3652 action : 'AUTOSAVE',
3653 on_id : (id > 0) ? id : 0,
3654 on_table : 'cms_page',
3656 source: _self.getValue()
3658 success : function() {
3659 _self.originalValue = _self.getValue();
3662 failure : function()
3664 //Roo.MessageBox.alert("Error", "autosave failed");
3665 Roo.log('tr body autosave failed?!');
3669 savedpreview : function (_self)
3671 var id = _this.trform.findField('id').getValue() * 1;
3673 var successFn = function(res){
3674 return res.data.POST.source;
3678 action : 'AUTOSAVE',
3680 on_id : (id < 1) ? 0 : id,
3681 on_table : 'cms_page',
3682 successFn : successFn
3686 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3687 _self.setValue(res);
3688 _self.originalValue = res;
3691 stylesheetsclick : function (_self)
3693 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3694 _this.dialog.setStylesheets();
3700 '|xns' : 'Roo.form',
3703 xtype : 'ToolbarStandard',
3704 xns : Roo.form.HtmlEditor,
3705 '|xns' : 'Roo.form.HtmlEditor',
3710 displayField : 'name',
3712 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3713 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3714 forceSelection : true,
3716 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3719 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3720 selectOnFocus : true,
3721 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>',
3722 triggerAction : 'all',
3727 beforequery : function (combo, query, forceAll, cancel, e)
3730 var id = _this.form.findField('id').getValue() * 1;
3732 Roo.MessageBox.alert("Error", "Save press release first");
3736 render : function (_self)
3738 _this.trbodyimgselect = _self;
3740 select : function (combo, record, index)
3747 var editor = _this.trform.findField('body').editorcore;
3749 var curnode = editor.getSelectedNode();
3751 if (curnode && curnode.tagName == 'IMG') {
3752 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3753 baseURL, record.data.id, record.data.filename
3755 // note -forces an update... hopefully...
3756 editor.owner.fireEvent('editorevent', editor, false);
3759 editor.insertAtCursor(
3760 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3761 baseURL, record.data.id, record.data.filename
3770 '|xns' : 'Roo.form',
3774 sortInfo : { direction : 'ASC', field: 'id' },
3776 beforeload : function (_self, o){
3777 o.params = o.params || {};
3779 var id = _this.form.findField('id').getValue() * 1;
3781 Roo.MessageBox.alert("Error", "Save press release first");
3785 o.params.ontable = 'cms_page';
3786 // o.params.imgtype = 'PressRelease';
3787 //o.params['query[imagesize]'] = '150x150';
3792 '|xns' : 'Roo.data',
3794 xtype : 'HttpProxy',
3796 url : baseURL + '/Roo/Images.php',
3801 xtype : 'JsonReader',
3802 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3805 totalProperty : 'total',
3814 displayField : 'page_link',
3816 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3817 forceSelection : true,
3818 hiddenName : 'add_link_id',
3820 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3824 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3825 selectOnFocus : true,
3826 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3827 triggerAction : 'all',
3832 select : function (combo, record, index)
3838 var editor = _this.form.findField('body');
3839 editor.insertAtCursor(
3840 String.format('<a href="#page-{0}">{1}</a>',
3841 record.data.page_link, record.data.title
3849 '|xns' : 'Roo.form',
3853 sortInfo : { field: 'page_link', direction: 'ASC' },
3855 beforeload : function (_self, options)
3857 options.params['search[page_link_no_empty]'] =1;
3859 options.params.is_element = 0;
3860 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3865 '|xns' : 'Roo.data',
3867 xtype : 'HttpProxy',
3869 url : baseURL + '/Roo/cms_page.php',
3874 xtype : 'JsonReader',
3876 { name: 'id', type: 'int' },
3882 totalProperty : 'total',
3889 xtype : 'Separator',
3891 '|xns' : 'Roo.Toolbar'
3895 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3897 click : function (_self, e)
3899 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3903 '|xns' : 'Roo.Toolbar'
3908 xtype : 'ToolbarContext',
3909 xns : Roo.form.HtmlEditor,
3910 '|xns' : 'Roo.form.HtmlEditor'
3921 xtype : 'ContentPanel',
3923 fitContainer : true,
3926 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3935 url : baseURL + '/Roo/cms_page.php',
3937 rendered : function (form)
3939 _this.trform2 = form;
3943 '|xns' : 'Roo.form',
3949 '|xns' : 'Roo.form',
3952 xtype : 'HtmlEditor',
3953 autosave : function() {
3955 var extended = _this.trform2.findField('extended');
3957 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3958 Roo.log('tr extend not dirty');
3963 Roo.log('tr extend dirty, auto save!');
3965 extended.fireEvent('autosave', extended);
3969 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3973 white : [ 'iframe' ],
3975 autosave : function (_self)
3977 var id = _this.trform.findField('id').getValue() * 1;
3980 if(!_self.editorcore.sourceEditMode){
3988 url : baseURL + '/Roo/Events.php',
3992 action : 'AUTOSAVE',
3993 on_id : (id > 0) ? id : 0,
3994 on_table : 'cms_page',
3995 remarks : 'EXTENDED',
3996 source: _self.getValue()
3998 success : function() {
3999 _self.originalValue = _self.getValue();
4002 failure : function()
4004 //Roo.MessageBox.alert("Error", "autosave failed");
4005 Roo.log('tr extended autosave failed?!');
4009 savedpreview : function (_self)
4011 var id = _this.trform.findField('id').getValue() * 1;
4013 var successFn = function(res){
4014 return res.data.POST.source;
4018 action : 'AUTOSAVE',
4019 remarks : 'EXTENDED',
4020 on_id : (id < 1) ? 0 : id,
4021 on_table : 'cms_page',
4022 successFn : successFn
4026 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4027 _self.setValue(res);
4028 _self.originalValue = res;
4031 stylesheetsclick : function (_self)
4033 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4034 _this.dialog.setStylesheets();
4040 '|xns' : 'Roo.form',
4043 xtype : 'ToolbarStandard',
4044 xns : Roo.form.HtmlEditor,
4045 '|xns' : 'Roo.form.HtmlEditor',
4048 xtype : 'Separator',
4050 '|xns' : 'Roo.Toolbar'
4054 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4056 click : function (_self, e)
4058 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4062 '|xns' : 'Roo.Toolbar'
4067 xtype : 'ToolbarContext',
4068 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4069 xns : Roo.form.HtmlEditor,
4070 '|xns' : 'Roo.form.HtmlEditor'
4081 xtype : 'ContentPanel',
4083 fitContainer : true,
4086 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4095 url : baseURL + '/Roo/cms_page.php',
4097 rendered : function (form)
4099 _this.trform3 = form;
4103 '|xns' : 'Roo.form',
4108 '|xns' : 'Roo.form',
4112 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4121 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4123 name : 'descriptions',