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);
219 _this.westLayoutPanel.getLayout().getRegion('south').resizeTo(h - 450);
221 Pman.Cms.pageEditAddCustomFields();
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 _this.trform.reset();
340 _this.trform1.reset();
341 _this.trform2.reset();
342 _this.trform3.reset();
344 expanded : function (_self)
346 var id = _this.form.findField('id').getValue() * 1;
349 Roo.MessageBox.alert('Error', 'Save first');
354 var w = Roo.lib.Dom.getViewWidth();
355 var h = Roo.lib.Dom.getViewHeight();
357 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
359 _this.panel.region.collapse();
369 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
373 var page_link = _this.form.findField('page_link').getValue();
375 if(!page_link.length){
376 Roo.MessageBox.alert('Error', 'Please fill in the page link');
380 if(!uiConfig || typeof(uiConfig.cms_page_preview_base) == 'undefined'){
381 Roo.MessageBox.alert('Error', 'Please setup [cms_page_preivew_base] in uiConfig');
385 var url = uiConfig.cms_page_preview_base + page_link;
395 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
400 _this.trform.isDirty() ||
401 _this.trform1.isDirty() ||
402 _this.trform2.isDirty() ||
403 _this.trform3.isDirty()
405 Roo.MessageBox.confirm(
407 "Do you want to save the translation",
433 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
438 if(!_this.form1.findField('body').editorcore.sourceEditMode){
439 _this.form1.findField('body').syncValue();
440 _this.form2.findField('extended').syncValue();
441 Roo.log('syncValue');
443 _this.form1.findField('body').pushValue();
444 _this.form2.findField('extended').pushValue();
445 Roo.log('pushValue');
448 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
449 _this.interests.reset();
453 _this.trform.isDirty() ||
454 _this.trform1.isDirty() ||
455 _this.trform2.isDirty() ||
456 _this.trform3.isDirty()
458 Roo.MessageBox.confirm(
460 "Do you want to save the translation",
463 _this.dialog.el.mask("Saving");
464 _this.form.doAction("submit");
474 _this.dialog.el.mask("Saving");
475 _this.form.doAction("submit");
484 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
490 if(!_this.form1.findField('body').editorcore.sourceEditMode){
491 _this.form1.findField('body').syncValue();
492 _this.form2.findField('extended').syncValue();
494 _this.form1.findField('body').pushValue();
495 _this.form2.findField('extended').pushValue();
498 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
499 _this.interests.reset();
504 _this.trform.isDirty() ||
505 _this.trform1.isDirty() ||
506 _this.trform2.isDirty() ||
507 _this.trform3.isDirty()
509 Roo.MessageBox.confirm(
511 "Do you want to save the translation",
514 _this.dialog.el.mask("Saving");
515 _this.form.doAction("submit");
525 _this.dialog.el.mask("Saving");
526 _this.form.doAction("submit");
536 xtype : 'NestedLayoutPanel',
542 render : function (_self)
544 _this.centerLayoutPanel = this;
551 xtype : 'BorderLayout',
555 xtype : 'LayoutRegion',
561 xtype : 'LayoutRegion',
570 xtype : 'ContentPanel',
575 render : function (_self)
577 _this.cpanel = _self;
579 resize : function (_self, width, height)
581 Roo.log("RESIZE, " + width + ',' + height);
583 var ew = Math.max(250, width - 10);
584 var eh = _this.centerLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
591 bd = _this.form1.findField('body');
595 // since render delays resize..
596 Roo.log('resizing body to ' + bd.width);
597 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
598 // _this.bodycol.el.setWidth(bd.width+20);
603 bd = _this.form2.findField('extended');
609 Roo.log('resizing extended to ' + bd.width);
610 // since render delays resize..
611 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
612 // _this.extendcol.el.setWidth(bd.width+20);
617 bd = _this.form3.findField('extra_css');
621 // _this.keywordscol.el.setWidth(ew+20);
623 // fix for messed up rendering of dialog?
627 _this.dialog.layout.el.dom.scrollTop = 0;
629 // noop... - the above sometimes fails...
642 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
644 click : function (_self, e)
646 if (_this.dialog.getLayout().getRegion('west').collapsed) {
647 _this.dialog.getLayout().getRegion('west').expand();
649 _this.dialog.getLayout().getRegion('west').collapse();
655 '|xns' : 'Roo.Toolbar'
660 '|xns' : 'Roo.Toolbar'
664 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
666 click : function (_self, e)
668 if (_this.panel.region.collapsed) {
669 _this.panel.region.expand();
671 _this.panel.region.collapse();
677 '|xns' : 'Roo.Toolbar'
686 _this.form.setValues(_this.data);
690 _this.dialog.el.unmask();
691 _this.grid.getDataSource().load();
693 _this.trform.reset();
694 _this.trform1.reset();
695 _this.trform2.reset();
697 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
698 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
701 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
702 catlabel.dom.innerHTML = 'Category';
704 if(_this.data.page_type_id_name == 'category'){
705 catlabel.dom.innerHTML = 'Parent Category';
709 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
710 catlabel.dom.innerHTML = 'Parent page';
711 if(_this.data.page_type_id_name == 'category'){
712 catlabel.dom.innerHTML = 'Parent';
715 // better if this was not here... - not sure which project uses it?
717 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
718 _this.interestsCol.show();
721 if(typeof(d['interests']) != 'undefined'){
722 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
725 if(typeof(d['categories']) != 'undefined'){
726 _this.form.findField('category').setValue(Roo.decode(d['categories']));
729 if(typeof(d['page_classes']) != 'undefined'){
730 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
733 _this.trpanel.el.unmask();
734 _this.panel.el.unmask();
737 _this.cpanel.el.dom.scrollTop = 0;
739 // fix messed up scroll.
740 _this.dialog.layout.el.dom.scrollTop = 0;
743 labelAlign : 'right',
746 showHide : function()
753 var page_type_name = _this.form.findField('page_type_id_name').getValue();
755 switch(page_type_name){
778 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
779 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
780 var has_extended = _this.form.findField('has_extended').getValue() * 1;
783 is_attachment : !in_rss,
785 category_type_id : in_rss && !is_menu,
786 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
787 target_url : is_menu,
789 category : !is_category,
791 parent_id : !in_rss || is_category ,
794 to_replace_id :false, // !in_rss, // is this used.
795 is_draft : !is_system_page,
796 author_id : in_rss && !is_menu && !is_attachment,
798 template_id : !is_attachment && !is_menu && !is_system_page,
799 element_id : is_element && !is_menu,
800 menu_page_id : is_menu,
801 page_cls : is_element
803 // has_extended : !is_menu && !is_attachment, // always shown.
804 // extended : has_extended && !is_menu && !is_attachment,
805 // body : !is_attachment && !is_menu,
806 //keywords : !is_attachment && !is_menu,
807 // descriptions : !is_attachment && !is_menu
808 // extra_css : !is_attachment && !is_menu
812 var el = _this.form.findField(k);
815 Roo.log("missing field " + k);
819 el.actionMode = 'fieldEl';
829 _this.centerLayoutPanel.getLayout().getRegion('south').show();
830 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
831 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
832 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
833 _this.centerLayoutPanel.getLayout().getRegion('south').unhidePanel(3);
835 if(is_attachment || is_menu){
837 _this.centerLayoutPanel.getLayout().getRegion('south').hide();
841 if(!has_extended && !is_attachment && !is_menu){
842 _this.centerLayoutPanel.getLayout().getRegion('south').hidePanel(1);
843 _this.centerLayoutPanel.getLayout().getRegion('south').showPanel(0);
847 _this.trform.showHide();
849 if(typeof(_this.form.editors) == 'undefined'){
850 _this.form.editors = {
851 body : _this.form1.findField('body').wrap.isVisible(),
852 extended : _this.form2.findField('extended').wrap.isVisible()
855 if(_this.form.editors.body){
856 setInterval(_this.form1.findField('body').autosave, 60000);
859 if(_this.form.editors.extended){
860 setInterval(_this.form2.findField('extended').autosave, 60000);
864 if(!_this.form.editors.body && _this.form1.findField('body').wrap.isVisible()){
865 setInterval(_this.form1.findField('body').autosave, 60000);
866 _this.form.editors.body = true;
869 if(!_this.form.editors.extended && _this.form2.findField('extended').wrap.isVisible()){
870 setInterval(_this.form2.findField('extended').autosave, 60000);
871 _this.form.editors.extended = true;
877 style : 'margin: 5px',
878 url : baseURL + '/Roo/cms_page.php',
880 actioncomplete : function (_self, action)
883 if (action.type == 'setdata') {
885 _this.form.addForm(_this.form1);
886 _this.form.addForm(_this.form2);
887 _this.form.addForm(_this.form3);
888 _this.form.addForm(_this.form4);
890 _this.dialog.setStylesheets();
892 _this.dialog.getLayout().getRegion('west').collapse();
893 _this.panel.region.collapse();
895 _this.trpanel.el.mask('Save first');
896 _this.panel.el.mask('Save first');
898 _this.loaded = false;
899 _this.interestsCol.hide();
901 //_this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
903 if ( _this.data.id) {
904 _this.dialog.el.mask("Loading");
905 this.load({ method: 'GET', params: { '_id' : _this.data.id, '_with_primary_image' : 1 }});
909 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
910 this.findField('is_draft').setValue(is_draft);
911 _this.page_type.setValue(_this.data.page_type_id);
912 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
914 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
915 _this.interestsCol.show();
918 _this.form.showHide();
921 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
922 catlabel.dom.innerHTML = 'Category';
923 if(_this.data.page_type_id_name == 'category'){
924 catlabel.dom.innerHTML = 'Parent Category';
929 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
930 catlabel.dom.innerHTML = 'Parent page';
931 if(_this.data.page_type_id_name == 'category'){
932 catlabel.dom.innerHTML = 'Parent';
938 if(_this.data._is_copy){
939 _this.form.is_copy();
945 if (action.type == 'load') {
947 //_this.data = action.result.data;
949 var d = action.result.data;
951 _this.dialog.el.unmask();
952 _this.grid.getDataSource().load();
954 _this.trform.reset();
955 _this.trform1.reset();
956 _this.trform2.reset();
958 _this.trform.addForm(_this.trform1);
959 _this.trform.addForm(_this.trform2);
961 _this.form1.findField('body').originalValue = _this.form1.findField('body').getValue();
962 _this.form2.findField('extended').originalValue = _this.form2.findField('extended').getValue();
963 _this.form3.findField('extra_css').originalValue = _this.form3.findField('extra_css').getValue();
964 _this.form4.findField('keywords').originalValue = _this.form4.findField('keywords').getValue();
965 _this.form4.findField('descriptions').originalValue = _this.form4.findField('descriptions').getValue();
968 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
969 catlabel.dom.innerHTML = 'Category';
971 if(_this.data.page_type_id_name == 'category'){
972 catlabel.dom.innerHTML = 'Parent Category';
976 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
977 catlabel.dom.innerHTML = 'Parent page';
978 if(_this.data.page_type_id_name == 'category'){
979 catlabel.dom.innerHTML = 'Parent';
982 // better if this was not here... - not sure which project uses it?
984 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
985 _this.interestsCol.show();
988 if(typeof(d['interests']) != 'undefined'){
989 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
992 if(typeof(d['categories']) != 'undefined'){
993 _this.form.findField('category').setValue(Roo.decode(d['categories']));
996 if(typeof(d['page_classes']) != 'undefined'){
997 _this.form.findField('page_cls').setValue(Roo.decode(d['page_classes']));
1000 _this.trpanel.el.unmask();
1001 _this.panel.el.unmask();
1004 _this.cpanel.el.dom.scrollTop = 0;
1006 // fix messed up scroll.
1007 _this.dialog.layout.el.dom.scrollTop = 0;
1011 if (action.type =='submit') {
1013 _this.dialog.el.unmask();
1016 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
1020 _this.dialog.hide();
1023 if (_this.callback) {
1024 _this.callback.call(_this, action.result.data);
1030 actionfailed : function (_self, action)
1032 _this.dialog.el.unmask();
1033 Pman.standardActionFailed(_self, action);
1035 rendered : function (_self)
1041 '|xns' : 'Roo.form',
1048 '|xns' : 'Roo.form',
1053 labelAlign : 'right',
1055 style : 'height:30px;overflow:hidden',
1058 '|xns' : 'Roo.form',
1062 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
1071 style : 'height:30px;overflow:hidden',
1074 '|xns' : 'Roo.form',
1079 displayField : 'display_name',
1081 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
1082 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
1083 forceSelection : true,
1084 hiddenName : 'page_type_id',
1086 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1088 name : 'page_type_id_display_name',
1090 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
1091 selectOnFocus : true,
1092 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1093 triggerAction : 'all',
1097 render : function (_self)
1099 _this.page_type = _self;
1101 select : function (combo, record, index)
1103 // _this.grid.footer.onClick('first');
1104 var page_type_name = record.data.name;
1105 _this.form.findField('page_type_id_name').setValue(page_type_name);
1106 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
1107 _this.form.findField('is_attachment').setValue(0);
1111 _this.form.showHide.defer(100, _this.form);
1117 '|xns' : 'Roo.form',
1121 sortInfo : { direction : 'ASC', field: 'seqid' },
1123 beforeload : function (_self, o){
1124 o.params = o.params || {};
1126 o.params.etype = 'cms_page_type';
1130 '|xns' : 'Roo.data',
1132 xtype : 'HttpProxy',
1134 url : baseURL + '/Roo/core_enum.php',
1139 xtype : 'JsonReader',
1140 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
1143 totalProperty : 'total',
1152 style : 'padding-left: -70px;',
1155 '|xns' : 'Roo.form',
1158 xtype : 'NumberField',
1159 decimalPrecision : 0,
1160 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
1175 labelAlign : 'right',
1177 style : 'height:30px;overflow:hidden',
1180 '|xns' : 'Roo.form',
1184 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
1193 style : 'height:30px;overflow:hidden',
1196 '|xns' : 'Roo.form',
1200 boxLabel : _this._strings['f03ab16cd58372c77ba45a3d9a5a1cb9'] /* Draft */,
1201 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
1209 boxLabel : _this._strings['5834d26e96dbae06029496e5b111dca2'] /* Has Extended content? */,
1211 name : 'has_extended',
1214 check : function (_self, checked)
1219 _this.form.showHide();
1220 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
1231 boxLabel : _this._strings['2ad41a2ff4f0dac97d63aff331d5e6e7'] /* Downloads first Attachment */,
1233 name : 'is_attachment',
1236 check : function (_self, checked)
1240 _this.form.showHide.defer(100, _this.form);
1254 displayField : 'name',
1256 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1257 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1258 forceSelection : true,
1259 hiddenName : 'author_id',
1261 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1263 name : 'author_id_name',
1265 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1266 queryParam : 'query[name]',
1267 selectOnFocus : true,
1268 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
1269 triggerAction : 'all',
1274 '|xns' : 'Roo.form',
1278 sortInfo : { direction : 'ASC', field: 'name' },
1280 beforeload : function (_self, o){
1281 o.params = o.params || {};
1283 o.params.active = 1;
1284 o.params['query[is_owner]'] = 1;
1288 '|xns' : 'Roo.data',
1290 xtype : 'HttpProxy',
1292 url : baseURL + '/Roo/core_person',
1297 xtype : 'JsonReader',
1298 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
1301 totalProperty : 'total',
1308 xtype : 'ComboBoxArray',
1309 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1310 hiddenName : 'category',
1311 name : 'category_name',
1314 '|xns' : 'Roo.form',
1319 displayField : 'display_fullpath',
1321 emptyText : _this._strings['03368e3c1eb4d2a9048775874301b19f'] /* Select category */,
1322 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1323 forceSelection : true,
1327 queryParam : 'search[name]',
1328 selectOnFocus : true,
1329 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{fullpath}</b> </div>',
1330 triggerAction : 'all',
1334 '|xns' : 'Roo.form',
1338 sortInfo : { field: 'tree_sequence', direction: 'ASC' },
1340 beforeload : function (_self, o){
1341 o.params = o.params || {};
1343 o.params.page_type_id_name= 'CATEGORY';
1345 o.params._with_fullpath = 1;
1349 '|xns' : 'Roo.data',
1351 xtype : 'HttpProxy',
1353 url : baseURL + '/Roo/cms_page.php',
1358 xtype : 'JsonReader',
1360 {"name":"id","type":"int"},
1361 {"name":"name","type":"string"},
1362 {"name":"display_name","type":"string"}
1366 totalProperty : 'total',
1377 displayField : 'page_link',
1379 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
1380 fieldLabel : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1381 forceSelection : true,
1382 hiddenName : 'parent_id',
1384 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1386 name : 'parent_id_title',
1388 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1389 selectOnFocus : true,
1390 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1391 triggerAction : 'all',
1396 select : function (combo, record, index)
1398 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1399 if (page_type_name == 'page') { // page
1402 // do not default to put 'Home' at the beginning.
1403 if (!record || !(record.data.parent_id *1)) {
1406 var pl = _this.form.findField('page_link');
1407 var lk = pl.getValue();
1408 var new_link = record.data.page_link + '/';
1410 new_link += lk.split('/').pop();
1412 pl.setValue(new_link);
1417 '|xns' : 'Roo.form',
1421 sortInfo : { field: 'page_link', direction: 'ASC' },
1423 beforeload : function (_self, options)
1425 options.params['search[page_link_no_empty]'] =1;
1427 if(_this.form.findField('page_type_id').getRawValue() == 'Elements'){
1428 options.params._page_type = 'page,element';
1430 options.params.page_type_id = _this.form.findField('page_type_id').getValue() * 1;
1433 var id = _this.form.findField('id').getValue() * 1;
1436 options.params['!id'] = id;
1441 options.params.is_element = 0;
1442 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1443 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1448 '|xns' : 'Roo.data',
1450 xtype : 'HttpProxy',
1452 url : baseURL + '/Roo/cms_page.php',
1457 xtype : 'JsonReader',
1459 { name: 'id', type: 'int' },
1465 totalProperty : 'total',
1475 '|xns' : 'Roo.form',
1478 xtype : 'DateField',
1479 altFormats : 'Y-m-d H:i:s',
1480 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1488 xtype : 'TextField',
1489 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1490 name : 'to_replace_id',
1498 xtype : 'TextField',
1499 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1503 keyup : function (_self, e)
1505 if (_this.page_type.getRawValue() == 'Category') {
1507 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1516 xtype : 'TextField',
1517 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1524 xtype : 'TextField',
1525 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1526 name : 'target_url',
1535 displayField : 'template_clean',
1537 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1538 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1539 forceSelection : true,
1540 hiddenName : 'template_id',
1542 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1544 name : 'template_id_template_clean',
1546 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1547 selectOnFocus : true,
1548 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1549 triggerAction : 'all',
1554 '|xns' : 'Roo.form',
1558 sortInfo : { field: 'template', direction: 'ASC' },
1560 beforeload : function (_self, options)
1563 options.params._rescan = 1;
1564 options.params._clean_name = 1;
1565 // options.params.lang = 'en';
1566 options.params['!template[0]'] = 'master.html';
1567 //options.params['!template[1]'] = 'index.html';
1571 '|xns' : 'Roo.data',
1573 xtype : 'HttpProxy',
1575 url : baseURL + '/Roo/Cms_template',
1580 xtype : 'JsonReader',
1582 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1586 totalProperty : 'total',
1596 displayField : 'name',
1598 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1599 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1600 forceSelection : true,
1601 hiddenName : 'element_id',
1603 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1605 name : 'element_id_name',
1607 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1608 selectOnFocus : true,
1609 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1610 triggerAction : 'all',
1615 '|xns' : 'Roo.form',
1619 sortInfo : { field: 'name', direction: 'ASC' },
1621 beforeload : function (_self, options)
1623 var par = _this.form.findField('parent_id').getValue() * 1;
1625 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1629 options.params._cms_page_id = par;
1633 '|xns' : 'Roo.data',
1635 xtype : 'HttpProxy',
1637 url : baseURL + '/Roo/Cms_template_element',
1642 xtype : 'JsonReader',
1644 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1648 totalProperty : 'total',
1658 displayField : 'page_link',
1660 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1661 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1662 forceSelection : true,
1663 hiddenName : 'menu_page_id',
1665 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1667 name : 'menu_page_id_page_link',
1669 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1670 selectOnFocus : true,
1671 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>',
1672 triggerAction : 'all',
1677 '|xns' : 'Roo.form',
1681 sortInfo : { field: 'title', direction: 'ASC' },
1683 beforeload : function (_self, options)
1685 options.params = options.params || {};
1687 options.params['search[page_link_no_empty]'] =1;
1689 options.params['page_type_id_name[0]'] = 'page';
1690 options.params['page_type_id_name[1]'] = 'blog';
1692 options.params.is_element = 0;
1693 options.params.is_menuitem = 0;
1698 '|xns' : 'Roo.data',
1700 xtype : 'HttpProxy',
1702 url : baseURL + '/Roo/cms_page.php',
1707 xtype : 'JsonReader',
1722 "name":"page_type_id_display_name",
1728 totalProperty : 'total',
1735 xtype : 'ComboBoxArray',
1736 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1737 hiddenName : 'page_cls',
1738 name : 'page_cls_name',
1741 '|xns' : 'Roo.form',
1746 displayField : 'display_name',
1748 emptyText : _this._strings['14c21301c0faf9d5561b8a580be21a13'] /* Select class */,
1749 fieldLabel : _this._strings['cc6892c9705afcfa61c53698756ba51b'] /* Page Class */,
1750 forceSelection : true,
1753 queryParam : 'query[search]',
1754 selectOnFocus : true,
1755 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1756 triggerAction : 'all',
1757 valueField : 'name',
1760 '|xns' : 'Roo.form',
1764 sortInfo : { direction : 'ASC', field: 'seqid' },
1766 beforeload : function (_self, o){
1767 o.params = o.params || {};
1769 o.params.etype = 'cms_page_class';
1773 '|xns' : 'Roo.data',
1775 xtype : 'HttpProxy',
1777 url : baseURL + '/Roo/core_enum.php',
1782 xtype : 'JsonReader',
1784 {"name":"id","type":"int"},
1785 {"name":"name","type":"string"},
1786 {"name":"display_name","type":"string"}
1790 totalProperty : 'total',
1804 '|xns' : 'Roo.form',
1810 legend : _this._strings['8a53accfc94c2500b00575ce0e0d786f'] /* Primary Image */,
1811 style : 'width: 165px;',
1813 '|xns' : 'Roo.form',
1816 xtype : 'DisplayField',
1818 icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
1819 name : 'primary_image_id',
1820 style : 'border: 1px solid #ccc;',
1821 valueRenderer : function(v) {
1823 if (!v || v * 1 < 1) {
1824 return '<div style="width: 150px; height: 150px; background-color: grey;" title="Using zero order image"> </div>';
1827 return String.format('<img src="{0}/Images/Thumb/150/{1}" width="150" title="Using zero order image">', baseURL, v);
1840 render : function (_self)
1842 _this.interestsCol = _self;
1846 '|xns' : 'Roo.form',
1849 xtype : 'ComboBoxArray',
1850 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1851 hiddenName : 'interest',
1852 name : 'interest_name',
1855 render : function (_self)
1857 _this.interests = _self;
1859 _self.combo.addicon.setStyle( {
1860 position : 'absolute',
1869 '|xns' : 'Roo.form',
1874 displayField : 'display_name',
1876 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
1877 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
1878 forceSelection : true,
1881 queryParam : 'query[name]',
1882 selectOnFocus : true,
1883 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
1884 triggerAction : 'all',
1888 '|xns' : 'Roo.form',
1892 sortInfo : { direction : 'ASC', field: 'name' },
1894 beforeload : function (_self, o){
1895 o.params = o.params || {};
1896 o.params.etype = 'crm_interest';
1900 '|xns' : 'Roo.data',
1902 xtype : 'HttpProxy',
1904 url : baseURL + '/Roo/Core_enum.php',
1909 xtype : 'JsonReader',
1911 {"name":"id","type":"int"},
1912 {"name":"name","type":"string"},
1913 {"name":"display_name","type":"string"}
1917 totalProperty : 'total',
1934 name : 'is_system_page',
1940 name : 'is_menuitem',
1946 name : 'page_type_id_name',
1953 render : function (_self)
1955 _this.user_defined_fields = _self;
1966 xtype : 'ContentPanel',
1968 fitContainer : true,
1971 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1980 url : baseURL + '/Roo/cms_page.php',
1982 rendered : function (form)
1988 '|xns' : 'Roo.form',
1994 '|xns' : 'Roo.form',
1997 xtype : 'HtmlEditor',
1998 autosave : function() {
2000 var body = _this.form1.findField('body');
2002 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2003 Roo.log('body not dirty');
2007 Roo.log('body dirty, auto save!');
2009 body.fireEvent('autosave', body);
2013 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2017 white : [ 'iframe' ],
2020 autosave : function (_self)
2022 Roo.log('autosave');
2024 var id = _this.form.findField('id').getValue() * 1;
2026 if(!_self.editorcore.sourceEditMode){
2033 url : baseURL + '/Roo/Events.php',
2037 action : 'AUTOSAVE',
2038 on_id : (id > 0) ? id : 0,
2039 on_table : 'cms_page',
2041 source: _self.getValue()
2043 success : function() {
2044 _self.originalValue = _self.getValue();
2047 failure : function()
2049 //Roo.MessageBox.alert("Error", "autosave failed");
2050 Roo.log('body autosave failed?!');
2055 savedpreview : function (_self)
2057 Roo.log('saved preview');
2059 var id = _this.form.findField('id').getValue() * 1;
2061 var successFn = function(res){
2062 return res.data.POST.source;
2066 action : 'AUTOSAVE',
2068 on_id : (id < 1) ? 0 : id,
2069 on_table : 'cms_page',
2070 successFn : successFn
2074 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2075 _self.setValue(res);
2076 _self.originalValue = res;
2079 stylesheetsclick : function (_self)
2081 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2082 _this.dialog.setStylesheets();
2088 '|xns' : 'Roo.form',
2091 xtype : 'ToolbarStandard',
2092 xns : Roo.form.HtmlEditor,
2093 '|xns' : 'Roo.form.HtmlEditor',
2098 displayField : 'name',
2100 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2101 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2102 forceSelection : true,
2104 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2107 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2108 queryParam : 'search',
2109 selectOnFocus : true,
2110 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>',
2111 triggerAction : 'all',
2116 beforequery : function (combo, query, forceAll, cancel, e)
2119 var id = _this.form.findField('id').getValue() * 1;
2121 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2125 render : function (_self)
2127 _this.bodyimgselect = _self;
2129 select : function (combo, record, index)
2136 var editor = _this.form.findField('body').editorcore;
2138 var curnode = editor.getSelectedNode();
2140 if (curnode && curnode.tagName == 'IMG') {
2141 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
2142 baseURL, record.data.id, record.data.filename
2144 // note -forces an update... hopefully...
2145 editor.owner.fireEvent('editorevent', editor, false);
2148 editor.insertAtCursor(
2149 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
2150 baseURL, record.data.id, record.data.filename
2159 '|xns' : 'Roo.form',
2163 sortInfo : { direction : 'ASC', field: 'id' },
2165 beforeload : function (_self, o){
2166 o.params = o.params || {};
2168 var id = _this.form.findField('id').getValue() * 1;
2170 Roo.MessageBox.alert("Error", "Save press release first");
2174 o.params.ontable = 'cms_page';
2175 // o.params.imgtype = 'PressRelease';
2176 //o.params['query[imagesize]'] = '150x150';
2181 '|xns' : 'Roo.data',
2183 xtype : 'HttpProxy',
2185 url : baseURL + '/Roo/Images.php',
2190 xtype : 'JsonReader',
2191 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2194 totalProperty : 'total',
2203 displayField : 'page_link',
2205 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2206 forceSelection : true,
2207 hiddenName : 'add_link_id',
2209 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2213 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2214 selectOnFocus : true,
2215 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2216 triggerAction : 'all',
2221 select : function (combo, record, index)
2227 var editor = _this.form.findField('body');
2228 editor.editorcore.insertAtCursor(
2229 String.format('<a href="#page-{0}">{1}</a>',
2230 record.data.page_link, record.data.title
2238 '|xns' : 'Roo.form',
2242 sortInfo : { field: 'page_link', direction: 'ASC' },
2244 beforeload : function (_self, options)
2246 options.params['search[page_link_no_empty]'] =1;
2248 options.params.is_element = 0;
2249 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2254 '|xns' : 'Roo.data',
2256 xtype : 'HttpProxy',
2258 url : baseURL + '/Roo/cms_page.php',
2263 xtype : 'JsonReader',
2265 { name: 'id', type: 'int' },
2271 totalProperty : 'total',
2278 xtype : 'Separator',
2280 '|xns' : 'Roo.Toolbar'
2284 cls : 'x-init-enable',
2285 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2287 click : function (_self, e)
2289 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2293 '|xns' : 'Roo.Toolbar'
2298 xtype : 'ToolbarContext',
2299 xns : Roo.form.HtmlEditor,
2300 '|xns' : 'Roo.form.HtmlEditor'
2311 xtype : 'ContentPanel',
2313 fitContainer : true,
2316 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
2325 url : baseURL + '/Roo/cms_page.php',
2327 rendered : function (form)
2333 '|xns' : 'Roo.form',
2339 '|xns' : 'Roo.form',
2342 xtype : 'HtmlEditor',
2343 autosave : function() {
2345 var extended = _this.form2.findField('extended');
2347 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
2348 Roo.log('extend not dirty');
2353 Roo.log('extend dirty, auto save!');
2355 extended.fireEvent('autosave', extended);
2357 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
2361 white : [ 'iframe' ],
2364 autosave : function (_self)
2366 var id = _this.form.findField('id').getValue() * 1;
2369 if(!_self.editorcore.sourceEditMode){
2376 url : baseURL + '/Roo/Events.php',
2380 action : 'AUTOSAVE',
2381 on_id : (id > 0) ? id : 0,
2382 on_table : 'cms_page',
2383 remarks : 'EXTENDED',
2384 source: _self.getValue()
2386 success : function() {
2387 _self.originalValue = _self.getValue();
2390 failure : function()
2392 //Roo.MessageBox.alert("Error", "autosave failed");
2393 Roo.log('extended autosave failed?!');
2397 savedpreview : function (_self)
2399 var id = _this.form.findField('id').getValue() * 1;
2401 var successFn = function(res){
2402 return res.data.POST.source;
2406 action : 'AUTOSAVE',
2407 remarks : 'EXTENDED',
2408 on_id : (id < 1) ? 0 : id,
2409 on_table : 'cms_page',
2410 successFn : successFn
2414 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2415 _self.setValue(res);
2416 _self.originalValue = res;
2419 stylesheetsclick : function (_self)
2421 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2422 _this.dialog.setStylesheets();
2428 '|xns' : 'Roo.form',
2431 xtype : 'ToolbarStandard',
2432 xns : Roo.form.HtmlEditor,
2433 '|xns' : 'Roo.form.HtmlEditor',
2438 displayField : 'name',
2440 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
2441 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
2442 forceSelection : true,
2444 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2447 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
2448 selectOnFocus : true,
2449 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
2450 triggerAction : 'all',
2455 beforequery : function (combo, query, forceAll, cancel, e)
2458 var id = _this.form.findField('id').getValue() * 1;
2460 Roo.MessageBox.alert("Error", "Save Document First before adding images");
2464 render : function (_self)
2466 _this.extendimgselect = _self;
2468 select : function (combo, record, index)
2475 var editor = _this.form.findField('extended').editorcore;
2477 var curnode = editor.getSelectedNode();
2479 if (curnode && curnode.tagName == 'IMG') {
2480 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
2481 baseURL, record.data.id, record.data.filename
2483 // note -forces an update... hopefully...
2484 editor.owner.fireEvent('editorevent', editor, false);
2487 editor.insertAtCursor(
2488 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
2489 baseURL, record.data.id, record.data.filename
2498 '|xns' : 'Roo.form',
2502 sortInfo : { direction : 'ASC', field: 'id' },
2504 beforeload : function (_self, o){
2505 o.params = o.params || {};
2507 var id = _this.form.findField('id').getValue() * 1;
2509 Roo.MessageBox.alert("Error", "Save press release first");
2513 o.params.ontable = 'cms_page';
2514 // o.params.imgtype = 'PressRelease';
2515 //o.params['query[imagesize]'] = '150x150';
2520 '|xns' : 'Roo.data',
2522 xtype : 'HttpProxy',
2524 url : baseURL + '/Roo/Images.php',
2529 xtype : 'JsonReader',
2530 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
2533 totalProperty : 'total',
2542 displayField : 'page_link',
2544 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
2545 forceSelection : true,
2546 hiddenName : 'add_link_id',
2548 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2552 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
2553 selectOnFocus : true,
2554 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
2555 triggerAction : 'all',
2560 select : function (combo, record, index)
2566 var editor = _this.form.findField('body');
2567 editor.editorcore.insertAtCursor(
2568 String.format('<a href="#page-{0}">{1}</a>',
2569 record.data.page_link, record.data.title
2577 '|xns' : 'Roo.form',
2581 sortInfo : { field: 'page_link', direction: 'ASC' },
2583 beforeload : function (_self, options)
2585 options.params['search[page_link_no_empty]'] =1;
2587 options.params.is_element = 0;
2588 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
2593 '|xns' : 'Roo.data',
2595 xtype : 'HttpProxy',
2597 url : baseURL + '/Roo/cms_page.php',
2602 xtype : 'JsonReader',
2604 { name: 'id', type: 'int' },
2610 totalProperty : 'total',
2617 xtype : 'Separator',
2619 '|xns' : 'Roo.Toolbar'
2623 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
2625 click : function (_self, e)
2627 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
2631 '|xns' : 'Roo.Toolbar'
2636 xtype : 'ToolbarContext',
2637 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
2638 xns : Roo.form.HtmlEditor,
2639 '|xns' : 'Roo.form.HtmlEditor'
2650 xtype : 'ContentPanel',
2652 fitContainer : true,
2655 title : _this._strings['d8e4d1f5e445107e505b2cf63a1fb65c'] /* Extra CSS */,
2664 url : baseURL + '/Roo/cms_page.php',
2666 rendered : function (form)
2672 '|xns' : 'Roo.form',
2678 '|xns' : 'Roo.form',
2682 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2696 xtype : 'ContentPanel',
2698 fitContainer : true,
2701 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
2710 url : baseURL + '/Roo/cms_page.php',
2712 rendered : function (form)
2718 '|xns' : 'Roo.form',
2723 '|xns' : 'Roo.form',
2727 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2736 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2738 name : 'descriptions',
2753 xtype : 'GridPanel',
2755 fitContainer : true,
2758 tableName : 'Images',
2759 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2761 activate : function() {
2764 _this.grid.footer.onClick('first');
2771 xtype : 'EditorGrid',
2772 autoExpandColumn : 'title',
2776 render : function() {
2778 //_this.dialog = Pman.Dialog.FILL_IN
2779 if (_this.panel.active) {
2780 //this.footer.onClick('first');
2783 rowdblclick : function (_self, rowIndex, e)
2785 var rd = _this.grid.getDataSource().getAt(rowIndex);
2786 var id = rd.data.id;
2787 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2788 _this.form.findField('contents').execCmd('insertimage', url);
2793 '|xns' : 'Roo.grid',
2801 cls : 'x-btn-text-icon',
2802 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2803 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2807 var id = _this.form.findField('id').getValue() * 1;
2813 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2814 _this.grid.ds.load({});
2824 cls : 'x-btn-text-icon',
2825 icon : rootURL + '/Pman/templates/images/trash.gif',
2826 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2830 var selection = _this.grid.getSelectionModel().getSelectedCell();
2831 var sn = _this.grid.ds.getAt(selection[0]);
2832 if (!sn || isNaN(sn.id *1)) {
2833 Roo.MessageBox.alert("Error", "Select a image");
2836 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2842 url : baseURL + '/Roo/Images.php',
2847 success : function()
2849 Roo.log('Got Success!!');
2850 _this.grid.ds.load({});
2864 beforeload : function (_self, o)
2866 var id = _this.form.findField('id').getValue() * 1;
2872 o.params = o.params || {};
2873 o.params.limit = 9999;
2875 o.params.ontable = 'cms_page';
2877 update : function (_self, rec, operation)
2881 url : baseURL+'/Roo/Images.php',
2884 success: function(res)
2886 Roo.log("GOT success");
2887 // update the data...
2888 _this.grid.ds.load({});
2890 failure : function(res)
2892 Roo.MessageBox.alert('Error', res.errorMsg);
2893 _this.grid.ds.load({});
2901 '|xns' : 'Roo.data',
2903 xtype : 'HttpProxy',
2905 url : baseURL + '/Roo/Images.php',
2910 xtype : 'JsonReader',
2945 'name': 'displayorder',
2953 'name': 'parent_image_id',
2959 'dateFormat': 'Y-m-d'
2978 'name': 'parent_image_id_id',
2982 'name': 'parent_image_id_filename',
2986 'name': 'parent_image_id_ontable',
2990 'name': 'parent_image_id_onid',
2994 'name': 'parent_image_id_mimetype',
2998 'name': 'parent_image_id_width',
3002 'name': 'parent_image_id_height',
3006 'name': 'parent_image_id_filesize',
3010 'name': 'parent_image_id_displayorder',
3014 'name': 'parent_image_id_language',
3018 'name': 'parent_image_id_parent_image_id',
3022 'name': 'parent_image_id_created',
3026 'name': 'parent_image_id_imgtype',
3030 'name': 'parent_image_id_linkurl',
3034 'name': 'parent_image_id_descript',
3038 'name': 'parent_image_id_title',
3044 totalProperty : 'total',
3051 xtype : 'ColumnModel',
3053 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
3054 renderer : function(v,x,r) {
3055 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
3063 xtype : 'ColumnModel',
3064 dataIndex : 'filename',
3065 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
3066 renderer : function(v) { return String.format('{0}', v); },
3072 xtype : 'ColumnModel',
3073 dataIndex : 'displayorder',
3074 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
3075 renderer : function(v) { return String.format('{0}', v); },
3078 '|xns' : 'Roo.grid',
3080 xtype : 'GridEditor',
3082 '|xns' : 'Roo.grid',
3084 xtype : 'NumberField',
3085 decimalPrecision : 0,
3087 focus : function (_self)
3089 if (this.value == 0) {
3090 this.el.dom.value = '';
3100 xtype : 'ColumnModel',
3101 dataIndex : 'title',
3102 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3103 renderer : function(v) { return String.format('{0}', v); },
3106 '|xns' : 'Roo.grid',
3108 xtype : 'GridEditor',
3110 '|xns' : 'Roo.grid',
3112 xtype : 'TextField',
3119 xtype : 'ColumnModel',
3120 dataIndex : 'linkurl',
3121 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
3122 renderer : function(v)
3124 return String.format('{0}', (v) ? v : '');
3128 '|xns' : 'Roo.grid',
3130 xtype : 'GridEditor',
3132 '|xns' : 'Roo.grid',
3134 xtype : 'TextField',
3144 xtype : 'NestedLayoutPanel',
3146 fitContainer : true,
3150 render : function (_self)
3152 _this.westLayoutPanel = this;
3159 xtype : 'BorderLayout',
3163 xtype : 'LayoutRegion',
3164 tabPosition : 'top',
3169 xtype : 'LayoutRegion',
3172 tabPosition : 'top',
3178 xtype : 'ContentPanel',
3183 render : function (_self)
3185 _this.trpanel = _self;
3187 resize : function (_self, width, height)
3189 Roo.log('resize called');
3191 var ew = Math.max(250, width - 10);
3192 var eh = _this.westLayoutPanel.getLayout().getRegion('south').el.getHeight() - 30;
3195 if (!_this.trform) {
3199 var bd = _this.trform1.findField('body');
3204 // since render delays resize..
3205 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3206 // _this.trbodycol.el.setWidth(bd.width+20);
3208 var bd = _this.trform2.findField('extended');
3212 // since render delays resize..
3213 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
3214 // _this.trextendcol.el.setWidth(bd.width+20);
3224 labelAlign : 'right',
3227 showHide : function() {
3229 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
3230 var has_extended = _this.form.findField('has_extended').getValue() * 1;
3231 var has_lang = _this.trform.findField('language').getValue().length;
3233 _this.westLayoutPanel.getLayout().getRegion('south').show();
3234 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(0);
3235 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(1);
3236 _this.westLayoutPanel.getLayout().getRegion('south').unhidePanel(2);
3239 _this.westLayoutPanel.getLayout().getRegion('south').hide();
3242 if(!has_extended && has_lang){
3243 _this.westLayoutPanel.getLayout().getRegion('south').hidePanel(1);
3244 _this.westLayoutPanel.getLayout().getRegion('south').showPanel(0);
3252 var el = _this.trform.findField(k);
3253 el.actionMode = 'fieldEl';
3255 Roo.log("show: " + k);
3258 Roo.log("hide: " + k);
3263 _this.updateRow.el[has_lang ? 'show' : 'hide']();
3266 if(typeof(_this.trform.editors) == 'undefined'){
3267 _this.trform.editors = {
3268 body : _this.trform1.findField('body').wrap.isVisible(),
3269 extended : _this.trform2.findField('extended').wrap.isVisible()
3271 if(_this.trform.editors.body){
3272 setInterval(_this.trform1.findField('body').autosave, 60000);
3275 if(_this.trform.editors.extended){
3276 setInterval(_this.trform2.findField('extended').autosave, 60000);
3280 if(!_this.trform.editors.body && _this.trform1.findField('body').wrap.isVisible()){
3281 setInterval(_this.trform1.findField('body').autosave, 60000);
3282 _this.trform.editors.body = true;
3285 if(!_this.trform.editors.extended && _this.trform2.findField('extended').wrap.isVisible()){
3286 setInterval(_this.trform2.findField('extended').autosave, 60000);
3287 _this.trform.editors.extended = true;
3292 style : 'margin: 5px',
3293 trackResetOnLoad : true,
3294 url : baseURL + '/Roo/cms_page.php',
3296 actioncomplete : function (_self, action)
3298 if (action.type =='submit') {
3302 if (action.type == 'setdata') {
3303 _this.trform.addForm(_this.trform1);
3304 _this.trform.addForm(_this.trform2);
3305 _this.trform.addForm(_this.trform3);
3307 if ( _this.data.id) {
3309 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
3311 this.trpanel.el.mask("save first");
3318 if (action.type == 'load') {
3319 // _this.dialog.el.unmask();
3322 _this.trform1.findField('body').originalValue = _this.trform1.findField('body').getValue();
3323 _this.trform2.findField('extended').originalValue = _this.trform2.findField('extended').getValue();
3324 _this.trform3.findField('keywords').originalValue = _this.trform3.findField('keywords').getValue();
3325 _this.trform3.findField('descriptions').originalValue = _this.trform3.findField('descriptions').getValue();
3330 actionfailed : function (_self, action)
3332 _this.dialog.el.unmask();
3334 Pman.standardActionFailed(_self, action);
3336 rendered : function (_self)
3338 _this.trform = _self;
3342 '|xns' : 'Roo.form',
3349 '|xns' : 'Roo.form',
3356 '|xns' : 'Roo.form',
3361 displayField : 'language_name',
3363 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3364 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3365 forceSelection : true,
3366 hiddenName : 'language',
3368 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3370 name : 'language_name',
3372 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
3373 selectOnFocus : true,
3374 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
3375 triggerAction : 'all',
3377 valueField : 'language',
3379 add : function (combo)
3381 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
3384 _this.trform.reset();
3385 _this.trform1.reset();
3386 _this.trform2.reset();
3388 combo.setValue(res.lang);
3389 combo.el.dom.value = res.lang_name;
3392 _this.trform.showHide();
3393 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3398 render : function (_self)
3400 _this.language = _self;
3402 select : function (combo, record, index)
3405 _this.trform.showHide();
3406 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
3413 'lookup[language]' : record.data.language,
3414 'lookup[translation_of_id]' : _this.data.id,
3421 '|xns' : 'Roo.form',
3425 sortInfo : { direction : 'ASC', field: 'language' },
3427 beforeload : function (_self, o){
3428 o.params = o.params || {};
3430 o.params._distinct = 'language';
3431 o.params._columns ='language_name,language';
3432 o.params._with_name = true;
3434 if(_this.form.findField('id').getValue()*1 > 0){
3435 o.params.translation_of_id = _this.form.findField('id').getValue();
3441 '|xns' : 'Roo.data',
3443 xtype : 'HttpProxy',
3445 url : baseURL + '/Roo/Cms_page.php',
3450 xtype : 'JsonReader',
3451 fields : [{"name":"language","type":"string"}],
3454 totalProperty : 'total',
3462 style : 'padding-top:12px;padding-left:30px;float:left',
3465 render : function (_self)
3467 _this.updateRow = _self;
3471 '|xns' : 'Roo.form',
3475 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
3479 // _this.dialog.el.mask("Saving");
3480 if(!_this.trform1.findField('body').editorcore.sourceEditMode){
3481 _this.trform1.findField('body').syncValue();
3482 _this.trform2.findField('extended').syncValue();
3484 _this.trform1.findField('body').pushValue();
3485 _this.trform2.findField('extended').pushValue();
3488 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
3489 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
3490 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
3491 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
3492 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
3494 if(_this.trform.findField('element_id').getValue()*1 > 0){
3495 _this.trform.findField('is_element').setValue(1);
3498 _this.trform.doAction("submit");
3509 xtype : 'TextField',
3510 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
3526 name : 'element_id',
3532 name : 'menu_page_id',
3538 name : 'is_menuitem',
3544 name : 'is_element',
3551 name : 'translation_of_id',
3566 xtype : 'ContentPanel',
3568 fitContainer : true,
3571 title : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3580 url : baseURL + '/Roo/cms_page.php',
3582 rendered : function (form)
3584 _this.trform1 = form;
3588 '|xns' : 'Roo.form',
3594 '|xns' : 'Roo.form',
3597 xtype : 'HtmlEditor',
3598 autosave : function() {
3600 var body = _this.trform1.findField('body');
3602 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
3603 Roo.log('tr body not dirty');
3607 Roo.log('tr body dirty, auto save!');
3609 body.fireEvent('autosave', body);
3611 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
3615 white : [ 'iframe' ],
3617 autosave : function (_self)
3619 var id = _this.trform.findField('id').getValue() * 1;
3622 if(!_self.editorcore.sourceEditMode){
3629 url : baseURL + '/Roo/Events.php',
3633 action : 'AUTOSAVE',
3634 on_id : (id > 0) ? id : 0,
3635 on_table : 'cms_page',
3637 source: _self.getValue()
3639 success : function() {
3640 _self.originalValue = _self.getValue();
3643 failure : function()
3645 //Roo.MessageBox.alert("Error", "autosave failed");
3646 Roo.log('tr body autosave failed?!');
3650 savedpreview : function (_self)
3652 var id = _this.trform.findField('id').getValue() * 1;
3654 var successFn = function(res){
3655 return res.data.POST.source;
3659 action : 'AUTOSAVE',
3661 on_id : (id < 1) ? 0 : id,
3662 on_table : 'cms_page',
3663 successFn : successFn
3667 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3668 _self.setValue(res);
3669 _self.originalValue = res;
3672 stylesheetsclick : function (_self)
3674 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3675 _this.dialog.setStylesheets();
3681 '|xns' : 'Roo.form',
3684 xtype : 'ToolbarStandard',
3685 xns : Roo.form.HtmlEditor,
3686 '|xns' : 'Roo.form.HtmlEditor',
3691 displayField : 'name',
3693 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3694 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3695 forceSelection : true,
3697 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3700 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3701 selectOnFocus : true,
3702 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>',
3703 triggerAction : 'all',
3708 beforequery : function (combo, query, forceAll, cancel, e)
3711 var id = _this.form.findField('id').getValue() * 1;
3713 Roo.MessageBox.alert("Error", "Save press release first");
3717 render : function (_self)
3719 _this.trbodyimgselect = _self;
3721 select : function (combo, record, index)
3728 var editor = _this.trform.findField('body').editorcore;
3730 var curnode = editor.getSelectedNode();
3732 if (curnode && curnode.tagName == 'IMG') {
3733 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3734 baseURL, record.data.id, record.data.filename
3736 // note -forces an update... hopefully...
3737 editor.owner.fireEvent('editorevent', editor, false);
3740 editor.insertAtCursor(
3741 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3742 baseURL, record.data.id, record.data.filename
3751 '|xns' : 'Roo.form',
3755 sortInfo : { direction : 'ASC', field: 'id' },
3757 beforeload : function (_self, o){
3758 o.params = o.params || {};
3760 var id = _this.form.findField('id').getValue() * 1;
3762 Roo.MessageBox.alert("Error", "Save press release first");
3766 o.params.ontable = 'cms_page';
3767 // o.params.imgtype = 'PressRelease';
3768 //o.params['query[imagesize]'] = '150x150';
3773 '|xns' : 'Roo.data',
3775 xtype : 'HttpProxy',
3777 url : baseURL + '/Roo/Images.php',
3782 xtype : 'JsonReader',
3783 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3786 totalProperty : 'total',
3795 displayField : 'page_link',
3797 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3798 forceSelection : true,
3799 hiddenName : 'add_link_id',
3801 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3805 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3806 selectOnFocus : true,
3807 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3808 triggerAction : 'all',
3813 select : function (combo, record, index)
3819 var editor = _this.form.findField('body');
3820 editor.insertAtCursor(
3821 String.format('<a href="#page-{0}">{1}</a>',
3822 record.data.page_link, record.data.title
3830 '|xns' : 'Roo.form',
3834 sortInfo : { field: 'page_link', direction: 'ASC' },
3836 beforeload : function (_self, options)
3838 options.params['search[page_link_no_empty]'] =1;
3840 options.params.is_element = 0;
3841 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3846 '|xns' : 'Roo.data',
3848 xtype : 'HttpProxy',
3850 url : baseURL + '/Roo/cms_page.php',
3855 xtype : 'JsonReader',
3857 { name: 'id', type: 'int' },
3863 totalProperty : 'total',
3870 xtype : 'Separator',
3872 '|xns' : 'Roo.Toolbar'
3876 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3878 click : function (_self, e)
3880 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3884 '|xns' : 'Roo.Toolbar'
3889 xtype : 'ToolbarContext',
3890 xns : Roo.form.HtmlEditor,
3891 '|xns' : 'Roo.form.HtmlEditor'
3902 xtype : 'ContentPanel',
3904 fitContainer : true,
3907 title : _this._strings['76eb64a1725ee953c664e15c9213b2fd'] /* Extended Content */,
3916 url : baseURL + '/Roo/cms_page.php',
3918 rendered : function (form)
3920 _this.trform2 = form;
3924 '|xns' : 'Roo.form',
3930 '|xns' : 'Roo.form',
3933 xtype : 'HtmlEditor',
3934 autosave : function() {
3936 var extended = _this.trform2.findField('extended');
3938 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3939 Roo.log('tr extend not dirty');
3944 Roo.log('tr extend dirty, auto save!');
3946 extended.fireEvent('autosave', extended);
3950 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3954 white : [ 'iframe' ],
3956 autosave : function (_self)
3958 var id = _this.trform.findField('id').getValue() * 1;
3961 if(!_self.editorcore.sourceEditMode){
3969 url : baseURL + '/Roo/Events.php',
3973 action : 'AUTOSAVE',
3974 on_id : (id > 0) ? id : 0,
3975 on_table : 'cms_page',
3976 remarks : 'EXTENDED',
3977 source: _self.getValue()
3979 success : function() {
3980 _self.originalValue = _self.getValue();
3983 failure : function()
3985 //Roo.MessageBox.alert("Error", "autosave failed");
3986 Roo.log('tr extended autosave failed?!');
3990 savedpreview : function (_self)
3992 var id = _this.trform.findField('id').getValue() * 1;
3994 var successFn = function(res){
3995 return res.data.POST.source;
3999 action : 'AUTOSAVE',
4000 remarks : 'EXTENDED',
4001 on_id : (id < 1) ? 0 : id,
4002 on_table : 'cms_page',
4003 successFn : successFn
4007 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
4008 _self.setValue(res);
4009 _self.originalValue = res;
4012 stylesheetsclick : function (_self)
4014 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
4015 _this.dialog.setStylesheets();
4021 '|xns' : 'Roo.form',
4024 xtype : 'ToolbarStandard',
4025 xns : Roo.form.HtmlEditor,
4026 '|xns' : 'Roo.form.HtmlEditor',
4029 xtype : 'Separator',
4031 '|xns' : 'Roo.Toolbar'
4035 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
4037 click : function (_self, e)
4039 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
4043 '|xns' : 'Roo.Toolbar'
4048 xtype : 'ToolbarContext',
4049 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
4050 xns : Roo.form.HtmlEditor,
4051 '|xns' : 'Roo.form.HtmlEditor'
4062 xtype : 'ContentPanel',
4064 fitContainer : true,
4067 title : _this._strings['98e93e8f7adfe14832db6caed713d849'] /* Meta Tags */,
4076 url : baseURL + '/Roo/cms_page.php',
4078 rendered : function (form)
4080 _this.trform3 = form;
4084 '|xns' : 'Roo.form',
4089 '|xns' : 'Roo.form',
4093 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
4102 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
4104 name : 'descriptions',