1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CmsBlog = {
10 '2f26e35d61be90501e099089dc533638' :"Select Images",
11 'f3912172e6bf57f8979782f4a2342233' :"Appears in Block",
12 '95cb4f45ab7ff3984f25ab8668499020' :"Select Parent",
13 'c1df1da7a1ce305a3b60af9d5733ac1d' :"Contents",
14 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
15 'ebd9bec4d70abc789d439c1f136b0538' :"Layout",
16 '20bec77364d863100a1f9325873a8504' :"Select Page Type",
17 'a517747c3d12f99244ae598910d979c5' :"Author",
18 '31fde7b05ac8952dacf4af8a704074ec' :"Preview",
19 '779e2624ddf330fb05b51ae59faf212d' :"Select Status Type",
20 '5834d26e96dbae06029496e5b111dca2' :"Has Extended content?",
21 '6a5b847af3d97df722040debdbccfbed' :"Page Type",
22 '30d1a216420426fcbd43ca70acd4aa48' :"Select interests",
23 'f03ab16cd58372c77ba45a3d9a5a1cb9' :"Draft",
24 'cc6892c9705afcfa61c53698756ba51b' :"Page Class",
25 'e6b391a8d2c4d45902a23a8b6585703d' :"URL",
26 '03368e3c1eb4d2a9048775874301b19f' :"Select category",
27 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
28 '778551900655782c5c7827332b08cf3f' :"Save and close",
29 '77174410b72decfd0b259961f1f65a8f' :"Attributes:",
30 'b28a711cf7e94ec793ef926633997529' :"Seq",
31 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
32 '8a53accfc94c2500b00575ce0e0d786f' :"Primary Image",
33 '580b21aac58f1b73cece26e272cdfbee' :"Add Link",
34 '8bc84316c4078bf66723fd019616d920' :"Descriptions",
35 '83dad8107f9459efe2b4fabcf5b63108' :"Select Language",
36 '76729937a5eb6b0fd88c42581161facd' :"Select Category ",
37 '0b8d92bc19b720bb1065649535463409' :"Translations",
38 '14c21301c0faf9d5561b8a580be21a13' :"Select class",
39 'd41d8cd98f00b204e9800998ecf8427e' :"",
40 '867343577fa1f33caa632a19543bd252' :"Keywords",
41 '340c2ee497b85d5954b01c64de7f44f6' :"Select Person",
42 '69dd756ae9c23191a5bb9b61f0857432' :"Date to Publish",
43 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
44 '57e195426892c5515935f21d97228814' :"Extended Contents",
45 'd88aa1eee60ba140f07d5f81769cec74' :"<< Edit Translations",
46 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
47 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
48 'cfcd208495d565ef66e7dff9f98764da' :"0",
49 'd8e4d1f5e445107e505b2cf63a1fb65c' :"Extra CSS",
50 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
51 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
52 'c02bd0c22c290ae599ee2f3ff2023fd3' :"Manage Images / Attachments >>",
53 'b78a3223503896721cca1303f776159b' :"Title",
54 '39f64cc9436cacfbceda3b7bdeb8e24c' :"Styles (CSS)",
55 'e64df1d7c22b9638f084ce8a4aff3ff3' :"Target URL",
56 '98e93e8f7adfe14832db6caed713d849' :"Meta Tags",
57 'a240fa27925a635b08dc28c9e4f9216d' :"Order",
58 '287234a1ff35a314b5b6bc4e5828e745' :"Attributes",
59 '99e7707748ae048e17c5810fad119e0b' :"Select Page",
60 '06933067aafd48425d67bcb01bba5cb6' :"Update",
61 '8adedb6a6226807ba810215dd3b3c61b' :"Menu links to Page",
62 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' :"Select Section",
63 '2ad41a2ff4f0dac97d63aff331d5e6e7' :"Downloads first Attachment",
64 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
65 '76eb64a1725ee953c664e15c9213b2fd' :"Extended Content",
66 '1351017ac6423911223bc19a8cb7c653' :"Filename",
67 'c9cc8cce247e49bae79f15173ce97354' :"Save",
68 'e659b52eba1f0299b2d8ca3483919e72' :"Type:",
69 'c70952e4ab3806c049737cd7d2b8896b' :"Interests",
70 'aa6356b678bc4fc78253c9edf65bff03' :"Edit Page / Blog Entry",
71 'd52f80f80467bb575253a5a39ca016a7' :"Page link / Name / Order",
72 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images",
73 '30269022e9d8f51beaabb52e5d0de2b7' :"Parent",
74 'fb3f11443065d5f4d8303ad913db9680' :"Replaces (ignore)"
77 'seq_id_fieldLabel' : 'b28a711cf7e94ec793ef926633997529' /* Seq */ ,
78 'to_replace_id_fieldLabel' : 'fb3f11443065d5f4d8303ad913db9680' /* Replaces (ignore) */ ,
79 'template_id_template_clean_fieldLabel' : 'ebd9bec4d70abc789d439c1f136b0538' /* Layout */ ,
80 'page_cls_name_fieldLabel' : 'cc6892c9705afcfa61c53698756ba51b' /* Page Class */ ,
81 'language_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
82 'template_id_template_clean_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
83 'author_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
84 'page_type_id_display_name_fieldLabel' : '6a5b847af3d97df722040debdbccfbed' /* Page Type */ ,
85 'has_extended_boxLabel' : '5834d26e96dbae06029496e5b111dca2' /* Has Extended content? */ ,
86 'language_name_emptyText' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
87 'author_id_name_qtip' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
88 'menu_page_id_page_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
89 'published_fieldLabel' : '69dd756ae9c23191a5bb9b61f0857432' /* Date to Publish */ ,
90 'author_id_name_fieldLabel' : 'a517747c3d12f99244ae598910d979c5' /* Author */ ,
91 'element_id_name_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
92 'parent_id_title_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
93 'element_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
94 'author_id_name_emptyText' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
95 'is_attachment_boxLabel' : '2ad41a2ff4f0dac97d63aff331d5e6e7' /* Downloads first Attachment */ ,
96 'extra_css_fieldLabel' : '39f64cc9436cacfbceda3b7bdeb8e24c' /* Styles (CSS) */ ,
97 'template_id_template_clean_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
98 'parent_id_title_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
99 'is_draft_fieldLabel' : '287234a1ff35a314b5b6bc4e5828e745' /* Attributes */ ,
100 'add_link_emptyText' : '580b21aac58f1b73cece26e272cdfbee' /* Add Link */ ,
101 'keywords_fieldLabel' : '867343577fa1f33caa632a19543bd252' /* Keywords */ ,
102 'descriptions_fieldLabel' : '8bc84316c4078bf66723fd019616d920' /* Descriptions */ ,
103 'add_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
104 'menu_page_id_page_link_emptyText' : '99e7707748ae048e17c5810fad119e0b' /* Select Page */ ,
105 'element_id_name_fieldLabel' : 'f3912172e6bf57f8979782f4a2342233' /* Appears in Block */ ,
106 'is_element_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ ,
107 'target_url_fieldLabel' : 'e64df1d7c22b9638f084ce8a4aff3ff3' /* Target URL */ ,
108 'interest_name_fieldLabel' : 'c70952e4ab3806c049737cd7d2b8896b' /* Interests */ ,
109 'language_name_qtip' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
110 'page_type_id_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
111 'language_name_fieldLabel' : '83dad8107f9459efe2b4fabcf5b63108' /* Select Language */ ,
112 'element_id_name_emptyText' : 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' /* Select Section */ ,
113 'menu_page_id_page_link_fieldLabel' : '8adedb6a6226807ba810215dd3b3c61b' /* Menu links to Page */ ,
114 'page_type_id_display_name_emptyText' : '779e2624ddf330fb05b51ae59faf212d' /* Select Status Type */ ,
115 'template_id_template_clean_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
116 'menu_page_id_page_link_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
117 'extended_fieldLabel' : '57e195426892c5515935f21d97228814' /* Extended Contents */ ,
118 'add_link_qtip' : '76729937a5eb6b0fd88c42581161facd' /* Select Category */ ,
119 'category_name_fieldLabel' : '3adbdb3ac060038aa0e6e6c138ef9873' /* Category */ ,
120 'page_type_id_display_name_qtip' : '20bec77364d863100a1f9325873a8504' /* Select Page Type */ ,
121 'body_fieldLabel' : 'c1df1da7a1ce305a3b60af9d5733ac1d' /* Contents */ ,
122 'parent_id_title_emptyText' : '95cb4f45ab7ff3984f25ab8668499020' /* Select Parent */ ,
123 'title_fieldLabel' : 'b78a3223503896721cca1303f776159b' /* Title */ ,
124 'is_draft_boxLabel' : 'f03ab16cd58372c77ba45a3d9a5a1cb9' /* Draft */ ,
125 'page_link_fieldLabel' : 'd52f80f80467bb575253a5a39ca016a7' /* Page link / Name / Order */ ,
126 'parent_id_title_fieldLabel' : '30269022e9d8f51beaabb52e5d0de2b7' /* Parent */
132 show : function(data, cb)
140 this.dialog.show(this.data._el);
143 this.form.setValues(data);
144 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
152 this.dialog = Roo.factory({
153 xtype : 'LayoutDialog',
160 setStylesheets : function() {
163 sheets.push(rootURL + '/Pman/Cms/templates/undoreset.css');
165 if(typeof(uiConfig) !== 'undefined' && typeof(uiConfig.cms_css) != 'undefined'){
166 Roo.each(uiConfig.cms_css, function(v){
167 sheets.push(rootURL + v);
172 url : baseURL + '/Roo/Cms_page.php',
177 success : function(res) {
179 if(res.data._stylesheets.length){
180 var setting = res.data._stylesheets.split("\n");
182 Roo.each(setting, function(s){
183 sheets.push(s.replace('{rootURL}', rootURL));
188 _this.form1.findField('body').removeStylesheets();
189 _this.form2.findField('extended').removeStylesheets();
191 _this.form1.findField('body').setStylesheets(sheets);
192 _this.form2.findField('extended').setStylesheets(sheets);
194 _this.trform1.findField('body').removeStylesheets();
195 _this.trform2.findField('extended').removeStylesheets();
197 _this.trform1.findField('body').setStylesheets(sheets);
198 _this.trform2.findField('extended').setStylesheets(sheets);
203 title : _this._strings['aa6356b678bc4fc78253c9edf65bff03'] /* Edit Page / Blog Entry */,
206 show : function (_self)
208 // @see the contentpanel - center - resize handler.
210 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
212 var w = Roo.lib.Dom.getViewWidth();
213 var h = Roo.lib.Dom.getViewHeight();
214 this.resizeTo(w-50, h-50);
217 _this.centerLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
218 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
220 Pman.Cms.pageEditAddCustomFields();
223 _this.dialog.getLayout().getRegion('east').collapse();
224 _this.dialog.getLayout().getRegion('west').collapse();
225 Roo.log('running collapse!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
230 var ew = Math.max(250, w-150); // was 350?/ why?
231 //var eh = Math.max(250, h-350) ;
234 var bd = _this.form1.findField('body');
239 // since render delays resize..
240 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
241 //_this.bodycol.el.setWidth(bd.width+20);
243 var bd = _this.form2.findField('extended');
247 // since render delays resize..
248 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
249 // _this.extendcol.el.setWidth(bd.width+20);
251 var bd = _this.form3.findField('extra_css');
254 //_this.keywordscol.el.setWidth(ew+20);
257 // fix messed up scroll.
258 _this.dialog.layout.el.dom.scrollTop = 0;
266 xtype : 'LayoutRegion',
272 xtype : 'LayoutRegion',
274 collapsedTitle : 'Images / Attachments',
278 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
281 expanded : function (_self)
283 var id = _this.form.findField('id').getValue() * 1;
286 Roo.MessageBox.alert('Error', 'Save first');
291 var w = Roo.lib.Dom.getViewWidth();
292 var h = Roo.lib.Dom.getViewHeight();
294 _self.resizeTo.defer(110, _self,[ w-400, h] );
295 _this.dialog.getLayout().getRegion('west').collapse();
302 xtype : 'LayoutRegion',
304 collapsedTitle : 'Translations',
308 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
311 beforecollapse : function (_self)
313 if(!_this.trform || !_this.trform1 || !_this.trform2){
318 !_this.trform.isDirty() &&
319 !_this.trform1.isDirty() &&
320 !_this.trform2.isDirty() &&
321 !_this.trform3.isDirty()
326 Roo.MessageBox.confirm(
328 "Do you want to save the translation",
331 _self.collapse(true, true);
341 collapsed : function (_self)
343 if(_this.trform && _this.trform.isDirty()){
344 _this.trform.reset();
345 Roo.log('reset trform');
348 if(_this.trform1 && _this.trform1.isDirty()){
349 _this.trform1.reset();
350 Roo.log('reset trform1');
353 if(_this.trform2 && _this.trform2.isDirty()){
354 _this.trform2.reset();
355 Roo.log('reset trform2');
358 if(_this.trform3 && _this.trform3.isDirty()){
359 _this.trform3.reset();
360 Roo.log('reset trform3');
364 expanded : function (_self)
366 var id = _this.form.findField('id').getValue() * 1;
369 Roo.MessageBox.alert('Error', 'Save first');
374 var w = Roo.lib.Dom.getViewWidth();
375 var h = Roo.lib.Dom.getViewHeight();
377 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
379 _this.panel.region.collapse();
389 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
393 var page_link = _this.form.findField('page_link').getValue();
395 if(!page_link.length){
396 Roo.MessageBox.alert('Error', 'Please fill in the page link');
400 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
401 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
405 var url = uiConfig.cms_page_preview_base + page_link;
415 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
420 _this.trform.isDirty() ||
421 _this.trform1.isDirty() ||
422 _this.trform2.isDirty() ||
423 _this.trform3.isDirty()
425 Roo.MessageBox.confirm(
427 "Do you want to save the translation",
453 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
458 if(!_this.form1.findField('body').editorcore.sourceEditMode){
459 _this.form1.findField('body').syncValue();
460 _this.form2.findField('extended').syncValue();
461 Roo.log('syncValue');
463 _this.form1.findField('body').pushValue();
464 _this.form2.findField('extended').pushValue();
465 Roo.log('pushValue');
468 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
469 _this.interests.reset();
473 _this.trform.isDirty() ||
474 _this.trform1.isDirty() ||
475 _this.trform2.isDirty() ||
476 _this.trform3.isDirty()
478 Roo.MessageBox.confirm(
480 "Do you want to save the translation",
483 _this.dialog.el.mask("Saving");
484 _this.form.doAction("submit");
494 _this.dialog.el.mask("Saving");
495 _this.form.doAction("submit");
504 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
510 if(!_this.form1.findField('body').editorcore.sourceEditMode){
511 _this.form1.findField('body').syncValue();
512 _this.form2.findField('extended').syncValue();
514 _this.form1.findField('body').pushValue();
515 _this.form2.findField('extended').pushValue();
518 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
519 _this.interests.reset();
524 _this.trform.isDirty() ||
525 _this.trform1.isDirty() ||
526 _this.trform2.isDirty() ||
527 _this.trform3.isDirty()
529 Roo.MessageBox.confirm(
531 "Do you want to save the translation",
534 _this.dialog.el.mask("Saving");
535 _this.form.doAction("submit");
545 _this.dialog.el.mask("Saving");
546 _this.form.doAction("submit");
556 xtype : 'NestedLayoutPanel',
562 render : function (_self)
564 _this.centerLayoutPanel = this;
571 xtype : 'BorderLayout',
575 xtype : 'LayoutRegion',
581 xtype : 'LayoutRegion',
590 xtype : 'ContentPanel',
595 render : function (_self)
597 _this.cpanel = _self;
599 resize : function (_self, width, height)
601 Roo.log("RESIZE, " + width + ',' + height);
603 var ew = Math.max(250, width - 10);
604 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
611 bd = _this.form1.findField('body');
615 // since render delays resize..
616 Roo.log('resizing body to ' + bd.width);
617 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
618 // _this.bodycol.el.setWidth(bd.width+20);
623 bd = _this.form2.findField('extended');
629 Roo.log('resizing extended to ' + bd.width);
630 // since render delays resize..
631 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
632 // _this.extendcol.el.setWidth(bd.width+20);
637 bd = _this.form3.findField('extra_css');
641 // _this.keywordscol.el.setWidth(ew+20);
643 // fix for messed up rendering of dialog?
647 _this.dialog.layout.el.dom.scrollTop = 0;
649 // noop... - the above sometimes fails...
662 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
664 click : function (_self, e)
666 if (_this.dialog.getLayout().getRegion('west').collapsed) {
667 _this.dialog.getLayout().getRegion('west').expand();
669 _this.dialog.getLayout().getRegion('west').collapse();
675 '|xns' : 'Roo.Toolbar'
680 '|xns' : 'Roo.Toolbar'
684 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
686 click : function (_self, e)
688 if (_this.panel.region.collapsed) {
689 _this.panel.region.expand();
691 _this.panel.region.collapse();
697 '|xns' : 'Roo.Toolbar'
706 _this.form.setValues(_this.data);
710 _this.dialog.el.unmask();
711 _this.grid.getDataSource().load();
713 _this.trform.reset();
714 _this.trform1.reset();
715 _this.trform2.reset();
717 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
718 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
721 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
722 catlabel.dom.innerHTML = 'Category';
724 if(_this.data.page_type_id_name == 'category'){
725 catlabel.dom.innerHTML = 'Parent Category';
729 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
730 catlabel.dom.innerHTML = 'Parent page';
731 if(_this.data.page_type_id_name == 'category'){
732 catlabel.dom.innerHTML = 'Parent';
735 // better if this was not here... - not sure which project uses it?
737 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
738 _this.interestsCol.show();
741 if(typeof(d['interests']) != 'undefined'){
742 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
745 if(typeof(d['categories']) != 'undefined'){
746 _this.form.findField('category').setValue(Roo.decode(d['categories']));
749 if(typeof(d['page_classes']) != 'undefined'){
750 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
753 _this.trpanel.el.unmask();
754 _this.panel.el.unmask();
757 _this.cpanel.el.dom.scrollTop = 0;
759 // fix messed up scroll.
760 _this.dialog.layout.el.dom.scrollTop = 0;
763 labelAlign : 'right',
766 showHide : function()
773 var page_type_name = _this.form.findField('page_type_id_name').getValue();
775 switch(page_type_name){
798 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
799 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
800 var has_extended = _this.form.findField('has_extended').getValue() * 1;
803 is_attachment : !in_rss,
805 category_type_id : in_rss && !is_menu,
806 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
807 target_url : is_menu,
809 category : !is_category,
811 parent_id : !in_rss || is_category ,
814 to_replace_id :false, // !in_rss, // is this used.
815 is_draft : !is_system_page,
816 author_id : in_rss && !is_menu && !is_attachment,
818 template_id : !is_attachment && !is_menu && !is_system_page,
819 element_id : is_element && !is_menu,
820 menu_page_id : is_menu,
821 page_cls : is_element
823 // has_extended : !is_menu && !is_attachment, // always shown.
824 // extended : has_extended && !is_menu && !is_attachment,
825 // body : !is_attachment && !is_menu,
826 //keywords : !is_attachment && !is_menu,
827 // descriptions : !is_attachment && !is_menu
828 // extra_css : !is_attachment && !is_menu
832 var el = _this.form.findField(k);
835 Roo.log("missing field " + k);
839 el.actionMode = 'fieldEl';
849 _this.centerLayoutPanel.getLayout().getRegion('south').show();
850 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
851 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
852 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
853 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
855 if(is_attachment || is_menu){
857 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
861 if(!has_extended && !is_attachment && !is_menu){
862 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
863 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
867 _this.trform.showHide();
869 if(typeof(_this.form.editors) == 'undefined'){
870 _this.form.editors = {
871 body : _this.form1.findField('body').wrap.isVisible(),
872 extended : _this.form2.findField('extended').wrap.isVisible()
875 if(_this.form.editors.body){
876 setInterval(_this.form1.findField('body').autosave, 60000);
879 if(_this.form.editors.extended){
880 setInterval(_this.form2.findField('extended').autosave, 60000);
884 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
885 setInterval(_this.form1.findField('body').autosave, 60000);
886 _this.form.editors.body = true;
889 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
890 setInterval(_this.form2.findField('extended').autosave, 60000);
891 _this.form.editors.extended = true;
897 style : 'margin: 5px',
898 url : baseURL + '/Roo/cms_page.php',
900 actioncomplete : function (_self, action)
903 if (action.type == 'setdata') {
905 _this.form.addForm(_this.form1);
906 _this.form.addForm(_this.form2);
907 _this.form.addForm(_this.form3);
908 _this.form.addForm(_this.form4);
910 _this.dialog.setStylesheets();
912 _this.dialog.getLayout().getRegion('west').collapse();
913 _this.panel.region.collapse();
915 _this.trpanel.el.mask('Save first');
916 _this.panel.el.mask('Save first');
918 _this.loaded = false;
919 _this.interestsCol.hide();
921 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
923 if ( _this.data.id) {
924 _this.dialog.el.mask("Loading");
925 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
929 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
930 this.findField('is_draft').setValue(is_draft);
931 _this.page_type.setValue(_this.data.page_type_id);
932 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
934 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
935 _this.interestsCol.show();
938 _this.form.showHide();
941 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
942 catlabel.dom.innerHTML = 'Category';
943 if(_this.data.page_type_id_name == 'category'){
944 catlabel.dom.innerHTML = 'Parent Category';
949 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
950 catlabel.dom.innerHTML = 'Parent page';
951 if(_this.data.page_type_id_name == 'category'){
952 catlabel.dom.innerHTML = 'Parent';
958 if(_this.data._is_copy){
959 _this.form.is_copy();
965 if (action.type == 'load') {
967 //_this.data = action.result.data;
969 var d = action.result.data;
971 _this.dialog.el.unmask();
972 _this.grid.getDataSource().load();
974 _this.trform.reset();
975 _this.trform1.reset();
976 _this.trform2.reset();
977 _this.trform3.reset();
979 _this.trform.addForm(_this.trform1);
980 _this.trform.addForm(_this.trform2);
982 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
983 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
984 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
985 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
986 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
989 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
990 catlabel.dom.innerHTML = 'Category';
992 if(_this.data.page_type_id_name == 'category'){
993 catlabel.dom.innerHTML = 'Parent Category';
997 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
998 catlabel.dom.innerHTML = 'Parent page';
999 if(_this.data.page_type_id_name == 'category'){
1000 catlabel.dom.innerHTML = 'Parent';
1003 // better if this was not here... - not sure which project uses it?
1005 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
1006 _this.interestsCol.show();
1009 if(typeof(d['interests']) != 'undefined'){
1010 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
1013 if(typeof(d['categories']) != 'undefined'){
1014 _this.form.findField('category').setValue(Roo.decode(d['categories']));
1017 if(typeof(d['page_classes']) != 'undefined'){
1018 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1021 _this.trpanel.el.unmask();
1022 _this.panel.el.unmask();
1025 _this.cpanel.el.dom.scrollTop = 0;
1027 // fix messed up scroll.
1028 _this.dialog.layout.el.dom.scrollTop = 0;
1032 if (action.type =='submit') {
1034 _this.dialog.el.unmask();
1037 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1041 _this.dialog.hide();
1044 if (_this.callback) {
1045 _this.callback.call(_this, action.result.data);
1051 actionfailed : function (_self, action)
1053 _this.dialog.el.unmask();
1054 Pman.standardActionFailed(_self, action);
1056 rendered : function (_self)
1062 '|xns' : 'Roo.form',
1069 '|xns' : 'Roo.form',
1074 labelAlign : 'right',
1076 style : 'height:30px;overflow:hidden',
1079 '|xns' : 'Roo.form',
1083 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1092 style : 'height:30px;overflow:hidden',
1095 '|xns' : 'Roo.form',
1100 displayField : 'display_name',
1102 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1103 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1104 forceSelection : true,
1105 hiddenName : 'page_type_id',
1107 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1109 name : 'page_type_id_display_name',
1111 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1112 selectOnFocus : true,
1113 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1114 triggerAction : 'all',
1118 render : function (_self)
1120 _this.page_type = _self;
1122 select : function (combo, record, index)
1124 // _this.grid.footer.onClick('first');
1125 var page_type_name = record.data.name;
1126 _this.form.findField('page_type_id_name').setValue(page_type_name);
1127 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1128 _this.form.findField('is_attachment').setValue(0);
1132 _this.form.showHide.defer(100, _this.form);
1138 '|xns' : 'Roo.form',
1142 sortInfo : { direction : 'ASC', field: 'seqid' },
1144 beforeload : function (_self, o){
1145 o.params = o.params || {};
1147 o.params.etype = 'cms_page_type';
1151 '|xns' : 'Roo.data',
1153 xtype : 'HttpProxy',
1155 url : baseURL + '/Roo/core_enum.php',
1160 xtype : 'JsonReader',
1161 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1164 totalProperty : 'total',
1173 style : 'padding-left: -70px;',
1176 '|xns' : 'Roo.form',
1179 xtype : 'NumberField',
1180 decimalPrecision : 0,
1181 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1196 labelAlign : 'right',
1198 style : 'height:30px;overflow:hidden',
1201 '|xns' : 'Roo.form',
1205 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1214 style : 'height:30px;overflow:hidden',
1217 '|xns' : 'Roo.form',
1221 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1222 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1230 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1232 name : 'has_extended',
1235 check : function (_self, checked)
1240 _this.form.showHide();
1241 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1252 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1254 name : 'is_attachment',
1257 check : function (_self, checked)
1261 _this.form.showHide.defer(100, _this.form);
1275 displayField : 'name',
1277 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1278 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1279 forceSelection : true,
1280 hiddenName : 'author_id',
1282 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1284 name : 'author_id_name',
1286 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1287 queryParam : 'query[name]',
1288 selectOnFocus : true,
1289 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1290 triggerAction : 'all',
1295 '|xns' : 'Roo.form',
1299 sortInfo : { direction : 'ASC', field: 'name' },
1301 beforeload : function (_self, o){
1302 o.params = o.params || {};
1304 o.params.active = 1;
1305 o.params['query[is_owner]'] = 1;
1309 '|xns' : 'Roo.data',
1311 xtype : 'HttpProxy',
1313 url : baseURL + '/Roo/core_person',
1318 xtype : 'JsonReader',
1319 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1322 totalProperty : 'total',
1329 xtype : 'ComboBoxArray',
1330 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1331 hiddenName : 'category',
1332 name : 'category_name',
1335 '|xns' : 'Roo.form',
1340 displayField : 'display_fullpath',
1342 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1343 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1344 forceSelection : true,
1348 queryParam : 'search[name]',
1349 selectOnFocus : true,
1350 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1351 triggerAction : 'all',
1355 '|xns' : 'Roo.form',
1359 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1361 beforeload : function (_self, o){
1362 o.params = o.params || {};
1364 o.params.page_type_id_name= 'CATEGORY';
1366 o.params._with_fullpath = 1;
1370 '|xns' : 'Roo.data',
1372 xtype : 'HttpProxy',
1374 url : baseURL + '/Roo/cms_page.php',
1379 xtype : 'JsonReader',
1381 {"name":"id","type":"int"},
1382 {"name":"name","type":"string"},
1383 {"name":"display_name","type":"string"}
1387 totalProperty : 'total',
1398 displayField : 'page_link',
1400 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1401 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1402 forceSelection : true,
1403 hiddenName : 'parent_id',
1405 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1407 name : 'parent_id_title',
1409 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1410 selectOnFocus : true,
1411 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1412 triggerAction : 'all',
1417 select : function (combo, record, index)
1419 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1420 if (page_type_name == 'page') { // page
1423 // do not default to put 'Home' at the beginning.
1424 if (!record || !(record.data.parent_id *1)) {
1427 var pl = _this.form.findField('page_link');
1428 var lk = pl.getValue();
1429 var new_link = record.data.page_link + '/';
1431 new_link += lk.split('/').pop();
1433 pl.setValue(new_link);
1438 '|xns' : 'Roo.form',
1442 sortInfo : { field: 'page_link', direction: 'ASC' },
1444 beforeload : function (_self, options)
1446 options.params['search[page_link_no_empty]'] =1;
1448 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1449 options.params._page_type = 'page,element';
1451 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1454 var id = _this.form.findField('id').getValue() * 1;
1457 options.params['!id'] = id;
1462 options.params.is_element = 0;
1463 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1464 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1469 '|xns' : 'Roo.data',
1471 xtype : 'HttpProxy',
1473 url : baseURL + '/Roo/cms_page.php',
1478 xtype : 'JsonReader',
1480 { name: 'id', type: 'int' },
1486 totalProperty : 'total',
1496 '|xns' : 'Roo.form',
1499 xtype : 'DateField',
1500 altFormats : 'Y-m-d H:i:s',
1501 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1509 xtype : 'TextField',
1510 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1511 name : 'to_replace_id',
1519 xtype : 'TextField',
1520 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1524 keyup : function (_self, e)
1526 if (_this.page_type.getRawValue() == 'Category') {
1528 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1537 xtype : 'TextField',
1538 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1545 xtype : 'TextField',
1546 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1547 name : 'target_url',
1556 displayField : 'template_clean',
1558 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1559 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1560 forceSelection : true,
1561 hiddenName : 'template_id',
1563 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1565 name : 'template_id_template_clean',
1567 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1568 selectOnFocus : true,
1569 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1570 triggerAction : 'all',
1575 '|xns' : 'Roo.form',
1579 sortInfo : { field: 'template', direction: 'ASC' },
1581 beforeload : function (_self, options)
1584 options.params._rescan = 1;
1585 options.params._clean_name = 1;
1586 // options.params.lang = 'en';
1587 options.params['!template[0]'] = 'master.html';
1588 //options.params['!template[1]'] = 'index.html';
1592 '|xns' : 'Roo.data',
1594 xtype : 'HttpProxy',
1596 url : baseURL + '/Roo/Cms_template',
1601 xtype : 'JsonReader',
1603 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1607 totalProperty : 'total',
1617 displayField : 'name',
1619 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1620 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1621 forceSelection : true,
1622 hiddenName : 'element_id',
1624 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1626 name : 'element_id_name',
1628 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1629 selectOnFocus : true,
1630 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1631 triggerAction : 'all',
1636 '|xns' : 'Roo.form',
1640 sortInfo : { field: 'name', direction: 'ASC' },
1642 beforeload : function (_self, options)
1644 var par = _this.form.findField('parent_id').getValue() * 1;
1646 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1650 options.params._cms_page_id = par;
1654 '|xns' : 'Roo.data',
1656 xtype : 'HttpProxy',
1658 url : baseURL + '/Roo/Cms_template_element',
1663 xtype : 'JsonReader',
1665 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1669 totalProperty : 'total',
1679 displayField : 'page_link',
1681 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1682 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1683 forceSelection : true,
1684 hiddenName : 'menu_page_id',
1686 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1688 name : 'menu_page_id_page_link',
1690 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1691 selectOnFocus : true,
1692 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>',
1693 triggerAction : 'all',
1698 '|xns' : 'Roo.form',
1702 sortInfo : { field: 'title', direction: 'ASC' },
1704 beforeload : function (_self, options)
1706 options.params = options.params || {};
1708 options.params['search[page_link_no_empty]'] =1;
1710 options.params['page_type_id_name[0]'] = 'page';
1711 options.params['page_type_id_name[1]'] = 'blog';
1713 options.params.is_element = 0;
1714 options.params.is_menuitem = 0;
1719 '|xns' : 'Roo.data',
1721 xtype : 'HttpProxy',
1723 url : baseURL + '/Roo/cms_page.php',
1728 xtype : 'JsonReader',
1743 "name":"page_type_id_display_name",
1749 totalProperty : 'total',
1756 xtype : 'ComboBoxArray',
1757 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1758 hiddenName : 'page_cls',
1759 name : 'page_cls_name',
1762 '|xns' : 'Roo.form',
1767 displayField : 'display_name',
1769 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1770 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1771 forceSelection : true,
1774 queryParam : 'query[search]',
1775 selectOnFocus : true,
1776 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1777 triggerAction : 'all',
1778 valueField : 'name',
1781 '|xns' : 'Roo.form',
1785 sortInfo : { direction : 'ASC', field: 'seqid' },
1787 beforeload : function (_self, o){
1788 o.params = o.params || {};
1790 o.params.etype = 'cms_page_class';
1794 '|xns' : 'Roo.data',
1796 xtype : 'HttpProxy',
1798 url : baseURL + '/Roo/core_enum.php',
1803 xtype : 'JsonReader',
1805 {"name":"id","type":"int"},
1806 {"name":"name","type":"string"},
1807 {"name":"display_name","type":"string"}
1811 totalProperty : 'total',
1825 '|xns' : 'Roo.form',
1831 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1832 style : 'width: 165px;',
1834 '|xns' : 'Roo.form',
1837 xtype : 'DisplayField',
1839 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1840 name : 'primary_image_id',
1841 style : 'border: 1px solid #ccc;',
1842 valueRenderer : function(v) {
1844 if (!v || v * 1 < 1) {
1845 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1848 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1861 render : function (_self)
1863 _this.interestsCol = _self;
1867 '|xns' : 'Roo.form',
1870 xtype : 'ComboBoxArray',
1871 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1872 hiddenName : 'interest',
1873 name : 'interest_name',
1876 render : function (_self)
1878 _this.interests = _self;
1880 _self.combo.addicon.setStyle( {
1881 position : 'absolute',
1890 '|xns' : 'Roo.form',
1895 displayField : 'display_name',
1897 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1898 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1899 forceSelection : true,
1902 queryParam : 'query[name]',
1903 selectOnFocus : true,
1904 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1905 triggerAction : 'all',
1909 '|xns' : 'Roo.form',
1913 sortInfo : { direction : 'ASC', field: 'name' },
1915 beforeload : function (_self, o){
1916 o.params = o.params || {};
1917 o.params.etype = 'crm_interest';
1921 '|xns' : 'Roo.data',
1923 xtype : 'HttpProxy',
1925 url : baseURL + '/Roo/Core_enum.php',
1930 xtype : 'JsonReader',
1932 {"name":"id","type":"int"},
1933 {"name":"name","type":"string"},
1934 {"name":"display_name","type":"string"}
1938 totalProperty : 'total',
1955 name : 'is_system_page',
1961 name : 'is_menuitem',
1967 name : 'page_type_id_name',
1974 render : function (_self)
1976 _this.user_defined_fields = _self;
1987 xtype : 'ContentPanel',
1989 fitContainer : true,
1992 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2001 url : baseURL + '/Roo/cms_page.php',
2003 rendered : function (form)
2009 '|xns' : 'Roo.form',
2015 '|xns' : 'Roo.form',
2018 xtype : 'HtmlEditor',
2019 autosave : function() {
2021 var body = _this.form1.findField('body');
2023 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2024 Roo.log('body not dirty');
2028 Roo.log('body dirty, auto save!');
2030 body.fireEvent('autosave', body);
2034 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2038 white : [ 'iframe' ],
2041 autosave : function (_self)
2043 Roo.log('autosave');
2045 var id = _this.form.findField('id').getValue() * 1;
2047 if(!_self.editorcore.sourceEditMode){
2054 url : baseURL + '/Roo/Events.php',
2058 action : 'AUTOSAVE',
2059 on_id : (id > 0) ? id : 0,
2060 on_table : 'cms_page',
2062 source: _self.getValue()
2064 success : function() {
2065 _self.originalValue = _self.getValue();
2068 failure : function()
2070 //Roo.MessageBox.alert("Error", "autosave failed");
2071 Roo.log('body autosave failed?!');
2076 savedpreview : function (_self)
2078 Roo.log('saved preview');
2080 var id = _this.form.findField('id').getValue() * 1;
2082 var successFn = function(res){
2083 return res.data.POST.source;
2087 action : 'AUTOSAVE',
2089 on_id : (id < 1) ? 0 : id,
2090 on_table : 'cms_page',
2091 successFn : successFn
2095 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2096 _self.setValue(res);
2097 _self.originalValue = res;
2100 stylesheetsclick : function (_self)
2102 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2103 _this.dialog.setStylesheets();
2109 '|xns' : 'Roo.form',
2112 xtype : 'ToolbarStandard',
2113 xns : Roo.form.HtmlEditor,
2114 '|xns' : 'Roo.form.HtmlEditor',
2119 displayField : 'name',
2121 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2122 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2123 forceSelection : true,
2125 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2128 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2129 queryParam : 'search',
2130 selectOnFocus : true,
2131 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>',
2132 triggerAction : 'all',
2137 beforequery : function (combo, query, forceAll, cancel, e)
2140 var id = _this.form.findField('id').getValue() * 1;
2142 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2146 render : function (_self)
2148 _this.bodyimgselect = _self;
2150 select : function (combo, record, index)
2157 var editor = _this.form.findField('body').editorcore;
2159 var curnode = editor.getSelectedNode();
2161 if (curnode && curnode.tagName == 'IMG') {
2162 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2163 baseURL, record.data.id, record.data.filename
2165 // note -forces an update... hopefully...
2166 editor.owner.fireEvent('editorevent', editor, false);
2169 editor.insertAtCursor(
2170 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2171 baseURL, record.data.id, record.data.filename
2180 '|xns' : 'Roo.form',
2184 sortInfo : { direction : 'ASC', field: 'id' },
2186 beforeload : function (_self, o){
2187 o.params = o.params || {};
2189 var id = _this.form.findField('id').getValue() * 1;
2191 Roo.MessageBox.alert("Error", "Save press release first");
2195 o.params.ontable = 'cms_page';
2196 // o.params.imgtype = 'PressRelease';
2197 //o.params['query[imagesize]'] = '150x150';
2202 '|xns' : 'Roo.data',
2204 xtype : 'HttpProxy',
2206 url : baseURL + '/Roo/Images.php',
2211 xtype : 'JsonReader',
2212 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2215 totalProperty : 'total',
2224 displayField : 'page_link',
2226 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2227 forceSelection : true,
2228 hiddenName : 'add_link_id',
2230 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2234 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2235 selectOnFocus : true,
2236 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2237 triggerAction : 'all',
2242 select : function (combo, record, index)
2248 var editor = _this.form.findField('body');
2249 editor.editorcore.insertAtCursor(
2250 String.format('<a href="#page-{0}">{1}</a>',
2251 record.data.page_link, record.data.title
2259 '|xns' : 'Roo.form',
2263 sortInfo : { field: 'page_link', direction: 'ASC' },
2265 beforeload : function (_self, options)
2267 options.params['search[page_link_no_empty]'] =1;
2269 options.params.is_element = 0;
2270 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2275 '|xns' : 'Roo.data',
2277 xtype : 'HttpProxy',
2279 url : baseURL + '/Roo/cms_page.php',
2284 xtype : 'JsonReader',
2286 { name: 'id', type: 'int' },
2292 totalProperty : 'total',
2299 xtype : 'Separator',
2301 '|xns' : 'Roo.Toolbar'
2305 cls : 'x-init-enable',
2306 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2308 click : function (_self, e)
2310 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2314 '|xns' : 'Roo.Toolbar'
2319 xtype : 'ToolbarContext',
2320 xns : Roo.form.HtmlEditor,
2321 '|xns' : 'Roo.form.HtmlEditor'
2332 xtype : 'ContentPanel',
2334 fitContainer : true,
2337 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2346 url : baseURL + '/Roo/cms_page.php',
2348 rendered : function (form)
2354 '|xns' : 'Roo.form',
2360 '|xns' : 'Roo.form',
2363 xtype : 'HtmlEditor',
2364 autosave : function() {
2366 var extended = _this.form2.findField('extended');
2368 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2369 Roo.log('extend not dirty');
2374 Roo.log('extend dirty, auto save!');
2376 extended.fireEvent('autosave', extended);
2378 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2382 white : [ 'iframe' ],
2385 autosave : function (_self)
2387 var id = _this.form.findField('id').getValue() * 1;
2390 if(!_self.editorcore.sourceEditMode){
2397 url : baseURL + '/Roo/Events.php',
2401 action : 'AUTOSAVE',
2402 on_id : (id > 0) ? id : 0,
2403 on_table : 'cms_page',
2404 remarks : 'EXTENDED',
2405 source: _self.getValue()
2407 success : function() {
2408 _self.originalValue = _self.getValue();
2411 failure : function()
2413 //Roo.MessageBox.alert("Error", "autosave failed");
2414 Roo.log('extended autosave failed?!');
2418 savedpreview : function (_self)
2420 var id = _this.form.findField('id').getValue() * 1;
2422 var successFn = function(res){
2423 return res.data.POST.source;
2427 action : 'AUTOSAVE',
2428 remarks : 'EXTENDED',
2429 on_id : (id < 1) ? 0 : id,
2430 on_table : 'cms_page',
2431 successFn : successFn
2435 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2436 _self.setValue(res);
2437 _self.originalValue = res;
2440 stylesheetsclick : function (_self)
2442 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2443 _this.dialog.setStylesheets();
2449 '|xns' : 'Roo.form',
2452 xtype : 'ToolbarStandard',
2453 xns : Roo.form.HtmlEditor,
2454 '|xns' : 'Roo.form.HtmlEditor',
2459 displayField : 'name',
2461 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2462 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2463 forceSelection : true,
2465 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2468 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2469 selectOnFocus : true,
2470 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2471 triggerAction : 'all',
2476 beforequery : function (combo, query, forceAll, cancel, e)
2479 var id = _this.form.findField('id').getValue() * 1;
2481 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2485 render : function (_self)
2487 _this.extendimgselect = _self;
2489 select : function (combo, record, index)
2496 var editor = _this.form.findField('extended').editorcore;
2498 var curnode = editor.getSelectedNode();
2500 if (curnode && curnode.tagName == 'IMG') {
2501 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2502 baseURL, record.data.id, record.data.filename
2504 // note -forces an update... hopefully...
2505 editor.owner.fireEvent('editorevent', editor, false);
2508 editor.insertAtCursor(
2509 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2510 baseURL, record.data.id, record.data.filename
2519 '|xns' : 'Roo.form',
2523 sortInfo : { direction : 'ASC', field: 'id' },
2525 beforeload : function (_self, o){
2526 o.params = o.params || {};
2528 var id = _this.form.findField('id').getValue() * 1;
2530 Roo.MessageBox.alert("Error", "Save press release first");
2534 o.params.ontable = 'cms_page';
2535 // o.params.imgtype = 'PressRelease';
2536 //o.params['query[imagesize]'] = '150x150';
2541 '|xns' : 'Roo.data',
2543 xtype : 'HttpProxy',
2545 url : baseURL + '/Roo/Images.php',
2550 xtype : 'JsonReader',
2551 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2554 totalProperty : 'total',
2563 displayField : 'page_link',
2565 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2566 forceSelection : true,
2567 hiddenName : 'add_link_id',
2569 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2573 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2574 selectOnFocus : true,
2575 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2576 triggerAction : 'all',
2581 select : function (combo, record, index)
2587 var editor = _this.form.findField('body');
2588 editor.editorcore.insertAtCursor(
2589 String.format('<a href="#page-{0}">{1}</a>',
2590 record.data.page_link, record.data.title
2598 '|xns' : 'Roo.form',
2602 sortInfo : { field: 'page_link', direction: 'ASC' },
2604 beforeload : function (_self, options)
2606 options.params['search[page_link_no_empty]'] =1;
2608 options.params.is_element = 0;
2609 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2614 '|xns' : 'Roo.data',
2616 xtype : 'HttpProxy',
2618 url : baseURL + '/Roo/cms_page.php',
2623 xtype : 'JsonReader',
2625 { name: 'id', type: 'int' },
2631 totalProperty : 'total',
2638 xtype : 'Separator',
2640 '|xns' : 'Roo.Toolbar'
2644 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2646 click : function (_self, e)
2648 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2652 '|xns' : 'Roo.Toolbar'
2657 xtype : 'ToolbarContext',
2658 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2659 xns : Roo.form.HtmlEditor,
2660 '|xns' : 'Roo.form.HtmlEditor'
2671 xtype : 'ContentPanel',
2673 fitContainer : true,
2676 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2685 url : baseURL + '/Roo/cms_page.php',
2687 rendered : function (form)
2693 '|xns' : 'Roo.form',
2699 '|xns' : 'Roo.form',
2703 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2717 xtype : 'ContentPanel',
2719 fitContainer : true,
2722 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2731 url : baseURL + '/Roo/cms_page.php',
2733 rendered : function (form)
2739 '|xns' : 'Roo.form',
2744 '|xns' : 'Roo.form',
2748 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2757 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2759 name : 'descriptions',
2774 xtype : 'GridPanel',
2776 fitContainer : true,
2779 tableName : 'Images',
2780 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2782 activate : function() {
2785 _this.grid.footer.onClick('first');
2792 xtype : 'EditorGrid',
2793 autoExpandColumn : 'title',
2797 render : function() {
2799 //_this.dialog = Pman.Dialog.FILL_IN
2800 if (_this.panel.active) {
2801 //this.footer.onClick('first');
2804 rowdblclick : function (_self, rowIndex, e)
2806 var rd = _this.grid.getDataSource().getAt(rowIndex);
2807 var id = rd.data.id;
2808 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2809 _this.form.findField('contents').execCmd('insertimage', url);
2814 '|xns' : 'Roo.grid',
2822 cls : 'x-btn-text-icon',
2823 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2824 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2828 var id = _this.form.findField('id').getValue() * 1;
2834 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2835 _this.grid.ds.load({});
2845 cls : 'x-btn-text-icon',
2846 icon : rootURL + '/Pman/templates/images/trash.gif',
2847 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2851 var selection = _this.grid.getSelectionModel().getSelectedCell();
2852 var sn = _this.grid.ds.getAt(selection[0]);
2853 if (!sn || isNaN(sn.id *1)) {
2854 Roo.MessageBox.alert("Error", "Select a image");
2857 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2863 url : baseURL + '/Roo/Images.php',
2868 success : function()
2870 Roo.log('Got Success!!');
2871 _this.grid.ds.load({});
2885 beforeload : function (_self, o)
2887 var id = _this.form.findField('id').getValue() * 1;
2893 o.params = o.params || {};
2894 o.params.limit = 9999;
2896 o.params.ontable = 'cms_page';
2898 update : function (_self, rec, operation)
2902 url : baseURL+'/Roo/Images.php',
2905 success: function(res)
2907 Roo.log("GOT success");
2908 // update the data...
2909 _this.grid.ds.load({});
2911 failure : function(res)
2913 Roo.MessageBox.alert('Error', res.errorMsg);
2914 _this.grid.ds.load({});
2922 '|xns' : 'Roo.data',
2924 xtype : 'HttpProxy',
2926 url : baseURL + '/Roo/Images.php',
2931 xtype : 'JsonReader',
2966 'name': 'displayorder',
2974 'name': 'parent_image_id',
2980 'dateFormat': 'Y-m-d'
2999 'name': 'parent_image_id_id',
3003 'name': 'parent_image_id_filename',
3007 'name': 'parent_image_id_ontable',
3011 'name': 'parent_image_id_onid',
3015 'name': 'parent_image_id_mimetype',
3019 'name': 'parent_image_id_width',
3023 'name': 'parent_image_id_height',
3027 'name': 'parent_image_id_filesize',
3031 'name': 'parent_image_id_displayorder',
3035 'name': 'parent_image_id_language',
3039 'name': 'parent_image_id_parent_image_id',
3043 'name': 'parent_image_id_created',
3047 'name': 'parent_image_id_imgtype',
3051 'name': 'parent_image_id_linkurl',
3055 'name': 'parent_image_id_descript',
3059 'name': 'parent_image_id_title',
3065 totalProperty : 'total',
3072 xtype : 'ColumnModel',
3074 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3075 renderer : function(v,x,r) {
3076 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3084 xtype : 'ColumnModel',
3085 dataIndex : 'filename',
3086 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3087 renderer : function(v) { return String.format('{0}', v); },
3093 xtype : 'ColumnModel',
3094 dataIndex : 'displayorder',
3095 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3096 renderer : function(v) { return String.format('{0}', v); },
3099 '|xns' : 'Roo.grid',
3101 xtype : 'GridEditor',
3103 '|xns' : 'Roo.grid',
3105 xtype : 'NumberField',
3106 decimalPrecision : 0,
3108 focus : function (_self)
3110 if (this.value == 0) {
3111 this.el.dom.value = '';
3121 xtype : 'ColumnModel',
3122 dataIndex : 'title',
3123 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3124 renderer : function(v) { return String.format('{0}', v); },
3127 '|xns' : 'Roo.grid',
3129 xtype : 'GridEditor',
3131 '|xns' : 'Roo.grid',
3133 xtype : 'TextField',
3140 xtype : 'ColumnModel',
3141 dataIndex : 'linkurl',
3142 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3143 renderer : function(v)
3145 return String.format('{0}', (v) ? v : '');
3149 '|xns' : 'Roo.grid',
3151 xtype : 'GridEditor',
3153 '|xns' : 'Roo.grid',
3155 xtype : 'TextField',
3165 xtype : 'NestedLayoutPanel',
3167 fitContainer : true,
3171 render : function (_self)
3173 _this.westLayoutPanel = this;
3180 xtype : 'BorderLayout',
3184 xtype : 'LayoutRegion',
3185 tabPosition : 'top',
3190 xtype : 'LayoutRegion',
3193 tabPosition : 'top',
3199 xtype : 'ContentPanel',
3204 render : function (_self)
3206 _this.trpanel = _self;
3208 resize : function (_self, width, height)
3210 Roo.log('resize called');
3212 var ew = Math.max(250, width - 10);
3213 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3216 if (!_this.trform) {
3220 var bd = _this.trform1.findField('body');
3225 // since render delays resize..
3226 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3227 // _this.trbodycol.el.setWidth(bd.width+20);
3229 var bd = _this.trform2.findField('extended');
3233 // since render delays resize..
3234 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3235 // _this.trextendcol.el.setWidth(bd.width+20);
3245 labelAlign : 'right',
3248 showHide : function() {
3250 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3251 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3252 var has_lang = _this.trform.findField('language').getValue().length;
3254 _this.westLayoutPanel.getLayout().getRegion('south').show();
3255 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3256 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3257 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3260 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3263 if(!has_extended && has_lang){
3264 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3265 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3273 var el = _this.trform.findField(k);
3274 el.actionMode = 'fieldEl';
3276 Roo.log("show: " + k);
3279 Roo.log("hide: " + k);
3284 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3287 if(typeof(_this.trform.editors) == 'undefined'){
3288 _this.trform.editors = {
3289 body : _this.trform1.findField('body').wrap.isVisible(),
3290 extended : _this.trform2.findField('extended').wrap.isVisible()
3292 if(_this.trform.editors.body){
3293 setInterval(_this.trform1.findField('body').autosave, 60000);
3296 if(_this.trform.editors.extended){
3297 setInterval(_this.trform2.findField('extended').autosave, 60000);
3301 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3302 setInterval(_this.trform1.findField('body').autosave, 60000);
3303 _this.trform.editors.body = true;
3306 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3307 setInterval(_this.trform2.findField('extended').autosave, 60000);
3308 _this.trform.editors.extended = true;
3313 style : 'margin: 5px',
3314 trackResetOnLoad : true,
3315 url : baseURL + '/Roo/cms_page.php',
3317 actioncomplete : function (_self, action)
3319 if (action.type =='submit') {
3323 if (action.type == 'setdata') {
3324 _this.trform.addForm(_this.trform1);
3325 _this.trform.addForm(_this.trform2);
3326 _this.trform.addForm(_this.trform3);
3328 if ( _this.data.id) {
3330 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3332 this.trpanel.el.mask("save first");
3339 if (action.type == 'load') {
3340 // _this.dialog.el.unmask();
3343 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3344 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3345 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3346 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3351 actionfailed : function (_self, action)
3353 _this.dialog.el.unmask();
3355 Pman.standardActionFailed(_self, action);
3357 rendered : function (_self)
3359 _this.trform = _self;
3363 '|xns' : 'Roo.form',
3370 '|xns' : 'Roo.form',
3377 '|xns' : 'Roo.form',
3382 displayField : 'language_name',
3384 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3385 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3386 forceSelection : true,
3387 hiddenName : 'language',
3389 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3391 name : 'language_name',
3393 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3394 selectOnFocus : true,
3395 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3396 triggerAction : 'all',
3398 valueField : 'language',
3400 add : function (combo)
3402 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3405 _this.trform.reset();
3406 _this.trform1.reset();
3407 _this.trform2.reset();
3409 combo.setValue(res.lang);
3410 combo.el.dom.value = res.lang_name;
3413 _this.trform.showHide();
3414 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3419 render : function (_self)
3421 _this.language = _self;
3423 select : function (combo, record, index)
3426 _this.trform.showHide();
3427 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3434 'lookup[language]' : record.data.language,
3435 'lookup[translation_of_id]' : _this.data.id,
3442 '|xns' : 'Roo.form',
3446 sortInfo : { direction : 'ASC', field: 'language' },
3448 beforeload : function (_self, o){
3449 o.params = o.params || {};
3451 o.params._distinct = 'language';
3452 o.params._columns ='language_name,language';
3453 o.params._with_name = true;
3455 if(_this.form.findField('id').getValue()*1 > 0){
3456 o.params.translation_of_id = _this.form.findField('id').getValue();
3462 '|xns' : 'Roo.data',
3464 xtype : 'HttpProxy',
3466 url : baseURL + '/Roo/Cms_page.php',
3471 xtype : 'JsonReader',
3472 fields : [{"name":"language","type":"string"}],
3475 totalProperty : 'total',
3483 style : 'padding-top:12px;padding-left:30px;float:left',
3486 render : function (_self)
3488 _this.updateRow = _self;
3492 '|xns' : 'Roo.form',
3496 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3500 // _this.dialog.el.mask("Saving");
3501 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3502 _this.trform1.findField('body').syncValue();
3503 _this.trform2.findField('extended').syncValue();
3505 _this.trform1.findField('body').pushValue();
3506 _this.trform2.findField('extended').pushValue();
3509 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3510 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3511 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3512 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3513 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3515 if(_this.trform.findField('element_id').getValue()*1 > 0){
3516 _this.trform.findField('is_element').setValue(1);
3519 _this.trform.doAction("submit");
3530 xtype : 'TextField',
3531 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3547 name : 'element_id',
3553 name : 'menu_page_id',
3559 name : 'is_menuitem',
3565 name : 'is_element',
3572 name : 'translation_of_id',
3587 xtype : 'ContentPanel',
3589 fitContainer : true,
3592 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3601 url : baseURL + '/Roo/cms_page.php',
3603 rendered : function (form)
3605 _this.trform1 = form;
3609 '|xns' : 'Roo.form',
3615 '|xns' : 'Roo.form',
3618 xtype : 'HtmlEditor',
3619 autosave : function() {
3621 var body = _this.trform1.findField('body');
3623 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3624 Roo.log('tr body not dirty');
3628 Roo.log('tr body dirty, auto save!');
3630 body.fireEvent('autosave', body);
3632 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3636 white : [ 'iframe' ],
3638 autosave : function (_self)
3640 var id = _this.trform.findField('id').getValue() * 1;
3643 if(!_self.editorcore.sourceEditMode){
3650 url : baseURL + '/Roo/Events.php',
3654 action : 'AUTOSAVE',
3655 on_id : (id > 0) ? id : 0,
3656 on_table : 'cms_page',
3658 source: _self.getValue()
3660 success : function() {
3661 _self.originalValue = _self.getValue();
3664 failure : function()
3666 //Roo.MessageBox.alert("Error", "autosave failed");
3667 Roo.log('tr body autosave failed?!');
3671 savedpreview : function (_self)
3673 var id = _this.trform.findField('id').getValue() * 1;
3675 var successFn = function(res){
3676 return res.data.POST.source;
3680 action : 'AUTOSAVE',
3682 on_id : (id < 1) ? 0 : id,
3683 on_table : 'cms_page',
3684 successFn : successFn
3688 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3689 _self.setValue(res);
3690 _self.originalValue = res;
3693 stylesheetsclick : function (_self)
3695 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3696 _this.dialog.setStylesheets();
3702 '|xns' : 'Roo.form',
3705 xtype : 'ToolbarStandard',
3706 xns : Roo.form.HtmlEditor,
3707 '|xns' : 'Roo.form.HtmlEditor',
3712 displayField : 'name',
3714 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3715 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3716 forceSelection : true,
3718 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3721 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3722 selectOnFocus : true,
3723 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>',
3724 triggerAction : 'all',
3729 beforequery : function (combo, query, forceAll, cancel, e)
3732 var id = _this.form.findField('id').getValue() * 1;
3734 Roo.MessageBox.alert("Error", "Save press release first");
3738 render : function (_self)
3740 _this.trbodyimgselect = _self;
3742 select : function (combo, record, index)
3749 var editor = _this.trform.findField('body').editorcore;
3751 var curnode = editor.getSelectedNode();
3753 if (curnode && curnode.tagName == 'IMG') {
3754 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3755 baseURL, record.data.id, record.data.filename
3757 // note -forces an update... hopefully...
3758 editor.owner.fireEvent('editorevent', editor, false);
3761 editor.insertAtCursor(
3762 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3763 baseURL, record.data.id, record.data.filename
3772 '|xns' : 'Roo.form',
3776 sortInfo : { direction : 'ASC', field: 'id' },
3778 beforeload : function (_self, o){
3779 o.params = o.params || {};
3781 var id = _this.form.findField('id').getValue() * 1;
3783 Roo.MessageBox.alert("Error", "Save press release first");
3787 o.params.ontable = 'cms_page';
3788 // o.params.imgtype = 'PressRelease';
3789 //o.params['query[imagesize]'] = '150x150';
3794 '|xns' : 'Roo.data',
3796 xtype : 'HttpProxy',
3798 url : baseURL + '/Roo/Images.php',
3803 xtype : 'JsonReader',
3804 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3807 totalProperty : 'total',
3816 displayField : 'page_link',
3818 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3819 forceSelection : true,
3820 hiddenName : 'add_link_id',
3822 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3826 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3827 selectOnFocus : true,
3828 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3829 triggerAction : 'all',
3834 select : function (combo, record, index)
3840 var editor = _this.form.findField('body');
3841 editor.insertAtCursor(
3842 String.format('<a href="#page-{0}">{1}</a>',
3843 record.data.page_link, record.data.title
3851 '|xns' : 'Roo.form',
3855 sortInfo : { field: 'page_link', direction: 'ASC' },
3857 beforeload : function (_self, options)
3859 options.params['search[page_link_no_empty]'] =1;
3861 options.params.is_element = 0;
3862 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3867 '|xns' : 'Roo.data',
3869 xtype : 'HttpProxy',
3871 url : baseURL + '/Roo/cms_page.php',
3876 xtype : 'JsonReader',
3878 { name: 'id', type: 'int' },
3884 totalProperty : 'total',
3891 xtype : 'Separator',
3893 '|xns' : 'Roo.Toolbar'
3897 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3899 click : function (_self, e)
3901 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3905 '|xns' : 'Roo.Toolbar'
3910 xtype : 'ToolbarContext',
3911 xns : Roo.form.HtmlEditor,
3912 '|xns' : 'Roo.form.HtmlEditor'
3923 xtype : 'ContentPanel',
3925 fitContainer : true,
3928 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3937 url : baseURL + '/Roo/cms_page.php',
3939 rendered : function (form)
3941 _this.trform2 = form;
3945 '|xns' : 'Roo.form',
3951 '|xns' : 'Roo.form',
3954 xtype : 'HtmlEditor',
3955 autosave : function() {
3957 var extended = _this.trform2.findField('extended');
3959 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3960 Roo.log('tr extend not dirty');
3965 Roo.log('tr extend dirty, auto save!');
3967 extended.fireEvent('autosave', extended);
3971 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3975 white : [ 'iframe' ],
3977 autosave : function (_self)
3979 var id = _this.trform.findField('id').getValue() * 1;
3982 if(!_self.editorcore.sourceEditMode){
3990 url : baseURL + '/Roo/Events.php',
3994 action : 'AUTOSAVE',
3995 on_id : (id > 0) ? id : 0,
3996 on_table : 'cms_page',
3997 remarks : 'EXTENDED',
3998 source: _self.getValue()
4000 success : function() {
4001 _self.originalValue = _self.getValue();
4004 failure : function()
4006 //Roo.MessageBox.alert("Error", "autosave failed");
4007 Roo.log('tr extended autosave failed?!');
4011 savedpreview : function (_self)
4013 var id = _this.trform.findField('id').getValue() * 1;
4015 var successFn = function(res){
4016 return res.data.POST.source;
4020 action : 'AUTOSAVE',
4021 remarks : 'EXTENDED',
4022 on_id : (id < 1) ? 0 : id,
4023 on_table : 'cms_page',
4024 successFn : successFn
4028 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4029 _self.setValue(res);
4030 _self.originalValue = res;
4033 stylesheetsclick : function (_self)
4035 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4036 _this.dialog.setStylesheets();
4042 '|xns' : 'Roo.form',
4045 xtype : 'ToolbarStandard',
4046 xns : Roo.form.HtmlEditor,
4047 '|xns' : 'Roo.form.HtmlEditor',
4050 xtype : 'Separator',
4052 '|xns' : 'Roo.Toolbar'
4056 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4058 click : function (_self, e)
4060 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4064 '|xns' : 'Roo.Toolbar'
4069 xtype : 'ToolbarContext',
4070 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4071 xns : Roo.form.HtmlEditor,
4072 '|xns' : 'Roo.form.HtmlEditor'
4083 xtype : 'ContentPanel',
4085 fitContainer : true,
4088 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4097 url : baseURL + '/Roo/cms_page.php',
4099 rendered : function (form)
4101 _this.trform3 = form;
4105 '|xns' : 'Roo.form',
4110 '|xns' : 'Roo.form',
4114 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4123 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4125 name : 'descriptions',