1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab.CmsBlog');
7 Pman.Tab.CmsBlog.Old = new Roo.XComponent({
10 '30a2a59b5adaa49803297d4c06e09e67' :"Displaying cms_page{0} - {1} of {2}",
11 'a517747c3d12f99244ae598910d979c5' :"Author",
12 '6a5b847af3d97df722040debdbccfbed' :"Page Type",
13 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
14 '0eceeb45861f9585dd7a97a3e36f85c6' :"Created",
15 'ebd9bec4d70abc789d439c1f136b0538' :"Layout",
16 '30269022e9d8f51beaabb52e5d0de2b7' :"Parent",
17 'a4863ff1cdfa709d5bf80939cd2e6757' :"T#",
18 'd7efa19fbe7d3972fd5adb6024223d74' :"C#",
19 '08d0135e24822f43171ed4944fc3bdda' :"Preview (resize by dragging next to this bar)",
20 'b8a00b5928fbead0626546550667b2b5' :"Pages, Menu and Blog Entries ",
21 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
22 '2cbaa804531fc7367ccc699fb1eef52a' :"Page link / Name / Order",
23 'b8a00b5928fbead0626546550667b2b5' :"Pages, Menu and Blog Entries",
24 'c8043f5cd3d28cb76c548338497b06ab' :"Show Deleted",
25 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
26 '9b9d8a976b42e0bd66381797644943d5' :"Published",
27 'b78a3223503896721cca1303f776159b' :"Title",
28 'f17755c3f16cb257f7793b9865ebafb3' :"No cms_page found",
29 '20bec77364d863100a1f9325873a8504' :"Select Page Type",
30 '8dfef8a6f3beef9ff28ff1fafb5c2009' :"Select Category Type",
31 'f46885d21c98f597303699f41b3d7afd' :"Ex?",
32 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
33 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
34 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
35 '779e2624ddf330fb05b51ae59faf212d' :"Select Status Type",
36 'f7070be7ec7d2443714a2e5dc63f4de2' :"Links to",
37 '75ae2cfdf786e5577f1b619f4ca8d728' :"To replace"
40 part : ["Cms", "Old" ],
41 order : '001-Pman.Tab.CmsBlog.Old',
44 name : "unnamed module",
52 xtype : 'NestedLayoutPanel',
53 title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries */,
57 xtype : 'BorderLayout',
61 xtype : 'LayoutRegion',
66 xtype : 'LayoutRegion',
80 tableName : 'cms_page',
81 title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries */,
83 activate : function() {
86 _this.grid.footer.onClick('first');
94 autoExpandColumn : 'title',
97 cellclick : function (g, ri,ci, e)
\r
99 var h = g.getColumnModel().config[ci].dataIndex;
\r
100 if (h != 'is_draft') {
\r
103 var rec = g.ds.getAt(ri);
105 if(rec.data.is_system_page*1 == 1){
106 Roo.MessageBox.alert('Error', 'You cannot de-active the system page');
109 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
115 _this.dialog = Pman.Dialog.CmsBlog;
116 if (_this.panel.active) {
117 this.footer.onClick('first');
120 rowclick : function (_self, rowIndex, e)
122 var s = this.dataSource.getAt(rowIndex);
124 if(s.data.id *1 > 0){
126 _this.prepanel.el.dom.src = baseURL + '/Roo/Cms_page?_preview=' + s.data.id ;
\r
129 // _this.prepanel.setContent(s.data.body,true);
131 rowdblclick : function (_self, rowIndex, e)
134 var s = this.dataSource.getAt(rowIndex);
136 if (s.data.language.length) {
138 _this.dialog.show({ id : s.data.parent_id } , function() {
139 _this.grid.footer.onClick('refresh');
143 _this.dialog.show(s.data, function() {
144 _this.grid.footer.onClick('refresh');
152 xtype : 'PagingToolbar',
154 displayMsg : _this._strings['30a2a59b5adaa49803297d4c06e09e67'] /* Displaying cms_page{0} - {1} of {2} */,
155 emptyMsg : _this._strings['f17755c3f16cb257f7793b9865ebafb3'] /* No cms_page found */,
163 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
165 click : function (_self, e)
167 _this.grid.footer.onClick.defer(100, _this.grid.footer, ['first'] );
168 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
170 render : function (_self)
172 _this.showDeleted = this;
176 '|xns' : 'Roo.Toolbar'
188 render : function (_self)
190 _this.searchBox= _self;
192 specialkey : function (_self, e)
194 _this.grid.footer.onClick('first');
203 icon : rootURL + '/Pman/templates/images/search.gif',
205 click : function (_self, e)
207 _this.grid.footer.onClick('first');
211 '|xns' : 'Roo.Toolbar'
216 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
218 click : function (_self, e)
220 _this.searchBox.setValue('');
222 _this.grid.footer.onClick('first');
226 '|xns' : 'Roo.Toolbar'
232 displayField : 'display_name',
234 emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
235 fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
236 forceSelection : true,
237 hiddenName : 'page_type',
239 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
243 qtip : _this._strings['20bec77364d863100a1f9325873a8504'] /* Select Page Type */,
244 selectOnFocus : true,
245 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{display_name}</b> </div>',
246 triggerAction : 'all',
250 render : function (_self)
252 _this.page_type = _self;
256 url : baseURL + '/Roo/core_enum',
\r
258 etype : 'cms_page_type',
259 _columns : 'id,name,display_name',
265 success : function(res) {
266 _self.setValue(res.data[0].id);
267 _self.el.dom.value = res.data[0].display_name;
268 _self.selectedData = res.data[0];
272 select : function (combo, record, index)
274 _this.grid.footer.onClick('first');
275 _this.category_type.hide();
276 if(record.data.name == 'blog'){
277 _this.category_type.show();
279 combo.selectedData = record.data;
288 sortInfo : { direction : 'ASC', field: 'seqid' },
290 beforeload : function (_self, o){
291 o.params = o.params || {};
293 o.params.etype = 'cms_page_type';
294 // o.params.cmsTab = 1;
302 url : baseURL + '/Roo/core_enum.php',
307 xtype : 'JsonReader',
308 fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
311 totalProperty : 'total',
320 displayField : 'name',
322 emptyText : _this._strings['8dfef8a6f3beef9ff28ff1fafb5c2009'] /* Select Category Type */,
323 fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
324 forceSelection : true,
325 hiddenName : 'category_type',
327 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
330 qtip : _this._strings['8dfef8a6f3beef9ff28ff1fafb5c2009'] /* Select Category Type */,
331 selectOnFocus : true,
332 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
333 triggerAction : 'all',
338 render : function (_self)
340 _this.category_type = _self;
341 _this.category_type.hide();
343 select : function (combo, record, index)
345 _this.grid.footer.onClick('first');
352 beforeload : function (_self, o){
353 o.params = o.params || {};
355 o.params.etype = 'cms_page_type';
358 sortInfo : { direction : 'ASC', field: 'id' },
364 url : baseURL + '/Roo/Cms_category_type.php',
369 xtype : 'JsonReader',
370 fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
373 totalProperty : 'total',
382 '|xns' : 'Roo.Toolbar'
386 cls : 'x-btn-text-icon',
387 icon : rootURL + '/Pman/templates/images/trash.gif',
388 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
393 if(_this.grid.selModel.getSelections().length != 1){
394 Roo.MessageBox.alert("Error", "Select page to delete");
397 var sel = _this.grid.selModel.getSelected();
398 if(sel.data.is_system_page){
399 Roo.MessageBox.alert("Error", "System pages can not be deleted.");
402 Roo.MessageBox.confirm("Confirm",
403 "Are you sure you want to delete this, it can not be recovered if you make a mistake!",
410 url : baseURL + '/Roo/cms_page',
412 _delete : sel.data.id
414 success : function() {
415 _this.grid.footer.onClick('refresh');
426 '|xns' : 'Roo.Toolbar'
430 cls : 'x-btn-text-icon',
431 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
432 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
437 if(_this.grid.selModel.getSelections().length == 1){
438 ds = _this.grid.selModel.getSelected().data;
441 var page_type_id = 0;
442 var page_type_id_name = '';
443 var page_type_id_display_name = '';
444 var s = _this.page_type.selectedData;
448 page_type_id_name = s.name;
449 page_type_id_display_name = s.display_name;
451 if(s.name == 'page'){
452 page_type_id_display_name = 'Pages';
459 parent_id : ds ? ds.id : '',
460 parent_id_title : ds ? ds.title : '',
461 page_link : ds && !ds.is_element ? (ds.page_link + '/') : '',
462 page_type_id : ds ? ds.page_type_id : page_type_id,
463 page_type_id_name : ds ? ds.page_type_id_name : page_type_id_name,
464 page_type_id_display_name : ds ? ds.page_type_id_display_name : page_type_id_display_name
467 _this.dialog.show( q, function() {
468 _this.grid.footer.onClick('first');
473 '|xns' : 'Roo.Toolbar'
480 sortInfo : { field : 'created' , direction : 'DESC' },
482 beforeload : function (_self, options)
485 if (Pman.building || !Pman.Tab.Cms.panel.active) {
488 var cm = _this.grid.colModel;
490 category_type_id_name : true,
491 menu_page_id_title : true
493 var cm = _this.grid.getColumnModel();
495 return cm.getIndexByDataIndex(str);
498 options.params['search[name]'] = _this.searchBox.getValue();
500 options.params._exclude_columns = 'body,extended';
501 options.params._page_type_id = _this.page_type.getValue();
502 options.params._treeview = 1;
503 options.params._pman_short=1;
504 options.params.translation_of_id=0;
505 options.params._requestMeta = 1; // always fetch meta.. as different types return different data..
508 var page_type_name = (_this.page_type.lastData.name) ? _this.page_type.lastData.name : 'page';
510 Roo.log(page_type_name);
511 switch(page_type_name) {
513 options.params.limit = 9999;
514 _this.grid.footer.pageSize = 9999;
515 vis.menu_page_id_title = false;
516 cm.setHidden(cid('created'), true);
517 cm.setHidden(cid('published'), true);
518 cm.setHidden(cid('template_id_template'), false);
519 this.sortInfo.field = 'page_link'; // force sort.
520 this.sortInfo.direction = 'ASC'; // force sort.
524 options.params.limit = 20;
525 options.params['search[category]'] = _this.category_type.getValue();
526 _this.grid.footer.pageSize = 20;
527 vis.menu_page_id_title = false;
528 cm.setHidden(cid('created'), false);
529 cm.setHidden(cid('published'), false);
530 cm.setHidden(cid('template_id_template'), true);
531 this.sortInfo.field = 'published'; // force sort.
532 this.sortInfo.direction = 'DESC'; // force sort.
537 options.params.limit = 9999;
538 _this.grid.footer.pageSize = 9999;
539 vis.category_type_id_name = false;
540 cm.setHidden(cid('created'), true);
541 cm.setHidden(cid('published'), true);
542 cm.setHidden(cid('template_id_template'), true);
543 this.sortInfo.field = 'seq_id'; // force sort.
544 this.sortInfo.direction = 'ASC'; // force sort.
548 options.params.limit = 20;
549 _this.grid.footer.pageSize = 20;
550 vis.menu_page_id_title = false;
551 cm.setHidden(cid('created'), false);
552 cm.setHidden(cid('published'), false);
553 cm.setHidden(cid('template_id_template'), true);
554 this.sortInfo.field = 'seq_id'; // force sort.
555 this.sortInfo.direction = 'ASC'; // force sort.
559 if (_this.showDeleted.pressed) {
560 options.params._show_deleted = 1;
566 cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);
573 update : function (_self, record, operation)
575 if (operation != 'commit') {
578 // only used to change active status.
582 url : baseURL + '/Roo/Cms_page',
\r
584 id : record.data.id,
\r
585 is_draft : record.data.is_draft
\r
587 success : function(res) {
588 _this.grid.footer.onClick('refresh');
598 url : baseURL + '/Roo/cms_page.php',
603 xtype : 'JsonReader',
616 'format' : 'Y-m-d H:i:s'
623 'name': 'comments_no',
627 'name': 'trackbacks_no',
635 'name': 'has_extended',
643 'name': 'category_id',
647 'name': 'category_id_title',
657 'format' : 'Y-m-d H:i:s'
662 'format' : 'Y-m-d H:i:s'
665 'name': 'to_replace_id',
681 'name': 'parent_id_title',
686 'name': 'author_id_id',
690 'name': 'author_id_office_id',
694 'name': 'author_id_name',
698 'name': 'author_id_phone',
702 'name': 'author_id_fax',
706 'name': 'author_id_email',
710 'name': 'author_id_company_id',
714 'name': 'author_id_role',
718 'name': 'author_id_active',
722 'name': 'author_id_remarks',
726 'name': 'author_id_passwd',
730 'name': 'author_id_owner_id',
734 'name': 'author_id_lang',
738 'name': 'author_id_no_reset_sent',
742 'name': 'author_id_action_type',
746 'name': 'author_id_project_id',
750 'name': 'category_id_id',
754 'name': 'category_id_parent_id',
758 'name': 'category_id_short_name',
762 'name': 'category_id_title',
766 'name': 'category_id_page_text',
770 'name': 'category_id_type',
774 'name': 'category_id_search_on',
778 'name': 'category_id_image_menu_id',
782 'name': 'category_id_image_menuover_id',
786 'name': 'category_id_image_leftactive_id',
790 'name': 'category_id_image_page_id',
794 'name': 'category_id_display_order',
798 'name': 'category_id_more_info_title',
802 'name': 'category_id_more_info_text',
806 'name': 'category_id_visible',
810 'name': 'to_replace_id_id',
814 'name': 'to_replace_id_title',
818 'name': 'to_replace_id_published',
822 'name': 'to_replace_id_body',
826 'name': 'to_replace_id_comments_no',
830 'name': 'to_replace_id_trackbacks_no',
834 'name': 'to_replace_id_extended',
838 'name': 'to_replace_id_has_extended',
842 'name': 'to_replace_id_author_id',
846 'name': 'to_replace_id_category_id',
850 'name': 'to_replace_id_is_draft',
854 'name': 'to_replace_id_updated',
858 'name': 'to_replace_id_created',
862 'name': 'to_replace_id_to_replace_id',
866 'name': 'to_replace_id_page_link',
870 'name': 'to_replace_id_in_rss',
874 'name': 'to_replace_id_parent_id',
878 'name': 'parent_id_id',
882 'name': 'parent_id_title',
886 'name': 'parent_id_published',
890 'name': 'parent_id_body',
894 'name': 'parent_id_comments_no',
898 'name': 'parent_id_trackbacks_no',
902 'name': 'parent_id_extended',
906 'name': 'parent_id_has_extended',
910 'name': 'parent_id_author_id',
914 'name': 'parent_id_category_id',
918 'name': 'parent_id_is_draft',
922 'name': 'parent_id_updated',
926 'name': 'parent_id_created',
930 'name': 'parent_id_to_replace_id',
934 'name': 'parent_id_page_link',
938 'name': 'parent_id_in_rss',
942 'name': 'parent_id_parent_id',
948 totalProperty : 'total',
955 xtype : 'ColumnModel',
956 dataIndex : 'is_draft',
957 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
958 renderer : function(v,x,r) {
960 var state = v> 0 ? '' : '-checked';
962 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
969 xtype : 'ColumnModel',
970 dataIndex : 'created',
971 header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
972 renderer : function(v) { return v? v.format('d/M/Y') : '--' },
978 xtype : 'ColumnModel',
979 dataIndex : 'published',
980 header : _this._strings['9b9d8a976b42e0bd66381797644943d5'] /* Published */,
981 renderer : function(v,x,r) {
982 if (r.data.is_draft) {
986 return v? v.format('d/M/Y') : '--'
993 xtype : 'ColumnModel',
994 dataIndex : 'page_link',
995 header : _this._strings['2cbaa804531fc7367ccc699fb1eef52a'] /* Page link / Name / Order */,
996 renderer : function(v,x,r) {
997 if (r.data.page_type_id_name == 'page') {
998 return String.format('{0}', v);
1000 if (r.data.page_type_id_name == 'blog') {
1001 return String.format('{0}', v);
1003 // what about categories.??
1005 // menu, or elements.. ??
1007 var d = r.json.depth || 0;
1009 for (i = 0; i < d; i++) {
1012 if (r.data.page_type_id_name == 'element') {
1013 return String.format('{0}<i>{1}</i>', pr, v);
1016 return String.format('{0}{1}', pr, v);
1025 xtype : 'ColumnModel',
1026 dataIndex : 'title',
1027 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1028 renderer : function(v,x,r) {
1030 var d = r.json.depth || 0;
1032 for (i = 0; i < d; i++) {
1037 return String.format( '<span style="color:blue">{1}{2}</span>' +
1038 (r.data.is_draft ? '<s>{0}</s>' : '{0}'),
1041 (r.data.page_type_id_name == 'menu' ? '('+r.data.seq_id +')' : ''),
1042 (r.data.category_page_id *1 ? ( '[' + r.data.category_page_id_title +'] ' ): '')
1050 xtype : 'ColumnModel',
1051 dataIndex : 'template_id_template',
1052 header : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1053 renderer : function(v) { return String.format('{0}', v || ''); },
1059 xtype : 'ColumnModel',
1060 dataIndex : 'category_type_id_name',
1061 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1062 renderer : function(v, x, r) {
1064 if (r.data.language.length) {
1065 return '>> ' + Pman.I18n.toName('l', r.data.language);
1067 /* if (r.data.in_rss) {
1068 return String.format('{0}', v);
1070 if (r.data.is_element) {
1071 return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : '');
1081 xtype : 'ColumnModel',
1082 dataIndex : 'menu_page_id_title',
1083 header : _this._strings['f7070be7ec7d2443714a2e5dc63f4de2'] /* Links to */,
1084 renderer : function(v,x,r) {
1086 if (r.data.is_attachment) {
1087 return "[ATTACHMENT]";
1089 return String.format('{0}', v);
1096 xtype : 'ColumnModel',
1097 dataIndex : 'author_id_name',
1098 header : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1099 renderer : function(v) { return String.format('{0}', v); },
1105 xtype : 'ColumnModel',
1106 dataIndex : 'parent_id_title',
1107 header : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1109 renderer : function(v) { return String.format('{0}', v || ''); },
1115 xtype : 'ColumnModel',
1116 dataIndex : 'to_replace_id_title',
1117 header : _this._strings['75ae2cfdf786e5577f1b619f4ca8d728'] /* To replace */,
1119 renderer : function(v) { return String.format('{0}', v); },
1125 xtype : 'ColumnModel',
1126 dataIndex : 'has_extended',
1127 header : _this._strings['f46885d21c98f597303699f41b3d7afd'] /* Ex? */,
1128 renderer : function(v) { return String.format('{0}', v); },
1134 xtype : 'ColumnModel',
1135 dataIndex : 'trackbacks_no',
1136 header : _this._strings['a4863ff1cdfa709d5bf80939cd2e6757'] /* T# */,
1138 renderer : function(v) { return String.format('{0}', v); },
1144 xtype : 'ColumnModel',
1145 dataIndex : 'comments_no',
1146 header : _this._strings['d7efa19fbe7d3972fd5adb6024223d74'] /* C# */,
1147 renderer : function(v) { return String.format('{0}', v); },
1156 xtype : 'ContentPanel',
1157 autoCreate : { tag: 'iframe', src : 'about:blank' },
1158 fitContainer : true,
1161 title : _this._strings['08d0135e24822f43171ed4944fc3bdda'] /* Preview (resize by dragging next to this bar) */,
1163 render : function (_self)
1165 _this.prepanel = _self;