DataObjects/Cms_page.php
[Pman.Cms] / Pman.Tab.CmsBlog.Old.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Tab.CmsBlog');
6
7 Pman.Tab.CmsBlog.Old = new Roo.XComponent({
8
9  _strings : {
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"
38  },
39
40   part     :  ["Cms", "Old" ],
41   order    : '001-Pman.Tab.CmsBlog.Old',
42   region   : 'center',
43   parent   : false,
44   name     : "unnamed module",
45   disabled : false, 
46   permname : '', 
47   _tree : function()
48   {
49    var _this = this;
50    var MODULE = this;
51    return {
52    xtype : 'NestedLayoutPanel',
53    title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries  */,
54    xns : Roo,
55    '|xns' : 'Roo',
56    layout : {
57     xtype : 'BorderLayout',
58     xns : Roo,
59     '|xns' : 'Roo',
60     center : {
61      xtype : 'LayoutRegion',
62      xns : Roo,
63      '|xns' : 'Roo'
64     },
65     east : {
66      xtype : 'LayoutRegion',
67      split : true,
68      titlebar : true,
69      width : 300,
70      xns : Roo,
71      '|xns' : 'Roo'
72     },
73     items  : [
74      {
75       xtype : 'GridPanel',
76       background : false,
77       fitContainer : true,
78       fitToframe : true,
79       region : 'center',
80       tableName : 'cms_page',
81       title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries */,
82       listeners : {
83        activate : function() {
84             _this.panel = this;
85             if (_this.grid) {
86                 _this.grid.footer.onClick('first');
87             }
88         }
89       },
90       xns : Roo,
91       '|xns' : 'Roo',
92       grid : {
93        xtype : 'Grid',
94        autoExpandColumn : 'title',
95        loadMask : true,
96        listeners : {
97         cellclick : function (g, ri,ci, e)\r
98          {\r
99              var h = g.getColumnModel().config[ci].dataIndex;\r
100              if (h != 'is_draft') {\r
101                  return;\r
102              }\r
103              var rec = g.ds.getAt(ri);
104              
105              if(rec.data.is_system_page*1 == 1){
106                  Roo.MessageBox.alert('Error', 'You cannot de-active the system page');
107                  return;
108              }\r
109              rec.set('is_draft', rec.data.is_draft ? 0 : 1);\r
110              rec.commit();\r
111          },
112         render : function() 
113          {
114             _this.grid = this; 
115              _this.dialog = Pman.Dialog.CmsBlog;
116              if (_this.panel.active) {
117                 this.footer.onClick('first');
118              }
119          },
120         rowclick : function (_self, rowIndex, e)
121          {
122              var s = this.dataSource.getAt(rowIndex);
123          
124              if(s.data.id *1 > 0){
125              
126                  _this.prepanel.el.dom.src =  baseURL + '/Roo/Cms_page?_preview=' +  s.data.id ; \r
127              }
128           //   Roo.log(s.data);
129           //   _this.prepanel.setContent(s.data.body,true);
130          },
131         rowdblclick : function (_self, rowIndex, e)
132          {
133          
134              var s = this.dataSource.getAt(rowIndex);
135              /*  
136              if (s.data.language.length) {
137                  Roo.log('in lang');
138                  _this.dialog.show({ id : s.data.parent_id } , function() {
139                      _this.grid.footer.onClick('refresh');
140                  });
141                  return;
142              }*/
143              _this.dialog.show(s.data, function() {
144                  _this.grid.footer.onClick('refresh');
145              }); 
146              
147          }
148        },
149        xns : Roo.grid,
150        '|xns' : 'Roo.grid',
151        footer : {
152         xtype : 'PagingToolbar',
153         displayInfo : true,
154         displayMsg : _this._strings['30a2a59b5adaa49803297d4c06e09e67'] /* Displaying cms_page{0} - {1} of {2} */,
155         emptyMsg : _this._strings['f17755c3f16cb257f7793b9865ebafb3'] /* No cms_page found */,
156         pageSize : 20,
157         xns : Roo,
158         '|xns' : 'Roo',
159         items  : [
160          {
161           xtype : 'Button',
162           enableToggle : true,
163           text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
164           listeners : {
165            click : function (_self, e)
166             {
167                 _this.grid.footer.onClick.defer(100, _this.grid.footer, ['first'] );
168                 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
169             },
170            render : function (_self)
171             {
172               _this.showDeleted = this;
173             }
174           },
175           xns : Roo.Toolbar,
176           '|xns' : 'Roo.Toolbar'
177          }
178         ]
179        },
180        toolbar : {
181         xtype : 'Toolbar',
182         xns : Roo,
183         '|xns' : 'Roo',
184         items  : [
185          {
186           xtype : 'TextField',
187           listeners : {
188            render : function (_self)
189             {
190             _this.searchBox=  _self;
191             },
192            specialkey : function (_self, e)
193             {
194             _this.grid.footer.onClick('first');
195             }
196           },
197           xns : Roo.form,
198           '|xns' : 'Roo.form'
199          },
200          {
201           xtype : 'Button',
202           cls : 'x-btn-icon',
203           icon : rootURL + '/Pman/templates/images/search.gif',
204           listeners : {
205            click : function (_self, e)
206             {
207             _this.grid.footer.onClick('first');
208             }
209           },
210           xns : Roo.Toolbar,
211           '|xns' : 'Roo.Toolbar'
212          },
213          {
214           xtype : 'Button',
215           cls : 'x-btn-icon',
216           icon : rootURL + '/Pman/templates/images/edit-clear.gif',
217           listeners : {
218            click : function (_self, e)
219             {
220                 _this.searchBox.setValue('');
221                 
222                 _this.grid.footer.onClick('first');
223             }
224           },
225           xns : Roo.Toolbar,
226           '|xns' : 'Roo.Toolbar'
227          },
228          {
229           xtype : 'ComboBox',
230           allowBlank : false,
231           alwaysQuery : true,
232           displayField : 'display_name',
233           editable : false,
234           emptyText : _this._strings['779e2624ddf330fb05b51ae59faf212d'] /* Select Status Type */,
235           fieldLabel : _this._strings['6a5b847af3d97df722040debdbccfbed'] /* Page Type */,
236           forceSelection : true,
237           hiddenName : 'page_type',
238           listWidth : 400,
239           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
240           minChars : 2,
241           name : 'page_type',
242           pageSize : 20,
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',
247           typeAhead : false,
248           valueField : 'id',
249           listeners : {
250            render : function (_self)
251             {
252                 _this.page_type = _self;
253                
254                 new Pman.request({\r
255                     method : 'GET',\r
256                     url : baseURL + '/Roo/core_enum',\r
257                     params : {\r
258                         etype : 'cms_page_type',
259                         _columns : 'id,name,display_name',
260                         sort : 'seqid',
261                         dir : 'ASC',
262                         cmsTab : 1,
263                         limit : 1\r
264                     },
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];
269                     }\r
270                });
271             },
272            select : function (combo, record, index)
273             {
274                 _this.grid.footer.onClick('first');
275                 _this.category_type.hide();
276                 if(record.data.name == 'blog'){
277                     _this.category_type.show();
278                 }
279                combo.selectedData =  record.data;
280                 
281             }
282           },
283           xns : Roo.form,
284           '|xns' : 'Roo.form',
285           store : {
286            xtype : 'Store',
287            remoteSort : true,
288            sortInfo : { direction : 'ASC', field: 'seqid' },
289            listeners : {
290             beforeload : function (_self, o){
291                  o.params = o.params || {};
292                  // set more here
293                  o.params.etype = 'cms_page_type';
294                //  o.params.cmsTab = 1;
295              }
296            },
297            xns : Roo.data,
298            '|xns' : 'Roo.data',
299            proxy : {
300             xtype : 'HttpProxy',
301             method : 'GET',
302             url : baseURL + '/Roo/core_enum.php',
303             xns : Roo.data,
304             '|xns' : 'Roo.data'
305            },
306            reader : {
307             xtype : 'JsonReader',
308             fields : [{"name":"id","type":"int"},{"name":"display_name","type":"string"}],
309             id : 'id',
310             root : 'data',
311             totalProperty : 'total',
312             xns : Roo.data,
313             '|xns' : 'Roo.data'
314            }
315           }
316          },
317          {
318           xtype : 'ComboBox',
319           allowBlank : true,
320           displayField : 'name',
321           editable : false,
322           emptyText : _this._strings['8dfef8a6f3beef9ff28ff1fafb5c2009'] /* Select Category Type */,
323           fieldLabel : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
324           forceSelection : true,
325           hiddenName : 'category_type',
326           listWidth : 400,
327           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
328           minChars : 2,
329           pageSize : 20,
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',
334           typeAhead : true,
335           valueField : 'id',
336           width : 200,
337           listeners : {
338            render : function (_self)
339             {
340                 _this.category_type = _self;
341                 _this.category_type.hide();
342             },
343            select : function (combo, record, index)
344             {
345                 _this.grid.footer.onClick('first');
346             }
347           },
348           xns : Roo.form,
349           '|xns' : 'Roo.form',
350           store : {
351            xtype : 'Store',
352            beforeload : function (_self, o){
353                o.params = o.params || {};
354                // set more here
355                o.params.etype = 'cms_page_type'; 
356            },
357            remoteSort : true,
358            sortInfo : { direction : 'ASC', field: 'id' },
359            xns : Roo.data,
360            '|xns' : 'Roo.data',
361            proxy : {
362             xtype : 'HttpProxy',
363             method : 'GET',
364             url : baseURL + '/Roo/Cms_category_type.php',
365             xns : Roo.data,
366             '|xns' : 'Roo.data'
367            },
368            reader : {
369             xtype : 'JsonReader',
370             fields : [{"name":"id","type":"int"},{"name":"name","type":"string"}],
371             id : 'id',
372             root : 'data',
373             totalProperty : 'total',
374             xns : Roo.data,
375             '|xns' : 'Roo.data'
376            }
377           }
378          },
379          {
380           xtype : 'Fill',
381           xns : Roo.Toolbar,
382           '|xns' : 'Roo.Toolbar'
383          },
384          {
385           xtype : 'Button',
386           cls : 'x-btn-text-icon',
387           icon : rootURL + '/Pman/templates/images/trash.gif',
388           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
389           listeners : {
390            click : function()
391             {
392                 var ds = false;
393                 if(_this.grid.selModel.getSelections().length != 1){
394                     Roo.MessageBox.alert("Error", "Select page to delete");
395                     return;
396                 }
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.");
400                     return;
401                 }
402                 Roo.MessageBox.confirm("Confirm", 
403                     "Are you sure you want to delete this, it can not be recovered if you make a mistake!", 
404                     function(res) {
405                         if (res != 'yes') {
406                             return;
407                         }
408                         new Pman.Request({
409                             method : 'POST',
410                             url : baseURL + '/Roo/cms_page',
411                             params : {
412                                 _delete : sel.data.id
413                             },
414                             success : function() { 
415                                 _this.grid.footer.onClick('refresh');
416                             }
417                         });
418                         
419                             
420                     }
421                 );
422                 
423             }
424           },
425           xns : Roo.Toolbar,
426           '|xns' : 'Roo.Toolbar'
427          },
428          {
429           xtype : 'Button',
430           cls : 'x-btn-text-icon',
431           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
432           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
433           listeners : {
434            click : function()
435             {
436                 var ds = false;
437                 if(_this.grid.selModel.getSelections().length == 1){
438                    ds = _this.grid.selModel.getSelected().data;
439                 }
440                 
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;
445                 
446                 if(!ds){
447                     page_type_id = s.id;
448                     page_type_id_name = s.name;
449                     page_type_id_display_name = s.display_name;
450                     
451                     if(s.name == 'page'){
452                         page_type_id_display_name = 'Pages';
453                     }
454                      
455                 }
456                
457                 var q =   {
458                     id : 0,
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
465                 };
466                
467                _this.dialog.show( q, function() {
468                  _this.grid.footer.onClick('first');
469                });
470             }
471           },
472           xns : Roo.Toolbar,
473           '|xns' : 'Roo.Toolbar'
474          }
475         ]
476        },
477        dataSource : {
478         xtype : 'Store',
479         remoteSort : true,
480         sortInfo : { field : 'created' , direction : 'DESC' },
481         listeners : {
482          beforeload : function (_self, options)
483           {
484               
485               if (Pman.building || !Pman.Tab.Cms.panel.active) {
486                   return false;
487               }
488               var cm = _this.grid.colModel;
489               var vis = {
490                   category_type_id_name : true,
491                   menu_page_id_title : true
492               };
493               var cm = _this.grid.getColumnModel();
494               function cid(str) {
495                   return cm.getIndexByDataIndex(str);
496               }
497               
498               options.params['search[name]'] = _this.searchBox.getValue();
499               
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..
506               
507               
508               var page_type_name = (_this.page_type.lastData.name) ? _this.page_type.lastData.name : 'page';
509               
510               Roo.log(page_type_name);
511               switch(page_type_name) {
512                   case 'page' : 
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.
521                                    
522                       break;
523                   case 'blog' :
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.
533                       
534                       break;
535                   
536                   case 'menu' :
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.
545                       
546                       break;
547                   case 'category' :
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.
556                        
557                       break;                
558               }
559               if (_this.showDeleted.pressed) {
560                   options.params._show_deleted = 1;
561               }
562               
563               
564             //  }
565               for (var i in vis) {
566                   cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);
567               }
568           
569               
570               
571               
572           },
573          update : function (_self, record, operation)
574           {
575               if (operation != 'commit') {
576                   return;
577               }
578               // only used to change active status.
579               
580               new Pman.request({\r
581                   method : 'POST',\r
582                   url : baseURL + '/Roo/Cms_page',\r
583                   params : {\r
584                       id : record.data.id,\r
585                       is_draft : record.data.is_draft\r
586                   },
587                   success : function(res) {
588                      _this.grid.footer.onClick('refresh');
589                  }\r
590               });
591           }
592         },
593         xns : Roo.data,
594         '|xns' : 'Roo.data',
595         proxy : {
596          xtype : 'HttpProxy',
597          method : 'GET',
598          url : baseURL + '/Roo/cms_page.php',
599          xns : Roo.data,
600          '|xns' : 'Roo.data'
601         },
602         reader : {
603          xtype : 'JsonReader',
604          fields : [
605              {
606                  'name': 'id',
607                  'type': 'int'
608              },
609              {
610                  'name': 'title',
611                  'type': 'string'
612              },
613              {
614                  'name': 'published',
615                  'type': 'date',
616                  'format' : 'Y-m-d H:i:s'
617              },
618              {
619                  'name': 'body',
620                  'type': 'string'
621              },
622              {
623                  'name': 'comments_no',
624                  'type': 'int'
625              },
626              {
627                  'name': 'trackbacks_no',
628                  'type': 'int'
629              },
630              {
631                  'name': 'extended',
632                  'type': 'string'
633              },
634              {
635                  'name': 'has_extended',
636                  'type': 'int'
637              },
638              {
639                  'name': 'author_id',
640                  'type': 'int'
641              },
642              {
643                  'name': 'category_id',
644                  'type': 'int'
645              },
646              {
647                  'name': 'category_id_title',
648                  'type': 'string'
649              },
650              {
651                  'name': 'is_draft',
652                  'type': 'int'
653              },
654              {
655                  'name': 'updated',
656                  'type': 'date',
657                  'format' : 'Y-m-d H:i:s'
658              },
659              {
660                  'name': 'created',
661                  'type': 'date',
662                  'format' : 'Y-m-d H:i:s'
663              },
664              {
665                  'name': 'to_replace_id',
666                  'type': 'int'
667              },
668              {
669                  'name': 'page_link',
670                  'type': 'string'
671              },
672              {
673                  'name': 'in_rss',
674                  'type': 'int'
675              },
676              {
677                  'name': 'parent_id',
678                  'type': 'int'
679              },
680              {
681                  'name': 'parent_id_title',
682                  'type': 'string'
683              },
684          
685              {
686                  'name': 'author_id_id',
687                  'type': 'int'
688              },
689              {
690                  'name': 'author_id_office_id',
691                  'type': 'int'
692              },
693              {
694                  'name': 'author_id_name',
695                  'type': 'string'
696              },
697              {
698                  'name': 'author_id_phone',
699                  'type': 'string'
700              },
701              {
702                  'name': 'author_id_fax',
703                  'type': 'string'
704              },
705              {
706                  'name': 'author_id_email',
707                  'type': 'string'
708              },
709              {
710                  'name': 'author_id_company_id',
711                  'type': 'int'
712              },
713              {
714                  'name': 'author_id_role',
715                  'type': 'string'
716              },
717              {
718                  'name': 'author_id_active',
719                  'type': 'int'
720              },
721              {
722                  'name': 'author_id_remarks',
723                  'type': 'string'
724              },
725              {
726                  'name': 'author_id_passwd',
727                  'type': 'string'
728              },
729              {
730                  'name': 'author_id_owner_id',
731                  'type': 'int'
732              },
733              {
734                  'name': 'author_id_lang',
735                  'type': 'string'
736              },
737              {
738                  'name': 'author_id_no_reset_sent',
739                  'type': 'int'
740              },
741              {
742                  'name': 'author_id_action_type',
743                  'type': 'string'
744              },
745              {
746                  'name': 'author_id_project_id',
747                  'type': 'int'
748              },
749              {
750                  'name': 'category_id_id',
751                  'type': 'int'
752              },
753              {
754                  'name': 'category_id_parent_id',
755                  'type': 'int'
756              },
757              {
758                  'name': 'category_id_short_name',
759                  'type': 'string'
760              },
761              {
762                  'name': 'category_id_title',
763                  'type': 'string'
764              },
765              {
766                  'name': 'category_id_page_text',
767                  'type': 'string'
768              },
769              {
770                  'name': 'category_id_type',
771                  'type': 'string'
772              },
773              {
774                  'name': 'category_id_search_on',
775                  'type': 'string'
776              },
777              {
778                  'name': 'category_id_image_menu_id',
779                  'type': 'int'
780              },
781              {
782                  'name': 'category_id_image_menuover_id',
783                  'type': 'int'
784              },
785              {
786                  'name': 'category_id_image_leftactive_id',
787                  'type': 'int'
788              },
789              {
790                  'name': 'category_id_image_page_id',
791                  'type': 'int'
792              },
793              {
794                  'name': 'category_id_display_order',
795                  'type': 'int'
796              },
797              {
798                  'name': 'category_id_more_info_title',
799                  'type': 'string'
800              },
801              {
802                  'name': 'category_id_more_info_text',
803                  'type': 'string'
804              },
805              {
806                  'name': 'category_id_visible',
807                  'type': 'int'
808              },
809              {
810                  'name': 'to_replace_id_id',
811                  'type': 'int'
812              },
813              {
814                  'name': 'to_replace_id_title',
815                  'type': 'string'
816              },
817              {
818                  'name': 'to_replace_id_published',
819                  'type': 'string'
820              },
821              {
822                  'name': 'to_replace_id_body',
823                  'type': 'string'
824              },
825              {
826                  'name': 'to_replace_id_comments_no',
827                  'type': 'int'
828              },
829              {
830                  'name': 'to_replace_id_trackbacks_no',
831                  'type': 'int'
832              },
833              {
834                  'name': 'to_replace_id_extended',
835                  'type': 'string'
836              },
837              {
838                  'name': 'to_replace_id_has_extended',
839                  'type': 'int'
840              },
841              {
842                  'name': 'to_replace_id_author_id',
843                  'type': 'int'
844              },
845              {
846                  'name': 'to_replace_id_category_id',
847                  'type': 'int'
848              },
849              {
850                  'name': 'to_replace_id_is_draft',
851                  'type': 'int'
852              },
853              {
854                  'name': 'to_replace_id_updated',
855                  'type': 'string'
856              },
857              {
858                  'name': 'to_replace_id_created',
859                  'type': 'string'
860              },
861              {
862                  'name': 'to_replace_id_to_replace_id',
863                  'type': 'int'
864              },
865              {
866                  'name': 'to_replace_id_page_link',
867                  'type': 'string'
868              },
869              {
870                  'name': 'to_replace_id_in_rss',
871                  'type': 'int'
872              },
873              {
874                  'name': 'to_replace_id_parent_id',
875                  'type': 'int'
876              },
877              {
878                  'name': 'parent_id_id',
879                  'type': 'int'
880              },
881              {
882                  'name': 'parent_id_title',
883                  'type': 'string'
884              },
885              {
886                  'name': 'parent_id_published',
887                  'type': 'string'
888              },
889              {
890                  'name': 'parent_id_body',
891                  'type': 'string'
892              },
893              {
894                  'name': 'parent_id_comments_no',
895                  'type': 'int'
896              },
897              {
898                  'name': 'parent_id_trackbacks_no',
899                  'type': 'int'
900              },
901              {
902                  'name': 'parent_id_extended',
903                  'type': 'string'
904              },
905              {
906                  'name': 'parent_id_has_extended',
907                  'type': 'int'
908              },
909              {
910                  'name': 'parent_id_author_id',
911                  'type': 'int'
912              },
913              {
914                  'name': 'parent_id_category_id',
915                  'type': 'int'
916              },
917              {
918                  'name': 'parent_id_is_draft',
919                  'type': 'int'
920              },
921              {
922                  'name': 'parent_id_updated',
923                  'type': 'string'
924              },
925              {
926                  'name': 'parent_id_created',
927                  'type': 'string'
928              },
929              {
930                  'name': 'parent_id_to_replace_id',
931                  'type': 'int'
932              },
933              {
934                  'name': 'parent_id_page_link',
935                  'type': 'string'
936              },
937              {
938                  'name': 'parent_id_in_rss',
939                  'type': 'int'
940              },
941              {
942                  'name': 'parent_id_parent_id',
943                  'type': 'int'
944              }
945          ],
946          id : 'id',
947          root : 'data',
948          totalProperty : 'total',
949          xns : Roo.data,
950          '|xns' : 'Roo.data'
951         }
952        },
953        colModel : [
954         {
955          xtype : 'ColumnModel',
956          dataIndex : 'is_draft',
957          header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
958          renderer : function(v,x,r) {
959               
960              var state = v> 0 ?  '' : '-checked';
961          
962              return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
963          },
964          width : 75,
965          xns : Roo.grid,
966          '|xns' : 'Roo.grid'
967         },
968         {
969          xtype : 'ColumnModel',
970          dataIndex : 'created',
971          header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
972          renderer : function(v) { return v? v.format('d/M/Y') : '--' },
973          width : 75,
974          xns : Roo.grid,
975          '|xns' : 'Roo.grid'
976         },
977         {
978          xtype : 'ColumnModel',
979          dataIndex : 'published',
980          header : _this._strings['9b9d8a976b42e0bd66381797644943d5'] /* Published */,
981          renderer : function(v,x,r) { 
982              if (r.data.is_draft) { 
983                  return '[DRAFT]';
984              }
985          
986              return v? v.format('d/M/Y') : '--' 
987          },
988          width : 75,
989          xns : Roo.grid,
990          '|xns' : 'Roo.grid'
991         },
992         {
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); 
999              }
1000              if (r.data.page_type_id_name == 'blog') {
1001                  return String.format('{0}', v); 
1002              }
1003              // what about categories.??
1004              
1005              // menu, or elements.. ??
1006              
1007              var d = r.json.depth || 0;
1008              var pr = ''; 
1009              for (i = 0; i < d; i++) {
1010                pr += ' ..  ';
1011              }
1012              if (r.data.page_type_id_name == 'element') {    
1013                  return String.format('{0}<i>{1}</i>', pr,  v);     
1014              }
1015              // menu..
1016              return String.format('{0}{1}', pr,  v);
1017              
1018              
1019          },
1020          width : 120,
1021          xns : Roo.grid,
1022          '|xns' : 'Roo.grid'
1023         },
1024         {
1025          xtype : 'ColumnModel',
1026          dataIndex : 'title',
1027          header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1028          renderer : function(v,x,r) { 
1029          
1030              var d = r.json.depth || 0;
1031              var pr = ''; 
1032              for (i = 0; i < d; i++) {
1033                pr += ' ..  ';
1034              }
1035              
1036              
1037              return String.format( '<span style="color:blue">{1}{2}</span>' + 
1038                      (r.data.is_draft ? '<s>{0}</s>' : '{0}'),
1039                      pr + v,
1040                      
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 +'] ' ): '')
1043                      );
1044           },
1045          width : 200,
1046          xns : Roo.grid,
1047          '|xns' : 'Roo.grid'
1048         },
1049         {
1050          xtype : 'ColumnModel',
1051          dataIndex : 'template_id_template',
1052          header : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1053          renderer : function(v) { return String.format('{0}', v  || ''); },
1054          width : 75,
1055          xns : Roo.grid,
1056          '|xns' : 'Roo.grid'
1057         },
1058         {
1059          xtype : 'ColumnModel',
1060          dataIndex : 'category_type_id_name',
1061          header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1062          renderer : function(v, x, r) { 
1063              
1064              if (r.data.language.length) {
1065                  return '&gt;&gt; ' + Pman.I18n.toName('l', r.data.language);
1066              }
1067            /*  if (r.data.in_rss) {
1068                  return String.format('{0}', v); 
1069              }
1070              if (r.data.is_element) {
1071                  return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : ''); 
1072              }
1073              */
1074              return '';
1075          },
1076          width : 100,
1077          xns : Roo.grid,
1078          '|xns' : 'Roo.grid'
1079         },
1080         {
1081          xtype : 'ColumnModel',
1082          dataIndex : 'menu_page_id_title',
1083          header : _this._strings['f7070be7ec7d2443714a2e5dc63f4de2'] /* Links to */,
1084          renderer : function(v,x,r) { 
1085          
1086             if (r.data.is_attachment) {
1087                  return "[ATTACHMENT]";
1088              }
1089             return String.format('{0}', v); 
1090           },
1091          width : 200,
1092          xns : Roo.grid,
1093          '|xns' : 'Roo.grid'
1094         },
1095         {
1096          xtype : 'ColumnModel',
1097          dataIndex : 'author_id_name',
1098          header : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1099          renderer : function(v) { return String.format('{0}', v); },
1100          width : 75,
1101          xns : Roo.grid,
1102          '|xns' : 'Roo.grid'
1103         },
1104         {
1105          xtype : 'ColumnModel',
1106          dataIndex : 'parent_id_title',
1107          header : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1108          hidden : true,
1109          renderer : function(v) { return String.format('{0}', v  || ''); },
1110          width : 75,
1111          xns : Roo.grid,
1112          '|xns' : 'Roo.grid'
1113         },
1114         {
1115          xtype : 'ColumnModel',
1116          dataIndex : 'to_replace_id_title',
1117          header : _this._strings['75ae2cfdf786e5577f1b619f4ca8d728'] /* To replace */,
1118          hidden : true,
1119          renderer : function(v) { return String.format('{0}', v); },
1120          width : 75,
1121          xns : Roo.grid,
1122          '|xns' : 'Roo.grid'
1123         },
1124         {
1125          xtype : 'ColumnModel',
1126          dataIndex : 'has_extended',
1127          header : _this._strings['f46885d21c98f597303699f41b3d7afd'] /* Ex? */,
1128          renderer : function(v) { return String.format('{0}', v); },
1129          width : 25,
1130          xns : Roo.grid,
1131          '|xns' : 'Roo.grid'
1132         },
1133         {
1134          xtype : 'ColumnModel',
1135          dataIndex : 'trackbacks_no',
1136          header : _this._strings['a4863ff1cdfa709d5bf80939cd2e6757'] /* T# */,
1137          hidden : true,
1138          renderer : function(v) { return String.format('{0}', v); },
1139          width : 25,
1140          xns : Roo.grid,
1141          '|xns' : 'Roo.grid'
1142         },
1143         {
1144          xtype : 'ColumnModel',
1145          dataIndex : 'comments_no',
1146          header : _this._strings['d7efa19fbe7d3972fd5adb6024223d74'] /* C# */,
1147          renderer : function(v) { return String.format('{0}', v); },
1148          width : 25,
1149          xns : Roo.grid,
1150          '|xns' : 'Roo.grid'
1151         }
1152        ]
1153       }
1154      },
1155      {
1156       xtype : 'ContentPanel',
1157       autoCreate : { tag: 'iframe', src : 'about:blank' },
1158       fitContainer : true,
1159       fitToFrame : true,
1160       region : 'east',
1161       title : _this._strings['08d0135e24822f43171ed4944fc3bdda'] /* Preview (resize by dragging next to this bar) */,
1162       listeners : {
1163        render : function (_self)
1164         {
1165             _this.prepanel = _self;
1166         
1167         }
1168       },
1169       xns : Roo,
1170       '|xns' : 'Roo'
1171      }
1172     ]
1173    }
1174   };  }
1175 });