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.CmsBlog');
7 Pman.Dialog.CmsBlog.Old = {
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 '779e2624ddf330fb05b51ae59faf212d' :"Select Status Type",
19 '6a5b847af3d97df722040debdbccfbed' :"Page Type",
20 '30d1a216420426fcbd43ca70acd4aa48' :"Select interests",
21 'e6b391a8d2c4d45902a23a8b6585703d' :"URL",
22 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
23 '778551900655782c5c7827332b08cf3f' :"Save and close",
24 '77174410b72decfd0b259961f1f65a8f' :"Attributes:",
25 'b28a711cf7e94ec793ef926633997529' :"Seq",
26 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
27 '580b21aac58f1b73cece26e272cdfbee' :"Add Link",
28 '8bc84316c4078bf66723fd019616d920' :"Descriptions",
29 '83dad8107f9459efe2b4fabcf5b63108' :"Select Language",
30 '76729937a5eb6b0fd88c42581161facd' :"Select Category ",
31 '76729937a5eb6b0fd88c42581161facd' :"Select Category",
32 '0b8d92bc19b720bb1065649535463409' :"Translations",
33 'd41d8cd98f00b204e9800998ecf8427e' :"",
34 '867343577fa1f33caa632a19543bd252' :"Keywords",
35 '340c2ee497b85d5954b01c64de7f44f6' :"Select Person",
36 '69dd756ae9c23191a5bb9b61f0857432' :"Date to Publish",
37 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
38 '57e195426892c5515935f21d97228814' :"Extended Contents",
39 'd88aa1eee60ba140f07d5f81769cec74' :"<< Edit Translations",
40 'b9c49611cfda3259a2b837b39489e650' :"Add Image",
41 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
42 'cfcd208495d565ef66e7dff9f98764da' :"0",
43 'aa6356b678bc4fc78253c9edf65bff03' :"Edit Page / Blog Entry ",
44 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
45 '70a4bc2672e2e3912e6476a2bd7ba29b' :"Parent page",
46 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
47 'c02bd0c22c290ae599ee2f3ff2023fd3' :"Manage Images / Attachments >>",
48 'b78a3223503896721cca1303f776159b' :"Title",
49 '39f64cc9436cacfbceda3b7bdeb8e24c' :"Styles (CSS)",
50 'e64df1d7c22b9638f084ce8a4aff3ff3' :"Target URL",
51 'a240fa27925a635b08dc28c9e4f9216d' :"Order",
52 '287234a1ff35a314b5b6bc4e5828e745' :"Attributes",
53 '99e7707748ae048e17c5810fad119e0b' :"Select Page",
54 '06933067aafd48425d67bcb01bba5cb6' :"Update",
55 '8adedb6a6226807ba810215dd3b3c61b' :"Menu links to Page",
56 'b5216c9b4e0ac0afd9c76eb1d12ad1b9' :"Select Section",
57 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
58 '1351017ac6423911223bc19a8cb7c653' :"Filename",
59 'c9cc8cce247e49bae79f15173ce97354' :"Save",
60 'e659b52eba1f0299b2d8ca3483919e72' :"Type:",
61 'c70952e4ab3806c049737cd7d2b8896b' :"Interests",
62 'd52f80f80467bb575253a5a39ca016a7' :"Page link / Name / Order",
63 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images",
64 'fb3f11443065d5f4d8303ad913db9680' :"Replaces (ignore)"
70 show : function(data, cb)
78 this.dialog.show(this.data._el);
81 this.form.setValues(data);
82 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
90 this.dialog = Roo.factory({
91 xtype : 'LayoutDialog',
98 setStylesheets : function() {
101 sheets.push(rootURL + '/Pman/Cms/templates/undoreset.css');
103 if(typeof(uiConfig) !== 'undefined' && typeof(uiConfig.cms_css) != 'undefined'){
104 Roo.each(uiConfig.cms_css, function(v){
105 sheets.push(rootURL + v);
110 url : baseURL + '/Roo/Cms_page.php',
115 success : function(res) {
117 if(res.data._stylesheets.length){
118 var setting = res.data._stylesheets.split("\n");
120 Roo.each(setting, function(s){
121 sheets.push(s.replace('{rootURL}', rootURL));
126 Roo.log(_this.form.findField('body'));
127 _this.form.findField('body').removeStylesheets();
128 _this.form.findField('extended').removeStylesheets();
130 _this.form.findField('body').setStylesheets(sheets);
131 _this.form.findField('extended').setStylesheets(sheets);
133 _this.trform.findField('body').removeStylesheets();
134 _this.trform.findField('extended').removeStylesheets();
136 _this.trform.findField('body').setStylesheets(sheets);
137 _this.trform.findField('extended').setStylesheets(sheets);
142 title : _this._strings['aa6356b678bc4fc78253c9edf65bff03'] /* Edit Page / Blog Entry */,
145 show : function (_self)
147 // @see the contentpanel - center - resize handler.
149 var w = Roo.lib.Dom.getViewWidth();
150 var h = Roo.lib.Dom.getViewHeight();
151 this.resizeTo(w-50, h-50);
154 var ew = Math.max(250, w-150); // was 350?/ why?
155 var eh = Math.max(250, h-350) ;
157 var bd = _this.form.findField('body');
161 // since render delays resize..
162 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
163 _this.bodycol.el.setWidth(bd.width+20);
165 var bd = _this.form.findField('extended');
169 // since render delays resize..
170 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
171 _this.extendcol.el.setWidth(bd.width+20);
173 var bd = _this.form.findField('extra_css');
176 _this.keywordscol.el.setWidth(ew+20);
178 Pman.Cms.pageEditAddCustomFields();
179 // fix messed up scroll.
180 _this.dialog.layout.el.dom.scrollTop = 0;
188 xtype : 'LayoutRegion',
194 xtype : 'LayoutRegion',
196 collapsedTitle : 'Images / Attachments',
200 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
203 expanded : function (_self)
205 var id = _this.form.findField('id').getValue() * 1;
208 Roo.MessageBox.alert('Error', 'Save first');
213 var w = Roo.lib.Dom.getViewWidth();
214 var h = Roo.lib.Dom.getViewHeight();
216 _self.resizeTo.defer(110, _self,[ w-400, h] );
217 _this.trpanel.region.collapse();
224 xtype : 'LayoutRegion',
226 collapsedTitle : 'Translations',
230 title : _this._strings['0b8d92bc19b720bb1065649535463409'] /* Translations */,
233 expanded : function (_self)
235 var id = _this.form.findField('id').getValue() * 1;
238 Roo.MessageBox.alert('Error', 'Save first');
243 var w = Roo.lib.Dom.getViewWidth();
244 var h = Roo.lib.Dom.getViewHeight();
246 _self.resizeTo.defer(110, _self,[ w-400, h-350] );
248 _this.panel.region.collapse();
258 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
273 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
279 _this.dialog.el.mask("Saving");
281 if(!_this.form.findField('body').editorcore.sourceEditMode){
282 _this.form.findField('body').syncValue();
283 _this.form.findField('extended').syncValue();
285 _this.form.findField('body').pushValue();
286 _this.form.findField('extended').pushValue();
289 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
290 _this.interests.reset();
293 _this.form.doAction("submit");
302 text : _this._strings['778551900655782c5c7827332b08cf3f'] /* Save and close */,
308 _this.dialog.el.mask("Saving");
310 if(!_this.form.findField('body').editorcore.sourceEditMode){
311 _this.form.findField('body').syncValue();
312 _this.form.findField('extended').syncValue();
314 _this.form.findField('body').pushValue();
315 _this.form.findField('extended').pushValue();
318 if(_this.data.page_type_id_name != 'blog' && AppModules.indexOf("Crm") == -1){
319 _this.interests.reset();
322 _this.form.doAction("submit");
332 xtype : 'ContentPanel',
337 render : function (_self)
339 _this.cpanel = _self;
341 resize : function (_self, width, height)
343 Roo.log("RESIZE, " + width + ',' + height);
345 var ew = Math.max(250, width-50);
346 var eh = Math.max(250,height-50) ;
351 var bd = _this.form.findField('body');
355 // since render delays resize..
356 Roo.log('resizing body to ' + bd.width);
357 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
358 _this.bodycol.el.setWidth(bd.width+20);
362 bd = _this.form.findField('extended');
367 Roo.log('resizing extended to ' + bd.width);
368 // since render delays resize..
369 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
370 _this.extendcol.el.setWidth(bd.width+20);
372 bd = _this.form.findField('extra_css');
375 _this.keywordscol.el.setWidth(ew+20);
377 // fix for messed up rendering of dialog?
378 _this.dialog.layout.el.dom.scrollTop = 0;
390 text : _this._strings['d88aa1eee60ba140f07d5f81769cec74'] /* << Edit Translations */,
392 click : function (_self, e)
394 if (_this.trpanel.region.collapsed) {
395 _this.trpanel.region.expand();
397 _this.trpanel.region.collapse();
403 '|xns' : 'Roo.Toolbar'
408 '|xns' : 'Roo.Toolbar'
412 text : _this._strings['c02bd0c22c290ae599ee2f3ff2023fd3'] /* Manage Images / Attachments >> */,
414 click : function (_self, e)
416 if (_this.panel.region.collapsed) {
417 _this.panel.region.expand();
419 _this.panel.region.collapse();
425 '|xns' : 'Roo.Toolbar'
432 labelAlign : 'right',
435 showHide : function()
441 var page_type_name = _this.form.findField('page_type_id_name').getValue();
442 switch(page_type_name){
465 var is_system_page = _this.form.findField('is_system_page').getValue() * 1;
466 var is_attachment = _this.form.findField('is_attachment').getValue() * 1;
467 var has_extended = _this.form.findField('has_extended').getValue() * 1;
470 is_attachment : !in_rss,
472 category_type_id : in_rss && !is_menu,
473 page_link : 1, //!in_rss, // always show page link.. may not be needed though..
474 target_url : is_menu,
476 category_page_id : !is_category,
478 parent_id : !in_rss || is_category ,
481 to_replace_id :false, // !in_rss, // is this used.
482 is_draft : !is_system_page,
483 author_id : in_rss && !is_menu && !is_attachment,
485 template_id : !is_attachment && !is_menu && !is_system_page,
486 element_id : is_element && !is_menu,
487 menu_page_id : is_menu,
489 has_extended : !is_menu && !is_attachment, // always shown.
490 extended : has_extended && !is_menu && !is_attachment,
491 body : !is_attachment && !is_menu,
492 keywords : !is_attachment && !is_menu,
493 descriptions : !is_attachment && !is_menu,
494 extra_css : !is_attachment && !is_menu
498 var el = _this.form.findField(k);
500 Roo.log("missing field " + k);
503 el.actionMode = 'fieldEl';
513 _this.trform.showHide();
515 if(typeof(_this.form.editors) == 'undefined'){
516 _this.form.editors = {
517 body : _this.form.findField('body').wrap.isVisible(),
518 extended : _this.form.findField('extended').wrap.isVisible()
521 if(_this.form.editors.body){
522 setInterval(_this.form.findField('body').autosave, 60000);
525 if(_this.form.editors.extended){
526 setInterval(_this.form.findField('extended').autosave, 60000);
530 if(!_this.form.editors.body && _this.form.findField('body').wrap.isVisible()){
531 setInterval(_this.form.findField('body').autosave, 60000);
532 _this.form.editors.body = true;
535 if(!_this.form.editors.extended && _this.form.findField('extended').wrap.isVisible()){
536 setInterval(_this.form.findField('extended').autosave, 60000);
537 _this.form.editors.extended = true;
543 style : 'margin: 5px',
544 url : baseURL + '/Roo/cms_page.php',
546 actioncomplete : function (_self, action)
549 if (action.type == 'setdata') {
551 _this.dialog.setStylesheets();
553 _this.trpanel.region.collapse();
554 _this.panel.region.collapse();
556 _this.trpanel.el.mask('Save first');
557 _this.panel.el.mask('Save first');
559 _this.loaded = false;
560 _this.interestsCol.hide();
562 _this.form.findField('category_page_id').fieldEl.select('label',true).first().dom.innerHTML = 'Category';
564 if ( _this.data.id) {
565 _this.dialog.el.mask("Loading");
566 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
570 var is_draft = typeof(_this.data.is_draft) != 'undefined' ? _this.data.is_draft : 1;
571 this.findField('is_draft').setValue(is_draft);
572 _this.page_type.setValue(_this.data.page_type_id);
573 _this.page_type.el.dom.value = _this.data.page_type_id_display_name;
575 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
576 _this.interestsCol.show();
579 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
580 catlabel.dom.innerHTML = 'Category';
581 if(_this.data.page_type_id_name == 'category'){
582 catlabel.dom.innerHTML = 'Parent Category';
585 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
586 catlabel.dom.innerHTML = 'Parent page';
587 if(_this.data.page_type_id_name == 'category'){
588 catlabel.dom.innerHTML = 'Parent';
594 if (action.type == 'load') {
596 //_this.data = action.result.data;
598 var d = action.result.data;
600 _this.dialog.el.unmask();
601 _this.grid.getDataSource().load();
602 _this.trform.reset();
603 _this.form.findField('body').originalValue = _this.form.findField('body').getValue();
604 _this.form.findField('extended').originalValue = _this.form.findField('extended').getValue();
607 var catlabel= _this.form.findField('category_page_id').fieldEl.select('label',true).first()
608 catlabel.dom.innerHTML = 'Category';
610 if(_this.data.page_type_id_name == 'category'){
611 catlabel.dom.innerHTML = 'Parent Category';
615 var catlabel= _this.form.findField('parent_id').fieldEl.select('label',true).first();
616 catlabel.dom.innerHTML = 'Parent page';
617 if(_this.data.page_type_id_name == 'category'){
618 catlabel.dom.innerHTML = 'Parent';
621 // better if this was not here... - not sure which project uses it?
623 if(_this.data.page_type_id_name == 'blog' && AppModules.indexOf("Crm") !== -1){
624 _this.interestsCol.show();
626 if(typeof(d['interests']) != 'undefined'){
627 _this.form.findField('interest').setValue(Roo.decode(d['interests']));
630 _this.trpanel.el.unmask();
631 _this.panel.el.unmask();
634 _this.cpanel.el.dom.scrollTop = 0;
636 // fix messed up scroll.
637 _this.dialog.layout.el.dom.scrollTop = 0;
640 if (action.type =='submit') {
642 _this.dialog.el.unmask();
645 this.load({ method: 'GET', params: { '_id' : action.result.data.id }});
652 if (_this.callback) {
653 _this.callback.call(_this, action.result.data);
659 actionfailed : function (_self, action)
661 _this.dialog.el.unmask();
662 Pman.standardActionFailed(_self, action);
664 rendered : function (_self)
682 labelAlign : 'right',
684 style : 'height:30px;overflow:hidden',
691 fieldLabel : _this._strings['e659b52eba1f0299b2d8ca3483919e72'] /* Type: */,
700 style : 'height:30px;overflow:hidden',
708 displayField : 'display_name',
710 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
711 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
712 forceSelection : true,
713 hiddenName : 'page_type_id',
715 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
717 name : 'page_type_id_display_name',
719 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
720 selectOnFocus : true,
721 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
722 triggerAction : 'all',
726 render : function (_self)
728 _this.page_type = _self;
730 select : function (combo, record, index)
732 // _this.grid.footer.onClick('first');
733 var page_type_name = record.data.name;
734 _this.form.findField('page_type_id_name').setValue(page_type_name);
735 if(page_type_name == 'blog' || page_type_name == 'category'){ // blog || category unset attachment
736 _this.form.findField('is_attachment').setValue(0);
740 _this.form.showHide.defer(100, _this.form);
750 sortInfo : { direction : 'ASC', field: 'seqid' },
752 beforeload : function (_self, o){
753 o.params = o.params || {};
755 o.params.etype = 'cms_page_type';
763 url : baseURL + '/Roo/core_enum.php',
768 xtype : 'JsonReader',
769 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
772 totalProperty : 'total',
781 style : 'padding-left: -70px;',
787 xtype : 'NumberField',
788 decimalPrecision : 0,
789 fieldLabel : _this._strings['b28a711cf7e94ec793ef926633997529'] /* Seq */,
804 labelAlign : 'right',
806 style : 'height:30px;overflow:hidden',
813 fieldLabel : _this._strings['77174410b72decfd0b259961f1f65a8f'] /* Attributes: */,
822 style : 'height:30px;overflow:hidden',
830 fieldLabel : _this._strings['287234a1ff35a314b5b6bc4e5828e745'] /* Attributes */,
838 boxLabel : 'Has Extended content?',
840 name : 'has_extended',
843 check : function (_self, checked)
848 _this.form.showHide();
849 _this.panel.fireEvent('resize', _this.panel, [ _this.panel.el.getWidth(), _this.panel.el.getHeight() ] );
860 boxLabel : 'Downloads first Attachment',
862 name : 'is_attachment',
865 check : function (_self, checked)
869 _this.form.showHide.defer(100, _this.form);
883 displayField : 'name',
885 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
886 fieldLabel : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
887 forceSelection : true,
888 hiddenName : 'author_id',
890 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
892 name : 'author_id_name',
894 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
895 queryParam : 'query[name]',
896 selectOnFocus : true,
897 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> - {company_id_name}</div>',
898 triggerAction : 'all',
907 sortInfo : { direction : 'ASC', field: 'name' },
909 beforeload : function (_self, o){
910 o.params = o.params || {};
913 o.params['query[is_owner]'] = 1;
921 url : baseURL + '/Roo/core_person',
926 xtype : 'JsonReader',
927 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
930 totalProperty : 'total',
939 displayField : 'title',
941 emptyText : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
942 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
943 forceSelection : true,
944 hiddenName : 'category_page_id',
946 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
948 name : 'category_page_id_title',
950 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
952 selectOnFocus : true,
953 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> </div>',
954 triggerAction : 'all',
962 sortInfo : { field: 'title', dir: 'ASC' },
964 beforeload : function (_self, o){
965 o.params = o.params || {};
966 o.params.page_type_id_name= 'CATEGORY';
975 url : baseURL + '/Roo/cms_page.php',
980 xtype : 'JsonReader',
981 fields : [{"name":"id","type":"int"},{"name":"title","type":"string"}],
984 totalProperty : 'total',
994 displayField : 'page_link',
996 emptyText : _this._strings['95cb4f45ab7ff3984f25ab8668499020'] /* Select Parent */,
997 fieldLabel : _this._strings['70a4bc2672e2e3912e6476a2bd7ba29b'] /* Parent page */,
998 forceSelection : true,
999 hiddenName : 'parent_id',
1001 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1003 name : 'parent_id_title',
1005 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1006 selectOnFocus : true,
1007 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1008 triggerAction : 'all',
1013 select : function (combo, record, index)
1015 var page_type_name = _this.form.findField('page_type_id_name').getValue();
1016 if (page_type_name == 'page') { // page
1019 // do not default to put 'Home' at the beginning.
1020 if (!(record.data.parent_id *1)) {
1023 var pl = _this.form.findField('page_link');
1024 var lk = pl.getValue();
1025 var new_link = record.data.page_link + '/';
1027 new_link += lk.split('/').pop();
1029 pl.setValue(new_link);
1034 '|xns' : 'Roo.form',
1038 sortInfo : { field: 'page_link', direction: 'ASC' },
1040 beforeload : function (_self, options)
1042 options.params['search[page_link_no_empty]'] =1;
1044 options.params.page_type_id = _this.data.page_type_id;
1046 var id = _this.form.findField('id').getValue() * 1;
1049 options.params['!id'] = id;
1052 options.params.is_element = 0;
1053 var page_type_name = _this.page_type.findRecord() ? _this.page_type.findRecord().data.name: _this.firstPageType.name;
1054 options.params.is_menuitem = page_type_name == 'menu' ? 1 : 0;
1059 '|xns' : 'Roo.data',
1061 xtype : 'HttpProxy',
1063 url : baseURL + '/Roo/cms_page.php',
1068 xtype : 'JsonReader',
1070 { name: 'id', type: 'int' },
1076 totalProperty : 'total',
1086 '|xns' : 'Roo.form',
1089 xtype : 'DateField',
1090 altFormats : 'Y-m-d H:i:s',
1091 fieldLabel : _this._strings['69dd756ae9c23191a5bb9b61f0857432'] /* Date to Publish */,
1099 xtype : 'TextField',
1100 fieldLabel : _this._strings['fb3f11443065d5f4d8303ad913db9680'] /* Replaces (ignore) */,
1101 name : 'to_replace_id',
1109 xtype : 'TextField',
1110 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1114 keyup : function (_self, e)
1116 if (_this.page_type.getRawValue() == 'Category') {
1118 _this.form.findField('page_link').setValue(this.getValue().replace(/[\s]/ig, '-').toLowerCase());
1127 xtype : 'TextField',
1128 fieldLabel : _this._strings['d52f80f80467bb575253a5a39ca016a7'] /* Page link / Name / Order */,
1135 xtype : 'TextField',
1136 fieldLabel : _this._strings['e64df1d7c22b9638f084ce8a4aff3ff3'] /* Target URL */,
1137 name : 'target_url',
1146 displayField : 'template_clean',
1148 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
1149 fieldLabel : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1150 forceSelection : true,
1151 hiddenName : 'template_id',
1153 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1155 name : 'template_id_template_clean',
1157 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1158 selectOnFocus : true,
1159 tpl : '<div class="x-grid-cell-text x-btn button"><b>{template_clean}</b></div>',
1160 triggerAction : 'all',
1165 '|xns' : 'Roo.form',
1169 sortInfo : { field: 'template', direction: 'ASC' },
1171 beforeload : function (_self, options)
1174 options.params._rescan = 1;
1175 options.params._clean_name = 1;
1176 // options.params.lang = 'en';
1177 options.params['!template[0]'] = 'master.html';
1178 //options.params['!template[1]'] = 'index.html';
1182 '|xns' : 'Roo.data',
1184 xtype : 'HttpProxy',
1186 url : baseURL + '/Roo/Cms_template',
1191 xtype : 'JsonReader',
1193 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1197 totalProperty : 'total',
1207 displayField : 'name',
1209 emptyText : _this._strings['b5216c9b4e0ac0afd9c76eb1d12ad1b9'] /* Select Section */,
1210 fieldLabel : _this._strings['f3912172e6bf57f8979782f4a2342233'] /* Appears in Block */,
1211 forceSelection : true,
1212 hiddenName : 'element_id',
1214 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1216 name : 'element_id_name',
1218 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1219 selectOnFocus : true,
1220 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b></div>',
1221 triggerAction : 'all',
1226 '|xns' : 'Roo.form',
1230 sortInfo : { field: 'name', direction: 'ASC' },
1232 beforeload : function (_self, options)
1234 var par = _this.form.findField('parent_id').getValue() * 1;
1236 Roo.MessageBox.alert("Error", "Select on what parent page it appears");
1240 options.params._cms_page_id = par;
1244 '|xns' : 'Roo.data',
1246 xtype : 'HttpProxy',
1248 url : baseURL + '/Roo/Cms_template_element',
1253 xtype : 'JsonReader',
1255 { name: 'id', type: 'int' }, {name: 'template', type: 'string'}
1259 totalProperty : 'total',
1269 displayField : 'page_link',
1271 emptyText : _this._strings['99e7707748ae048e17c5810fad119e0b'] /* Select Page */,
1272 fieldLabel : _this._strings['8adedb6a6226807ba810215dd3b3c61b'] /* Menu links to Page */,
1273 forceSelection : true,
1274 hiddenName : 'menu_page_id',
1276 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1278 name : 'menu_page_id_page_link',
1280 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1281 selectOnFocus : true,
1282 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>',
1283 triggerAction : 'all',
1288 '|xns' : 'Roo.form',
1292 sortInfo : { field: 'title', direction: 'ASC' },
1294 beforeload : function (_self, options)
1296 options.params = options.params || {};
1298 options.params['search[page_link_no_empty]'] =1;
1300 options.params['page_type_id_name[0]'] = 'page';
1301 options.params['page_type_id_name[1]'] = 'blog';
1303 options.params.is_element = 0;
1304 options.params.is_menuitem = 0;
1309 '|xns' : 'Roo.data',
1311 xtype : 'HttpProxy',
1313 url : baseURL + '/Roo/cms_page.php',
1318 xtype : 'JsonReader',
1333 "name":"page_type_id_display_name",
1339 totalProperty : 'total',
1352 render : function (_self)
1354 _this.bodycol = _self;
1358 '|xns' : 'Roo.form',
1361 xtype : 'HtmlEditor',
1362 autosave : function() {
1364 var body = _this.form.findField('body');
1366 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
1367 Roo.log('body not dirty');
1371 Roo.log('body dirty, auto save!');
1373 body.fireEvent('autosave', body);
1377 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
1381 white : [ 'iframe' ],
1384 autosave : function (_self)
1386 Roo.log('autosave');
1388 var id = _this.form.findField('id').getValue() * 1;
1390 if(!_self.editorcore.sourceEditMode){
1397 url : baseURL + '/Roo/Events.php',
1401 action : 'AUTOSAVE',
1402 on_id : (id > 0) ? id : 0,
1403 on_table : 'cms_page',
1405 source: _self.getValue()
1407 success : function() {
1408 _self.originalValue = _self.getValue();
1411 failure : function()
1413 //Roo.MessageBox.alert("Error", "autosave failed");
1414 Roo.log('body autosave failed?!');
1419 savedpreview : function (_self)
1421 Roo.log('saved preview');
1423 var id = _this.form.findField('id').getValue() * 1;
1425 var successFn = function(res){
1426 return res.data.POST.source;
1430 action : 'AUTOSAVE',
1432 on_id : (id < 1) ? 0 : id,
1433 on_table : 'cms_page',
1434 successFn : successFn
1438 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
1439 _self.setValue(res);
1440 _self.originalValue = res;
1443 stylesheetsclick : function (_self)
1445 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
1446 _this.dialog.setStylesheets();
1452 '|xns' : 'Roo.form',
1455 xtype : 'ToolbarStandard',
1456 xns : Roo.form.HtmlEditor,
1457 '|xns' : 'Roo.form.HtmlEditor',
1462 displayField : 'name',
1464 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
1465 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
1466 forceSelection : true,
1468 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1471 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
1472 queryParam : 'search',
1473 selectOnFocus : true,
1474 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>',
1475 triggerAction : 'all',
1480 beforequery : function (combo, query, forceAll, cancel, e)
1483 var id = _this.form.findField('id').getValue() * 1;
1485 Roo.MessageBox.alert("Error", "Save Document First before adding images");
1489 render : function (_self)
1491 _this.bodyimgselect = _self;
1493 select : function (combo, record, index)
1500 var editor = _this.form.findField('body').editorcore;
1502 var curnode = editor.getSelectedNode();
1504 if (curnode && curnode.tagName == 'IMG') {
1505 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
1506 baseURL, record.data.id, record.data.filename
1508 // note -forces an update... hopefully...
1509 editor.owner.fireEvent('editorevent', editor, false);
1512 editor.insertAtCursor(
1513 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
1514 baseURL, record.data.id, record.data.filename
1523 '|xns' : 'Roo.form',
1527 sortInfo : { direction : 'ASC', field: 'id' },
1529 beforeload : function (_self, o){
1530 o.params = o.params || {};
1532 var id = _this.form.findField('id').getValue() * 1;
1534 Roo.MessageBox.alert("Error", "Save press release first");
1538 o.params.ontable = 'cms_page';
1539 // o.params.imgtype = 'PressRelease';
1540 //o.params['query[imagesize]'] = '150x150';
1545 '|xns' : 'Roo.data',
1547 xtype : 'HttpProxy',
1549 url : baseURL + '/Roo/Images.php',
1554 xtype : 'JsonReader',
1555 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1558 totalProperty : 'total',
1567 displayField : 'page_link',
1569 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
1570 forceSelection : true,
1571 hiddenName : 'add_link_id',
1573 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1577 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1578 selectOnFocus : true,
1579 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1580 triggerAction : 'all',
1585 select : function (combo, record, index)
1591 var editor = _this.form.findField('body');
1592 editor.editorcore.insertAtCursor(
1593 String.format('<a href="#page-{0}">{1}</a>',
1594 record.data.page_link, record.data.title
1602 '|xns' : 'Roo.form',
1606 sortInfo : { field: 'page_link', direction: 'ASC' },
1608 beforeload : function (_self, options)
1610 options.params['search[page_link_no_empty]'] =1;
1612 options.params.is_element = 0;
1613 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
1618 '|xns' : 'Roo.data',
1620 xtype : 'HttpProxy',
1622 url : baseURL + '/Roo/cms_page.php',
1627 xtype : 'JsonReader',
1629 { name: 'id', type: 'int' },
1635 totalProperty : 'total',
1642 xtype : 'Separator',
1644 '|xns' : 'Roo.Toolbar'
1648 cls : 'x-init-enable',
1649 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1651 click : function (_self, e)
1653 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1657 '|xns' : 'Roo.Toolbar'
1662 xtype : 'ToolbarContext',
1663 xns : Roo.form.HtmlEditor,
1664 '|xns' : 'Roo.form.HtmlEditor'
1675 render : function (_self)
1677 _this.extendcol = _self;
1681 '|xns' : 'Roo.form',
1684 xtype : 'HtmlEditor',
1685 autosave : function() {
1687 var extended = _this.form.findField('extended');
1689 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
1690 Roo.log('extend not dirty');
1695 Roo.log('extend dirty, auto save!');
1697 extended.fireEvent('autosave', extended);
1699 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
1703 white : [ 'iframe' ],
1706 autosave : function (_self)
1708 var id = _this.form.findField('id').getValue() * 1;
1711 if(!_self.editorcore.sourceEditMode){
1718 url : baseURL + '/Roo/Events.php',
1722 action : 'AUTOSAVE',
1723 on_id : (id > 0) ? id : 0,
1724 on_table : 'cms_page',
1725 remarks : 'EXTENDED',
1726 source: _self.getValue()
1728 success : function() {
1729 _self.originalValue = _self.getValue();
1732 failure : function()
1734 //Roo.MessageBox.alert("Error", "autosave failed");
1735 Roo.log('extended autosave failed?!');
1739 savedpreview : function (_self)
1741 var id = _this.form.findField('id').getValue() * 1;
1743 var successFn = function(res){
1744 return res.data.POST.source;
1748 action : 'AUTOSAVE',
1749 remarks : 'EXTENDED',
1750 on_id : (id < 1) ? 0 : id,
1751 on_table : 'cms_page',
1752 successFn : successFn
1756 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
1757 _self.setValue(res);
1758 _self.originalValue = res;
1761 stylesheetsclick : function (_self)
1763 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
1764 _this.dialog.setStylesheets();
1770 '|xns' : 'Roo.form',
1773 xtype : 'ToolbarStandard',
1774 xns : Roo.form.HtmlEditor,
1775 '|xns' : 'Roo.form.HtmlEditor',
1780 displayField : 'name',
1782 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
1783 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
1784 forceSelection : true,
1786 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1789 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
1790 selectOnFocus : true,
1791 tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{url_thumb}\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
1792 triggerAction : 'all',
1797 beforequery : function (combo, query, forceAll, cancel, e)
1800 var id = _this.form.findField('id').getValue() * 1;
1802 Roo.MessageBox.alert("Error", "Save Document First before adding images");
1806 render : function (_self)
1808 _this.extendimgselect = _self;
1810 select : function (combo, record, index)
1817 var editor = _this.form.findField('extended').editorcore;
1819 var curnode = editor.getSelectedNode();
1821 if (curnode && curnode.tagName == 'IMG') {
1822 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
1823 baseURL, record.data.id, record.data.filename
1825 // note -forces an update... hopefully...
1826 editor.owner.fireEvent('editorevent', editor, false);
1829 editor.insertAtCursor(
1830 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
1831 baseURL, record.data.id, record.data.filename
1840 '|xns' : 'Roo.form',
1844 sortInfo : { direction : 'ASC', field: 'id' },
1846 beforeload : function (_self, o){
1847 o.params = o.params || {};
1849 var id = _this.form.findField('id').getValue() * 1;
1851 Roo.MessageBox.alert("Error", "Save press release first");
1855 o.params.ontable = 'cms_page';
1856 // o.params.imgtype = 'PressRelease';
1857 //o.params['query[imagesize]'] = '150x150';
1862 '|xns' : 'Roo.data',
1864 xtype : 'HttpProxy',
1866 url : baseURL + '/Roo/Images.php',
1871 xtype : 'JsonReader',
1872 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1875 totalProperty : 'total',
1884 displayField : 'page_link',
1886 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
1887 forceSelection : true,
1888 hiddenName : 'add_link_id',
1890 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1894 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
1895 selectOnFocus : true,
1896 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
1897 triggerAction : 'all',
1902 select : function (combo, record, index)
1908 var editor = _this.form.findField('body');
1909 editor.editorcore.insertAtCursor(
1910 String.format('<a href="#page-{0}">{1}</a>',
1911 record.data.page_link, record.data.title
1919 '|xns' : 'Roo.form',
1923 sortInfo : { field: 'page_link', direction: 'ASC' },
1925 beforeload : function (_self, options)
1927 options.params['search[page_link_no_empty]'] =1;
1929 options.params.is_element = 0;
1930 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
1935 '|xns' : 'Roo.data',
1937 xtype : 'HttpProxy',
1939 url : baseURL + '/Roo/cms_page.php',
1944 xtype : 'JsonReader',
1946 { name: 'id', type: 'int' },
1952 totalProperty : 'total',
1959 xtype : 'Separator',
1961 '|xns' : 'Roo.Toolbar'
1965 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1967 click : function (_self, e)
1969 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1973 '|xns' : 'Roo.Toolbar'
1978 xtype : 'ToolbarContext',
1979 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
1980 xns : Roo.form.HtmlEditor,
1981 '|xns' : 'Roo.form.HtmlEditor'
1992 render : function (_self)
1994 _this.keywordscol = _self;
1998 '|xns' : 'Roo.form',
2003 '|xns' : 'Roo.form',
2007 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
2016 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
2018 name : 'descriptions',
2028 '|xns' : 'Roo.form',
2032 fieldLabel : _this._strings['39f64cc9436cacfbceda3b7bdeb8e24c'] /* Styles (CSS) */,
2047 render : function (_self)
2049 _this.interestsCol = _self;
2053 '|xns' : 'Roo.form',
2056 xtype : 'ComboBoxArray',
2057 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
2058 hiddenName : 'interest',
2059 name : 'interest_name',
2062 render : function (_self)
2064 _this.interests = _self;
2066 _self.combo.addicon.setStyle( {
2067 position : 'absolute',
2076 '|xns' : 'Roo.form',
2081 displayField : 'display_name',
2083 emptyText : _this._strings['30d1a216420426fcbd43ca70acd4aa48'] /* Select interests */,
2084 fieldLabel : _this._strings['c70952e4ab3806c049737cd7d2b8896b'] /* Interests */,
2085 forceSelection : true,
2088 queryParam : 'query[name]',
2089 selectOnFocus : true,
2090 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
2091 triggerAction : 'all',
2095 '|xns' : 'Roo.form',
2099 sortInfo : { direction : 'ASC', field: 'name' },
2101 beforeload : function (_self, o){
2102 o.params = o.params || {};
2103 o.params.etype = 'crm_interest';
2107 '|xns' : 'Roo.data',
2109 xtype : 'HttpProxy',
2111 url : baseURL + '/Roo/Core_enum.php',
2116 xtype : 'JsonReader',
2118 {"name":"id","type":"int"},
2119 {"name":"name","type":"string"},
2120 {"name":"display_name","type":"string"}
2124 totalProperty : 'total',
2141 name : 'is_system_page',
2147 name : 'is_menuitem',
2153 name : 'page_type_id_name',
2160 render : function (_self)
2162 _this.user_defined_fields = _self;
2173 xtype : 'GridPanel',
2175 fitContainer : true,
2178 tableName : 'Images',
2179 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
2181 activate : function() {
2184 _this.grid.footer.onClick('first');
2191 xtype : 'EditorGrid',
2192 autoExpandColumn : 'title',
2196 render : function() {
2198 //_this.dialog = Pman.Dialog.FILL_IN
2199 if (_this.panel.active) {
2200 //this.footer.onClick('first');
2203 rowdblclick : function (_self, rowIndex, e)
2205 var rd = _this.grid.getDataSource().getAt(rowIndex);
2206 var id = rd.data.id;
2207 var url = String.format('{0}/Images/{1}/{2}', baseURL, rd.data.id, rd.data.filename);
2208 _this.form.findField('contents').execCmd('insertimage', url);
2213 '|xns' : 'Roo.grid',
2221 cls : 'x-btn-text-icon',
2222 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
2223 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
2227 var id = _this.form.findField('id').getValue() * 1;
2233 Pman.Dialog.Image.show( { id : 0, onid : id, ontable: 'cms_page' }, function() {
2234 Roo.log('load?????');
2235 _this.grid.ds.load({});
2245 cls : 'x-btn-text-icon',
2246 icon : rootURL + '/Pman/templates/images/trash.gif',
2247 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
2251 var selection = _this.grid.getSelectionModel().getSelectedCell();
2252 var sn = _this.grid.ds.getAt(selection[0]);
2253 if (!sn || isNaN(sn.id *1)) {
2254 Roo.MessageBox.alert("Error", "Select a image");
2257 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
2263 url : baseURL + '/Roo/Images.php',
2268 success : function()
2270 Roo.log('Got Success!!');
2271 _this.grid.ds.load({});
2285 beforeload : function (_self, o)
2287 var id = _this.form.findField('id').getValue() * 1;
2293 o.params = o.params || {};
2294 o.params.limit = 9999;
2296 o.params.ontable = 'cms_page';
2298 update : function (_self, rec, operation)
2302 url : baseURL+'/Roo/Images.php',
2305 success: function(res)
2307 Roo.log("GOT success");
2308 // update the data...
2309 _this.grid.ds.load({});
2311 failure : function(res)
2321 '|xns' : 'Roo.data',
2323 xtype : 'HttpProxy',
2325 url : baseURL + '/Roo/Images.php',
2330 xtype : 'JsonReader',
2365 'name': 'displayorder',
2373 'name': 'parent_image_id',
2379 'dateFormat': 'Y-m-d'
2398 'name': 'parent_image_id_id',
2402 'name': 'parent_image_id_filename',
2406 'name': 'parent_image_id_ontable',
2410 'name': 'parent_image_id_onid',
2414 'name': 'parent_image_id_mimetype',
2418 'name': 'parent_image_id_width',
2422 'name': 'parent_image_id_height',
2426 'name': 'parent_image_id_filesize',
2430 'name': 'parent_image_id_displayorder',
2434 'name': 'parent_image_id_language',
2438 'name': 'parent_image_id_parent_image_id',
2442 'name': 'parent_image_id_created',
2446 'name': 'parent_image_id_imgtype',
2450 'name': 'parent_image_id_linkurl',
2454 'name': 'parent_image_id_descript',
2458 'name': 'parent_image_id_title',
2464 totalProperty : 'total',
2471 xtype : 'ColumnModel',
2473 header : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */,
2474 renderer : function(v,x,r) {
2475 return String.format('<img src="{0}/Images/Thumb/100/{1}/{2}" height="100">', baseURL, v, r.data.filename);
2483 xtype : 'ColumnModel',
2484 dataIndex : 'filename',
2485 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
2486 renderer : function(v) { return String.format('{0}', v); },
2492 xtype : 'ColumnModel',
2493 dataIndex : 'displayorder',
2494 header : _this._strings['a240fa27925a635b08dc28c9e4f9216d'] /* Order */,
2495 renderer : function(v) { return String.format('{0}', v); },
2498 '|xns' : 'Roo.grid',
2500 xtype : 'GridEditor',
2502 '|xns' : 'Roo.grid',
2504 xtype : 'NumberField',
2505 decimalPrecision : 0,
2507 focus : function (_self)
2509 if (this.value == 0) {
2510 this.el.dom.value = '';
2520 xtype : 'ColumnModel',
2521 dataIndex : 'title',
2522 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
2523 renderer : function(v) { return String.format('{0}', v); },
2526 '|xns' : 'Roo.grid',
2528 xtype : 'GridEditor',
2530 '|xns' : 'Roo.grid',
2532 xtype : 'TextField',
2539 xtype : 'ColumnModel',
2540 dataIndex : 'linkurl',
2541 header : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
2542 renderer : function(v)
2544 return String.format('{0}', (v) ? v : '');
2548 '|xns' : 'Roo.grid',
2550 xtype : 'GridEditor',
2552 '|xns' : 'Roo.grid',
2554 xtype : 'TextField',
2564 xtype : 'ContentPanel',
2569 render : function (_self)
2571 _this.trpanel = _self;
2573 resize : function (_self, width, height)
2575 Roo.log('resize called');
2576 var ew = Math.max(250, width-50);
2577 var eh = Math.max(250,height-50) ;
2578 if (!_this.trform) {
2581 _this.trform.showHide();
2583 var bd = _this.trform.findField('body');
2587 // since render delays resize..
2588 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
2589 _this.trbodycol.el.setWidth(bd.width+20);
2591 var bd = _this.trform.findField('extended');
2595 // since render delays resize..
2596 bd.resizeEl.resizeTo.defer(110, bd.resizeEl,[ bd.width, bd.height ] );
2597 _this.trextendcol.el.setWidth(bd.width+20);
2607 labelAlign : 'right',
2610 showHide : function() {
2612 // var in_rss= _this.form.findField('in_rss').getValue() * 1;
2613 var has_extended = _this.form.findField('has_extended').getValue() * 1;
2614 var has_lang = _this.trform.findField('language').getValue().length;
2617 //category_id : in_rss,
2618 //page_link : !in_rss, // blogs which have perm links?
2619 //is_element : !in_rss,
2620 //parent_id : !in_rss,
2621 //published : in_rss,
2622 //to_replace_id : !in_rss, // is this used.
2623 //has_extended : true, // always shown.
2624 extended : has_lang && has_extended,
2627 descriptions : has_lang,
2629 //author_id : in_rss
2633 var el = _this.trform.findField(k);
2634 el.actionMode = 'fieldEl';
2636 Roo.log("show: " + k);
2639 Roo.log("hide: " + k);
2645 _this.updateRow.el[has_lang ? 'show' : 'hide']();
2646 // we should now trigger the panel resize event..
2649 if(typeof(_this.trform.editors) == 'undefined'){
2650 _this.trform.editors = {
2651 body : _this.trform.findField('body').wrap.isVisible(),
2652 extended : _this.trform.findField('extended').wrap.isVisible()
2654 if(_this.trform.editors.body){
2655 setInterval(_this.trform.findField('body').autosave, 60000);
2658 if(_this.trform.editors.extended){
2659 setInterval(_this.trform.findField('extended').autosave, 60000);
2663 if(!_this.trform.editors.body && _this.trform.findField('body').wrap.isVisible()){
2664 setInterval(_this.trform.findField('body').autosave, 60000);
2665 _this.trform.editors.body = true;
2668 if(!_this.trform.editors.extended && _this.trform.findField('extended').wrap.isVisible()){
2669 setInterval(_this.trform.findField('extended').autosave, 60000);
2670 _this.trform.editors.extended = true;
2677 style : 'margin: 5px',
2678 url : baseURL + '/Roo/cms_page.php',
2680 actioncomplete : function (_self, action)
2683 if (action.type =='submit') {
2684 // _this.dialog.el.mask("Saving");
2688 if (action.type == 'setdata') {
2690 if ( _this.data.id) {
2691 // _this.dialog.el.mask("Loading");
2692 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
2695 //_this.loaded = true;
2696 this.trpanel.el.mask("save first");
2703 if (action.type == 'load') {
2704 // _this.dialog.el.unmask();
2707 _this.trform.findField('body').originalValue = _this.trform.findField('body').getValue();
2708 _this.trform.findField('extended').originalValue = _this.trform.findField('extended').getValue();
2713 actionfailed : function (_self, action)
2715 _this.dialog.el.unmask();
2717 Pman.standardActionFailed(_self, action);
2719 rendered : function (_self)
2721 _this.trform = _self;
2725 '|xns' : 'Roo.form',
2732 '|xns' : 'Roo.form',
2739 '|xns' : 'Roo.form',
2744 displayField : 'language_name',
2746 emptyText : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
2747 fieldLabel : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
2748 forceSelection : true,
2749 hiddenName : 'language',
2751 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
2753 name : 'language_name',
2755 qtip : _this._strings['83dad8107f9459efe2b4fabcf5b63108'] /* Select Language */,
2756 selectOnFocus : true,
2757 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{language_name}</b> </div>',
2758 triggerAction : 'all',
2760 valueField : 'language',
2762 add : function (combo)
2764 Pman.Dialog.CmsLanguagePick.show({_with_name : true}, function( res) {
2766 combo.setValue(res.lang);
2767 combo.el.dom.value = res.lang_name;
2769 _this.trform.showHide();
2770 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
2775 render : function (_self)
2777 _this.language = _self;
2779 select : function (combo, record, index)
2782 _this.trform.showHide();
2783 _this.trpanel.fireEvent('resize', _this.trpanel, [ _this.trpanel.el.getWidth(), _this.trpanel.el.getHeight() ] );
2791 'lookup[language]' : record.data.language,
2792 'lookup[translation_of_id]' : _this.data.id,
2799 '|xns' : 'Roo.form',
2803 sortInfo : { direction : 'ASC', field: 'language' },
2805 beforeload : function (_self, o){
2806 o.params = o.params || {};
2808 o.params._distinct = 'language';
2809 o.params._columns ='language_name,language';
2810 o.params._with_name = true;
2812 if(_this.form.findField('id').getValue()*1 > 0){
2813 o.params.translation_of_id = _this.form.findField('id').getValue();
2819 '|xns' : 'Roo.data',
2821 xtype : 'HttpProxy',
2823 url : baseURL + '/Roo/Cms_page.php',
2828 xtype : 'JsonReader',
2829 fields : [{"name":"language","type":"string"}],
2832 totalProperty : 'total',
2840 style : 'padding-top:12px;padding-left:30px;float:left',
2843 render : function (_self)
2845 _this.updateRow = _self;
2849 '|xns' : 'Roo.form',
2853 text : _this._strings['06933067aafd48425d67bcb01bba5cb6'] /* Update */,
2857 // _this.dialog.el.mask("Saving");
2858 if(!_this.trform.findField('body').editorcore.sourceEditMode){
2859 _this.trform.findField('body').syncValue();
2860 _this.trform.findField('extended').syncValue();
2862 _this.trform.findField('body').pushValue();
2863 _this.trform.findField('extended').pushValue();
2866 _this.trform.findField('parent_id').setValue(_this.form.findField('parent_id').getValue());
2867 _this.trform.findField('element_id').setValue(_this.form.findField('element_id').getValue());
2868 _this.trform.findField('translation_of_id').setValue(_this.form.findField('id').getValue());
2869 _this.trform.findField('is_menuitem').setValue(_this.form.findField('is_menuitem').getValue());
2870 _this.trform.findField('menu_page_id').setValue(_this.form.findField('menu_page_id').getValue());
2872 if(_this.trform.findField('element_id').getValue()*1 > 0){
2873 _this.trform.findField('is_element').setValue(1);
2876 _this.trform.doAction("submit");
2887 xtype : 'TextField',
2888 fieldLabel : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
2901 render : function (_self)
2903 _this.trbodycol = _self;
2907 '|xns' : 'Roo.form',
2910 xtype : 'HtmlEditor',
2911 autosave : function() {
2913 var body = _this.trform.findField('body');
2915 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
2916 Roo.log('tr body not dirty');
2920 Roo.log('tr body dirty, auto save!');
2922 body.fireEvent('autosave', body);
2924 fieldLabel : _this._strings['c1df1da7a1ce305a3b60af9d5733ac1d'] /* Contents */,
2928 white : [ 'iframe' ],
2930 autosave : function (_self)
2932 var id = _this.trform.findField('id').getValue() * 1;
2935 if(!_self.editorcore.sourceEditMode){
2942 url : baseURL + '/Roo/Events.php',
2946 action : 'AUTOSAVE',
2947 on_id : (id > 0) ? id : 0,
2948 on_table : 'cms_page',
2950 source: _self.getValue()
2952 success : function() {
2953 _self.originalValue = _self.getValue();
2956 failure : function()
2958 //Roo.MessageBox.alert("Error", "autosave failed");
2959 Roo.log('tr body autosave failed?!');
2963 savedpreview : function (_self)
2965 var id = _this.trform.findField('id').getValue() * 1;
2967 var successFn = function(res){
2968 return res.data.POST.source;
2972 action : 'AUTOSAVE',
2974 on_id : (id < 1) ? 0 : id,
2975 on_table : 'cms_page',
2976 successFn : successFn
2980 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
2981 _self.setValue(res);
2982 _self.originalValue = res;
2985 stylesheetsclick : function (_self)
2987 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
2988 _this.dialog.setStylesheets();
2994 '|xns' : 'Roo.form',
2997 xtype : 'ToolbarStandard',
2998 xns : Roo.form.HtmlEditor,
2999 '|xns' : 'Roo.form.HtmlEditor',
3004 displayField : 'name',
3006 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
3007 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
3008 forceSelection : true,
3010 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3013 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
3014 selectOnFocus : true,
3015 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>',
3016 triggerAction : 'all',
3021 beforequery : function (combo, query, forceAll, cancel, e)
3024 var id = _this.form.findField('id').getValue() * 1;
3026 Roo.MessageBox.alert("Error", "Save press release first");
3030 render : function (_self)
3032 _this.trbodyimgselect = _self;
3034 select : function (combo, record, index)
3041 var editor = _this.trform.findField('body').editorcore;
3043 var curnode = editor.getSelectedNode();
3045 if (curnode && curnode.tagName == 'IMG') {
3046 curnode.src= String.format('{0}/Images/{1}/{2}#attachment-{1}',
3047 baseURL, record.data.id, record.data.filename
3049 // note -forces an update... hopefully...
3050 editor.owner.fireEvent('editorevent', editor, false);
3053 editor.insertAtCursor(
3054 String.format('<img src="{0}/Images/{1}/{2}#attachment-{1}">',
3055 baseURL, record.data.id, record.data.filename
3064 '|xns' : 'Roo.form',
3068 sortInfo : { direction : 'ASC', field: 'id' },
3070 beforeload : function (_self, o){
3071 o.params = o.params || {};
3073 var id = _this.form.findField('id').getValue() * 1;
3075 Roo.MessageBox.alert("Error", "Save press release first");
3079 o.params.ontable = 'cms_page';
3080 // o.params.imgtype = 'PressRelease';
3081 //o.params['query[imagesize]'] = '150x150';
3086 '|xns' : 'Roo.data',
3088 xtype : 'HttpProxy',
3090 url : baseURL + '/Roo/Images.php',
3095 xtype : 'JsonReader',
3096 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
3099 totalProperty : 'total',
3108 displayField : 'page_link',
3110 emptyText : _this._strings['580b21aac58f1b73cece26e272cdfbee'] /* Add Link */,
3111 forceSelection : true,
3112 hiddenName : 'add_link_id',
3114 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
3118 qtip : _this._strings['76729937a5eb6b0fd88c42581161facd'] /* Select Category */,
3119 selectOnFocus : true,
3120 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> <i>{page_link}</i> </div>',
3121 triggerAction : 'all',
3126 select : function (combo, record, index)
3132 var editor = _this.form.findField('body');
3133 editor.insertAtCursor(
3134 String.format('<a href="#page-{0}">{1}</a>',
3135 record.data.page_link, record.data.title
3143 '|xns' : 'Roo.form',
3147 sortInfo : { field: 'page_link', direction: 'ASC' },
3149 beforeload : function (_self, options)
3151 options.params['search[page_link_no_empty]'] =1;
3153 options.params.is_element = 0;
3154 options.params.is_menuitem = _this.form.findField('is_menuitem').getValue() * 1;
3159 '|xns' : 'Roo.data',
3161 xtype : 'HttpProxy',
3163 url : baseURL + '/Roo/cms_page.php',
3168 xtype : 'JsonReader',
3170 { name: 'id', type: 'int' },
3176 totalProperty : 'total',
3183 xtype : 'Separator',
3185 '|xns' : 'Roo.Toolbar'
3189 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3191 click : function (_self, e)
3193 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3197 '|xns' : 'Roo.Toolbar'
3202 xtype : 'ToolbarContext',
3203 xns : Roo.form.HtmlEditor,
3204 '|xns' : 'Roo.form.HtmlEditor'
3214 render : function (_self)
3216 _this.trextendcol = _self;
3220 '|xns' : 'Roo.form',
3223 xtype : 'HtmlEditor',
3224 autosave : function() {
3226 var extended = _this.trform.findField('extended');
3228 if(!extended.wrap.isVisible(true) || extended.getValue() == '' || !extended.isDirty()){
3229 Roo.log('tr extend not dirty');
3234 Roo.log('tr extend dirty, auto save!');
3236 extended.fireEvent('autosave', extended);
3240 fieldLabel : _this._strings['57e195426892c5515935f21d97228814'] /* Extended Contents */,
3244 white : [ 'iframe' ],
3246 autosave : function (_self)
3248 var id = _this.trform.findField('id').getValue() * 1;
3251 if(!_self.editorcore.sourceEditMode){
3259 url : baseURL + '/Roo/Events.php',
3263 action : 'AUTOSAVE',
3264 on_id : (id > 0) ? id : 0,
3265 on_table : 'cms_page',
3266 remarks : 'EXTENDED',
3267 source: _self.getValue()
3269 success : function() {
3270 _self.originalValue = _self.getValue();
3273 failure : function()
3275 //Roo.MessageBox.alert("Error", "autosave failed");
3276 Roo.log('tr extended autosave failed?!');
3280 savedpreview : function (_self)
3282 var id = _this.trform.findField('id').getValue() * 1;
3284 var successFn = function(res){
3285 return res.data.POST.source;
3289 action : 'AUTOSAVE',
3290 remarks : 'EXTENDED',
3291 on_id : (id < 1) ? 0 : id,
3292 on_table : 'cms_page',
3293 successFn : successFn
3297 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
3298 _self.setValue(res);
3299 _self.originalValue = res;
3302 stylesheetsclick : function (_self)
3304 Pman.Dialog.CmsApplyStyleSheets.show({}, function(res){
3305 _this.dialog.setStylesheets();
3311 '|xns' : 'Roo.form',
3314 xtype : 'ToolbarStandard',
3315 xns : Roo.form.HtmlEditor,
3316 '|xns' : 'Roo.form.HtmlEditor',
3319 xtype : 'Separator',
3321 '|xns' : 'Roo.Toolbar'
3325 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
3327 click : function (_self, e)
3329 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
3333 '|xns' : 'Roo.Toolbar'
3338 xtype : 'ToolbarContext',
3339 styles : typeof(uiConfig) != 'undefined' ? (uiConfig['Roo.form.HtmlEditor.ToolbarContext.styles'] || {}) : {},
3340 xns : Roo.form.HtmlEditor,
3341 '|xns' : 'Roo.form.HtmlEditor'
3351 render : function (_self)
3353 _this.trkeywordscol = _self;
3357 '|xns' : 'Roo.form',
3361 fieldLabel : _this._strings['867343577fa1f33caa632a19543bd252'] /* Keywords */,
3370 fieldLabel : _this._strings['8bc84316c4078bf66723fd019616d920'] /* Descriptions */,
3372 name : 'descriptions',
3387 name : 'element_id',
3393 name : 'menu_page_id',
3399 name : 'is_menuitem',
3405 name : 'is_element',
3412 name : 'translation_of_id',