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');
7 Pman.Tab.CmsBlog = new Roo.XComponent({
10 '30a2a59b5adaa49803297d4c06e09e67' :"Displaying cms_page{0} - {1} of {2}",
11 'a517747c3d12f99244ae598910d979c5' :"Author",
12 '63a6a88c066880c5ac42394a22803ca6' :"Refresh",
13 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
14 '0eceeb45861f9585dd7a97a3e36f85c6' :"Created",
15 '695e93e1d9db8283a9dd66782625065d' :"Child Elements",
16 'ebd9bec4d70abc789d439c1f136b0538' :"Layout",
17 '30269022e9d8f51beaabb52e5d0de2b7' :"Parent",
18 'a4863ff1cdfa709d5bf80939cd2e6757' :"T#",
19 'd7efa19fbe7d3972fd5adb6024223d74' :"C#",
20 '08d0135e24822f43171ed4944fc3bdda' :"Preview (resize by dragging next to this bar)",
21 '2cbaa804531fc7367ccc699fb1eef52a' :"Page link / Name / Order",
22 '3adbdb3ac060038aa0e6e6c138ef9873' :"Category",
23 'b8a00b5928fbead0626546550667b2b5' :"Pages, Menu and Blog Entries",
24 'c8043f5cd3d28cb76c548338497b06ab' :"Show Deleted",
25 'd645920e395fedad7bbbed0eca3fe2e0' :"40",
26 'be53a0541a6d36f6ecb879fa2c584b08' :"Image",
27 '9b9d8a976b42e0bd66381797644943d5' :"Published",
28 'b78a3223503896721cca1303f776159b' :"Title",
29 'f17755c3f16cb257f7793b9865ebafb3' :"No cms_page found",
30 'a9581db07856efb481fddef1b3e168f8' :"No page found",
31 'ce5bf551379459c1c61d2a204061c455' :"Location",
32 '0ecfa7150815d4ddb07470e3862c92c4' :"Export CMS (ZIP)",
33 '7ee49db2b46c732d681edc761cf487ae' :"Postion",
34 '5fb63579fc981698f97d55bfecb213ea' :"Copy",
35 '040dcb21af4618f18d04e667c07ef314' :"{0} - {1} of {2}",
36 'f46885d21c98f597303699f41b3d7afd' :"Ex?",
37 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
38 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
39 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
40 'f7070be7ec7d2443714a2e5dc63f4de2' :"Links to",
41 '75ae2cfdf786e5577f1b619f4ca8d728' :"To replace"
44 part : ["Cms", "Blog" ],
45 order : '001-Pman.Tab.CmsBlog',
47 parent : 'Pman.Tab.Cms',
48 name : "Pman.Tab.CmsBlog",
51 _tree : function(_data)
56 xtype : 'NestedLayoutPanel',
57 title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries */,
61 xtype : 'BorderLayout',
65 xtype : 'LayoutRegion',
70 xtype : 'LayoutRegion',
72 collapsedTitle : 'Child Elements',
75 title : _this._strings['695e93e1d9db8283a9dd66782625065d'] /* Child Elements */,
82 xtype : 'LayoutRegion',
96 tableName : 'cms_page',
97 title : _this._strings['b8a00b5928fbead0626546550667b2b5'] /* Pages, Menu and Blog Entries */,
99 activate : function() {
102 _this.grid.footer.onClick('first');
111 autoExpandColumn : 'title',
113 trigger_link_click : function(g, rowIndex, columnIndex, e)
117 var target = e.getTarget();
119 if(target.nodeName.toLowerCase() != 'a'){
123 var rec = _this.grid.ds.getAt(rowIndex);
125 var el = Roo.get(target);
127 var element_id = el.attr('data-element-id');
129 var element_id_name = el.attr('data-element-name');
130 var page_type_id = el.attr('data-page-type-id');
131 var parent_id = el.attr('data-parent-id');
132 var parent_id_title = el.attr('data-parent-title');
136 element_id : element_id,
137 element_id_name : element_id_name,
138 page_type_id : page_type_id,
139 page_type_id_name : 'element',
140 page_type_id_display_name : 'Elements',
141 parent_id : parent_id,
142 parent_id_title : parent_id_title
145 _this.dialog.show( params, function() {
146 _this.grid.footer.onClick('first');
153 cellclick : function (g, ri,ci, e)
\r
155 var h = this.colModel.getDataIndex(ci);
157 if (h != 'is_draft') {
\r
160 var rec = g.ds.getAt(ri);
162 if(rec.data.is_system_page * 1 == 1){
163 Roo.MessageBox.alert('Error', 'You cannot de-active the system page');
166 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
172 _this.dialog = Pman.Dialog.CmsBlog;
173 if (_this.panel.active) {
174 this.footer.onClick('first');
177 rowclick : function (_self, rowIndex, e)
179 var s = this.dataSource.getAt(rowIndex);
181 _this.prepanel.el.dom.innerHTML = '';
183 if(s.data.id * 1 < 1){
187 _this.prepanel.el.dom.src = baseURL + '/Cms/PageThumb/' + s.data.id;
189 _this.targetData = s;
191 _this.child_element_grid.footer.onClick('first');
194 rowdblclick : function (_self, rowIndex, e)
196 var s = this.dataSource.getAt(rowIndex);
198 if (s.data.language.length) {
200 _this.dialog.show({ id : s.data.parent_id } , function() {
201 _this.grid.footer.onClick('refresh');
205 _this.dialog.show(s.data, function() {
206 _this.grid.footer.onClick('refresh');
214 xtype : 'PagingToolbar',
216 displayMsg : _this._strings['30a2a59b5adaa49803297d4c06e09e67'] /* Displaying cms_page{0} - {1} of {2} */,
217 emptyMsg : _this._strings['f17755c3f16cb257f7793b9865ebafb3'] /* No cms_page found */,
225 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
227 click : function (_self, e)
229 _this.grid.footer.onClick.defer(100, _this.grid.footer, ['first'] );
230 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
232 render : function (_self)
234 _this.showDeleted = this;
238 '|xns' : 'Roo.Toolbar'
243 '|xns' : 'Roo.Toolbar'
247 text : _this._strings['0ecfa7150815d4ddb07470e3862c92c4'] /* Export CMS (ZIP) */,
249 click : function (_self, e)
252 url: baseURL + '/Roo/Cms_page',
259 Roo.MessageBox.alert("Downloading", "The file is downloading");
263 '|xns' : 'Roo.Toolbar'
268 '|xns' : 'Roo.Toolbar'
273 displayField : 'value',
276 triggerAction : 'all',
281 render : function (_self)
283 _this.image_size_sel = _self;
285 select : function (combo, record, index)
287 _this.grid.footer.onClick('first');
293 xtype : 'SimpleStore',
299 fields : [ 'key', 'value'],
314 render : function (_self)
316 _this.searchBox= _self;
318 specialkey : function (_self, e)
320 _this.grid.footer.onClick('first');
329 icon : rootURL + '/Pman/templates/images/search.gif',
331 click : function (_self, e)
333 _this.grid.footer.onClick('first');
337 '|xns' : 'Roo.Toolbar'
342 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
344 click : function (_self, e)
346 _this.searchBox.setValue('');
348 _this.grid.footer.onClick('first');
352 '|xns' : 'Roo.Toolbar'
357 '|xns' : 'Roo.Toolbar'
361 cls : 'x-btn-text-icon',
362 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
363 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
370 if(_this.grid.selModel.getSelections().length == 1){
371 ds = _this.grid.selModel.getSelected().data;
374 var page_type_id = 0;
375 var page_type_id_name = '';
376 var page_type_id_display_name = '';
378 var sel = _this.category_grid.getSelectionModel().getSelected();
380 if(!ds && sel && sel.data.pid * 1 > 0 && sel.data.type == 'page_type'){
381 page_type_id = sel.data.pid;
382 page_type_id_name = sel.data.name;
383 page_type_id_display_name = sel.data.display_name;
385 if(sel.data.name == 'page'){
386 page_type_id_display_name = 'Pages';
389 if(sel.data.name == 'blog'){
390 page_type_id_display_name = 'Blog Entries';
396 var s = _this.page_type.selectedData;
400 page_type_id_name = s.name;
401 page_type_id_display_name = s.display_name;
403 if(s.name == 'page'){
404 page_type_id_display_name = 'Pages';
411 parent_id : ds ? ds.id : '',
412 parent_id_title : ds ? ds.title : '',
413 page_link : ds && !ds.is_element ? (ds.page_link + '/') : '',
414 page_type_id : ds ? ds.page_type_id : page_type_id,
415 page_type_id_name : ds ? ds.page_type_id_name : page_type_id_name,
416 page_type_id_display_name : ds ? ds.page_type_id_display_name : page_type_id_display_name
419 _this.dialog.show( q, function() {
420 _this.grid.footer.onClick('first');
425 '|xns' : 'Roo.Toolbar'
430 '|xns' : 'Roo.Toolbar'
434 cls : 'x-btn-text-icon',
435 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
436 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
440 var s = _this.grid.selModel.getSelections();
442 if(_this.grid.selModel.getSelections().length != 1){
443 Roo.MessageBox.alert('Error', 'Please select one row to copy');
447 var sel = _this.grid.selModel.getSelected();
449 if(!sel || sel.data.id * 1 < 1){
450 Roo.MessageBox.alert('Error', 'Please select one row to copy');
455 url : baseURL + '/Roo/cms_page.php',
460 success : function(res) {
464 var params = Roo.apply({}, res.data);
469 _this.dialog.show( params, function() {
470 _this.grid.footer.onClick('first');
479 if(_this.grid.selModel.getSelections().length == 1){
480 ds = _this.grid.selModel.getSelected().data;
483 var page_type_id = 0;
484 var page_type_id_name = '';
485 var page_type_id_display_name = '';
487 var sel = _this.category_grid.getSelectionModel().getSelected();
489 if(!ds && sel && sel.data.pid * 1 > 0 && sel.data.type == 'page_type'){
490 page_type_id = sel.data.pid;
491 page_type_id_name = sel.data.name;
492 page_type_id_display_name = sel.data.display_name;
494 if(sel.data.name == 'page'){
495 page_type_id_display_name = 'Pages';
498 if(sel.data.name == 'blog'){
499 page_type_id_display_name = 'Blog Entries';
505 var s = _this.page_type.selectedData;
509 page_type_id_name = s.name;
510 page_type_id_display_name = s.display_name;
512 if(s.name == 'page'){
513 page_type_id_display_name = 'Pages';
520 parent_id : ds ? ds.id : '',
521 parent_id_title : ds ? ds.title : '',
522 page_link : ds && !ds.is_element ? (ds.page_link + '/') : '',
523 page_type_id : ds ? ds.page_type_id : page_type_id,
524 page_type_id_name : ds ? ds.page_type_id_name : page_type_id_name,
525 page_type_id_display_name : ds ? ds.page_type_id_display_name : page_type_id_display_name
528 _this.dialog.show( q, function() {
529 _this.grid.footer.onClick('first');
534 '|xns' : 'Roo.Toolbar'
539 '|xns' : 'Roo.Toolbar'
543 cls : 'x-btn-text-icon',
544 icon : rootURL + '/Pman/templates/images/trash.gif',
545 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
550 if(_this.grid.selModel.getSelections().length != 1){
551 Roo.MessageBox.alert("Error", "Select page to delete");
554 var sel = _this.grid.selModel.getSelected();
555 if(sel.data.is_system_page){
556 Roo.MessageBox.alert("Error", "System pages can not be deleted.");
561 Roo.MessageBox.confirm("Confirm",
562 "Are you sure you want to delete this, it can not be recovered if you make a mistake!",
569 url : baseURL + '/Roo/cms_page',
571 _delete : sel.data.id
573 success : function() {
574 _this.grid.footer.onClick('refresh');
586 url : baseURL + '/Roo/cms_page',
591 success : function() {
592 _this.grid.footer.onClick('refresh');
599 '|xns' : 'Roo.Toolbar'
606 sortInfo : { field : 'created' , direction : 'DESC' },
608 beforeload : function (_self, options)
610 if (Pman.building || !Pman.Tab.Cms.panel.active) {
614 var sel = _this.category_grid.getSelectionModel().getSelected();
616 if(!sel || sel.data.pid * 1 < 1){
621 options.params._with_primary_image = 1;
623 var cm = _this.grid.colModel;
625 category_type_id_name : true,
626 menu_page_id_title : true
629 var cm = _this.grid.getColumnModel();
632 return cm.getIndexByDataIndex(str);
635 options.params['search[name]'] = _this.searchBox.getValue();
637 options.params._exclude_columns = 'body,extended';
639 if(sel.data.type == 'page_type'){
640 options.params._page_type_id = sel.data.pid;
643 if(sel.data.type == 'category'){
644 options.params._category_id = sel.data.pid;
647 var size = _this.image_size_sel.getValue() * 1;
649 cm.setHidden(cid('primary_image_id'), false);
650 cm.setColumnWidth(cid('primary_image_id'), size + 10);
653 cm.setHidden(cid('primary_image_id'), true);
656 // options.params._treeview = 1;
657 options.params._pman_short = 1;
659 options.params.translation_of_id = 0;
661 options.params._with_translation_type = 1;
663 //options.params._requestMeta = 1; // always fetch meta.. as different types return different data..
666 switch(sel.data.name) {
668 // options.params.limit = 9999;
669 // _this.grid.footer.pageSize = 9999;
670 vis.menu_page_id_title = false;
671 cm.setHidden(cid('created'), true);
672 cm.setHidden(cid('published'), true);
673 cm.setHidden(cid('template_id_template'), false);
674 this.sortInfo.field = 'tree_sequence'; // force sort.
675 this.sortInfo.direction = 'ASC'; // force sort.
679 // options.params.limit = 20;
680 // options.params['search[category]'] = _this.category_type.getValue();
681 // _this.grid.footer.pageSize = 20;
682 vis.menu_page_id_title = false;
683 cm.setHidden(cid('created'), false);
684 cm.setHidden(cid('published'), false);
685 cm.setHidden(cid('template_id_template'), true);
686 this.sortInfo.field = 'published'; // force sort.
687 this.sortInfo.direction = 'DESC'; // force sort.
692 // options.params.limit = 9999;
693 // _this.grid.footer.pageSize = 9999;
694 vis.category_type_id_name = false;
695 cm.setHidden(cid('created'), true);
696 cm.setHidden(cid('published'), true);
697 cm.setHidden(cid('template_id_template'), true);
698 this.sortInfo.field = 'tree_sequence'; // force sort.
699 this.sortInfo.direction = 'ASC'; // force sort.
703 // options.params.limit = 20;
704 // _this.grid.footer.pageSize = 20;
705 vis.menu_page_id_title = false;
706 cm.setHidden(cid('created'), false);
707 cm.setHidden(cid('published'), false);
708 cm.setHidden(cid('template_id_template'), true);
709 this.sortInfo.field = 'tree_sequence'; // force sort.
710 this.sortInfo.direction = 'ASC'; // force sort.
715 if (_this.showDeleted.pressed) {
716 options.params._show_deleted = 1;
720 cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);
724 load : function (_self, records, options)
726 _this.child_element_panel.region.collapse();
728 update : function (_self, record, operation)
730 if (operation != 'commit') {
733 // only used to change active status.
737 url : baseURL + '/Roo/Cms_page',
\r
739 id : record.data.id,
\r
740 is_draft : record.data.is_draft
\r
742 success : function(res) {
743 _this.grid.footer.onClick('refresh');
753 url : baseURL + '/Roo/cms_page.php',
758 xtype : 'JsonReader',
771 'format' : 'Y-m-d H:i:s'
778 'name': 'comments_no',
782 'name': 'trackbacks_no',
790 'name': 'has_extended',
798 'name': 'category_id',
802 'name': 'category_id_title',
812 'format' : 'Y-m-d H:i:s'
817 'format' : 'Y-m-d H:i:s'
820 'name': 'to_replace_id',
836 'name': 'parent_id_title',
841 'name': 'author_id_id',
845 'name': 'author_id_office_id',
849 'name': 'author_id_name',
853 'name': 'author_id_phone',
857 'name': 'author_id_fax',
861 'name': 'author_id_email',
865 'name': 'author_id_company_id',
869 'name': 'author_id_role',
873 'name': 'author_id_active',
877 'name': 'author_id_remarks',
881 'name': 'author_id_passwd',
885 'name': 'author_id_owner_id',
889 'name': 'author_id_lang',
893 'name': 'author_id_no_reset_sent',
897 'name': 'author_id_action_type',
901 'name': 'author_id_project_id',
905 'name': 'category_id_id',
909 'name': 'category_id_parent_id',
913 'name': 'category_id_short_name',
917 'name': 'category_id_title',
921 'name': 'category_id_page_text',
925 'name': 'category_id_type',
929 'name': 'category_id_search_on',
933 'name': 'category_id_image_menu_id',
937 'name': 'category_id_image_menuover_id',
941 'name': 'category_id_image_leftactive_id',
945 'name': 'category_id_image_page_id',
949 'name': 'category_id_display_order',
953 'name': 'category_id_more_info_title',
957 'name': 'category_id_more_info_text',
961 'name': 'category_id_visible',
965 'name': 'to_replace_id_id',
969 'name': 'to_replace_id_title',
973 'name': 'to_replace_id_published',
977 'name': 'to_replace_id_body',
981 'name': 'to_replace_id_comments_no',
985 'name': 'to_replace_id_trackbacks_no',
989 'name': 'to_replace_id_extended',
993 'name': 'to_replace_id_has_extended',
997 'name': 'to_replace_id_author_id',
1001 'name': 'to_replace_id_category_id',
1005 'name': 'to_replace_id_is_draft',
1009 'name': 'to_replace_id_updated',
1013 'name': 'to_replace_id_created',
1017 'name': 'to_replace_id_to_replace_id',
1021 'name': 'to_replace_id_page_link',
1025 'name': 'to_replace_id_in_rss',
1029 'name': 'to_replace_id_parent_id',
1033 'name': 'parent_id_id',
1037 'name': 'parent_id_title',
1041 'name': 'parent_id_published',
1045 'name': 'parent_id_body',
1049 'name': 'parent_id_comments_no',
1053 'name': 'parent_id_trackbacks_no',
1057 'name': 'parent_id_extended',
1061 'name': 'parent_id_has_extended',
1065 'name': 'parent_id_author_id',
1069 'name': 'parent_id_category_id',
1073 'name': 'parent_id_is_draft',
1077 'name': 'parent_id_updated',
1081 'name': 'parent_id_created',
1085 'name': 'parent_id_to_replace_id',
1089 'name': 'parent_id_page_link',
1093 'name': 'parent_id_in_rss',
1097 'name': 'parent_id_parent_id',
1103 totalProperty : 'total',
1110 xtype : 'ColumnModel',
1111 dataIndex : 'is_draft',
1112 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1113 renderer : function(v,x,r) {
1115 var state = v> 0 ? '' : '-checked';
1117 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1124 xtype : 'ColumnModel',
1125 dataIndex : 'primary_image_id',
1126 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1127 renderer : function(v,x,r)
1129 var size = _this.image_size_sel.getValue() * 1;
1131 if(v * 1 < 1 || size == 0){
1135 return String.format('<img src="{0}/Images/Thumb/{1}/{2}" width="{1}">', baseURL, size, v);
1143 xtype : 'ColumnModel',
1144 dataIndex : 'created',
1145 header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
1146 renderer : function(v) { return v? v.format('d/M/Y') : '--' },
1152 xtype : 'ColumnModel',
1153 dataIndex : 'published',
1154 header : _this._strings['9b9d8a976b42e0bd66381797644943d5'] /* Published */,
1155 renderer : function(v,x,r) {
1156 if (r.data.is_draft) {
1160 return v? v.format('d/M/Y') : '--'
1167 xtype : 'ColumnModel',
1168 dataIndex : 'page_link',
1169 header : _this._strings['2cbaa804531fc7367ccc699fb1eef52a'] /* Page link / Name / Order */,
1170 renderer : function(v,x,r) {
1172 if (r.data.page_type_id_name == 'page') {
1173 return String.format('{0}', v);
1177 if (r.data.page_type_id_name == 'blog') {
1178 return String.format('{0}', v);
1180 // what about categories.??
1182 // menu, or elements.. ??
1184 var d = r.json.depth || 0;
1186 for (i = 0; i < d; i++) {
1189 if (r.data.page_type_id_name == 'element') {
1190 return String.format('{0}<i>{1}</i>', pr, v);
1193 return String.format('{0}{1}', pr, v);
1202 xtype : 'ColumnModel',
1203 dataIndex : 'title',
1204 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1205 renderer : function(v,x,r) {
1207 var d = r.json.tree_depth || 0;
1209 for (i = 0; i < d; i++) {
1213 var fmt = '<span style="color:blue">{2}{3}</span>' +
1214 (r.data.is_draft ? '<s>{0}</s> <b style="color:#a94442;">{1}</b>' : '{0} <b style="color:#a94442;">{1}</b>');
1216 return String.format( fmt,
1218 (r.data.has_child * 1 > 0) ? '[has child]' : '',
1220 (r.data.page_type_id_name == 'menu' ? '('+r.data.seq_id +')' : ''),
1221 (r.data.category_page_id *1 ? ( '[' + r.data.category_page_id_title +'] ' ): '')
1230 xtype : 'ColumnModel',
1231 dataIndex : 'template_id_template',
1232 header : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1233 renderer : function(v) { return String.format('{0}', v || ''); },
1239 xtype : 'ColumnModel',
1240 dataIndex : 'category_type_id_name',
1241 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1242 renderer : function(v, x, r)
1246 if (r.data.language.length) {
1247 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1250 if(r.data.translation_type.length){
1252 var types = r.data.translation_type.split(',');
1254 Roo.each(types, function(t){
1255 ret.push('>> ' + Pman.I18n.toName('l', t));
1259 return ret.join("<br/>");
1262 if (r.data.language.length) {
1263 return '>> ' + Pman.I18n.toName('l', r.data.language);
1267 /* if (r.data.in_rss) {
1268 return String.format('{0}', v);
1270 if (r.data.is_element) {
1271 return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : '');
1281 xtype : 'ColumnModel',
1282 dataIndex : 'menu_page_id_title',
1283 header : _this._strings['f7070be7ec7d2443714a2e5dc63f4de2'] /* Links to */,
1284 renderer : function(v,x,r) {
1286 if (r.data.is_attachment) {
1287 return "[ATTACHMENT]";
1289 return String.format('{0}', v);
1296 xtype : 'ColumnModel',
1297 dataIndex : 'author_id_name',
1298 header : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1299 renderer : function(v) { return String.format('{0}', v); },
1305 xtype : 'ColumnModel',
1306 dataIndex : 'parent_id_title',
1307 header : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1309 renderer : function(v) { return String.format('{0}', v || ''); },
1315 xtype : 'ColumnModel',
1316 dataIndex : 'to_replace_id_title',
1317 header : _this._strings['75ae2cfdf786e5577f1b619f4ca8d728'] /* To replace */,
1319 renderer : function(v) { return String.format('{0}', v); },
1325 xtype : 'ColumnModel',
1326 dataIndex : 'has_extended',
1327 header : _this._strings['f46885d21c98f597303699f41b3d7afd'] /* Ex? */,
1328 renderer : function(v) { return String.format('{0}', v); },
1334 xtype : 'ColumnModel',
1335 dataIndex : 'trackbacks_no',
1336 header : _this._strings['a4863ff1cdfa709d5bf80939cd2e6757'] /* T# */,
1338 renderer : function(v) { return String.format('{0}', v); },
1344 xtype : 'ColumnModel',
1345 dataIndex : 'comments_no',
1346 header : _this._strings['d7efa19fbe7d3972fd5adb6024223d74'] /* C# */,
1347 renderer : function(v) { return String.format('{0}', v); },
1353 xtype : 'ColumnModel',
1354 dataIndex : 'seq_id',
1355 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1357 renderer : function(v,x,r)
1371 xtype : 'NestedLayoutPanel',
1373 fitContainer : true,
1379 xtype : 'BorderLayout',
1383 xtype : 'LayoutRegion',
1389 xtype : 'LayoutRegion',
1397 xtype : 'GridPanel',
1400 fitContainer : true,
1403 tableName : 'cms_page_category',
1404 title : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1406 activate : function() {
1408 _this.category_panel = this;
1410 if (_this.category_grid) {
1411 _this.category_grid.ds.load({});
1419 autoExpandColumn : 'display_name',
1424 _this.category_grid = this;
1426 if (_this.category_panel.active) {
1432 '|xns' : 'Roo.grid',
1440 text : _this._strings['63a6a88c066880c5ac42394a22803ca6'] /* Refresh */,
1442 click : function (_self, e)
1444 _this.category_grid.ds.load({});
1448 '|xns' : 'Roo.Toolbar'
1455 sortInfo : { field : 'category_id' , direction : 'ASC' },
1457 beforeload : function (_self, o)
1459 o.params = o.params || {};
1461 o.params._category_list = 1;
1465 '|xns' : 'Roo.data',
1467 xtype : 'HttpProxy',
1469 url : baseURL + '/Roo/cms_page_category.php',
1474 xtype : 'JsonReader',
1485 'name': 'display_name',
1499 totalProperty : 'total',
1505 xtype : 'RowSelectionModel',
1506 singleSelect : true,
1508 afterselectionchange : function (_self)
1510 _this.grid.footer.onClick('first');
1518 xtype : 'ColumnModel',
1519 dataIndex : 'display_name',
1520 header : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1521 renderer : function(v,x,r) {
1522 return String.format('{0}', v ? v : '');
1532 xtype : 'ContentPanel',
1533 autoCreate : { tag: 'iframe', src : 'about:blank' },
1534 fitContainer : true,
1537 title : _this._strings['08d0135e24822f43171ed4944fc3bdda'] /* Preview (resize by dragging next to this bar) */,
1539 render : function (_self)
1541 _this.prepanel = _self;
1543 this.el.dom.onload = function(){
1546 !_this.targetData ||
1547 !_this.targetData.data.page_link.length ||
1549 typeof(uiConfig.cms_page_preview_base) == 'undefined'
1554 Roo.get(this.contentDocument.body).on('click', function(){
1555 var url = uiConfig.cms_page_preview_base + _this.targetData.data.page_link;
1568 xtype : 'GridPanel',
1570 fitContainer : true,
1573 tableName : 'cms_page',
1574 title : _this._strings['695e93e1d9db8283a9dd66782625065d'] /* Child Elements */,
1576 activate : function() {
1577 _this.child_element_panel = this;
1578 if (_this.child_element_grid) {
1579 //_this.child_element_grid.footer.onClick('first');
1588 autoExpandColumn : 'title',
1590 trigger_link_click : function(g, rowIndex, columnIndex, e)
1594 var target = e.getTarget();
1596 if(target.nodeName.toLowerCase() != 'a'){
1600 var rec = _this.grid.ds.getAt(rowIndex);
1602 var el = Roo.get(target);
1604 if(!el.hasClass('down') && !el.hasClass('up')){
1608 var s = this.dataSource.getAt(rowIndex);
1610 if(!s || s.data.id * 1 < 1){
1616 url : baseURL + '/Roo/cms_page',
1619 _move : el.hasClass('down') ? 'down' : 'up'
1621 success : function() {
1622 _this.child_element_grid.footer.onClick('refresh');
1630 cellclick : function (g, ri,ci, e)
\r
1632 var h = this.colModel.getDataIndex(ci);
1636 _this.child_element_grid.trigger_link_click(g, ri, ci, e);
1641 if (h != 'is_draft') {
\r
1645 var rec = g.ds.getAt(ri);
1647 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
1653 _this.child_element_grid = this;
1654 if (_this.child_element_panel.active) {
1655 // this.footer.onClick('first');
1658 rowdblclick : function (_self, rowIndex, e)
1660 var s = this.dataSource.getAt(rowIndex);
1662 _this.dialog.show(s.data, function() {
1663 _this.child_element_grid.footer.onClick('refresh');
1669 '|xns' : 'Roo.grid',
1671 xtype : 'PagingToolbar',
1673 displayMsg : _this._strings['040dcb21af4618f18d04e667c07ef314'] /* {0} - {1} of {2} */,
1674 emptyMsg : _this._strings['a9581db07856efb481fddef1b3e168f8'] /* No page found */,
1681 enableToggle : true,
1682 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
1684 click : function (_self, e)
1686 _this.child_element_grid.footer.onClick.defer(100, _this.child_element_grid.footer, ['first'] );
1687 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
1689 render : function (_self)
1691 _this.child_show_deleted = this;
1695 '|xns' : 'Roo.Toolbar'
1706 cls : 'x-btn-text-icon',
1707 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1708 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1712 var s = _this.grid.selModel.getSelected();
1714 if(!s || s.data.id * 1 < 1 || s.data.template_id * 1 < 1){
1715 Roo.MessageBox.alert('Error', 'Please select a page');
1719 Pman.Dialog.AddChildElementToPage.show({
1720 template_id : s.data.template_id
1731 '|xns' : 'Roo.Toolbar'
1736 '|xns' : 'Roo.Toolbar'
1740 cls : 'x-btn-text-icon',
1741 icon : rootURL + '/Pman/templates/images/trash.gif',
1742 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1746 var sel = _this.child_element_grid.selModel.getSelected();
1748 if(!sel || sel.data.id * 1< 1){
1749 Roo.MessageBox.alert("Error", "Select page to delete");
1755 url : baseURL + '/Roo/cms_page',
1760 success : function() {
1761 _this.child_element_grid.footer.onClick('refresh');
1767 '|xns' : 'Roo.Toolbar'
1774 sortInfo : { field : 'created' , direction : 'DESC' },
1776 beforeload : function (_self, options)
1778 options.params = options.params || {};
1780 var sel = _this.grid.selModel.getSelected();
1784 sel.data.id * 1< 1 ||
1785 sel.data.page_type_id_name != 'page' ||
1786 sel.data.template_id * 1 < 1
1790 _this.child_element_panel.region.collapse();
1795 _this.child_element_panel.region.expand();
1797 options.params._list_elements = sel.data.id;
1799 if (_this.child_show_deleted.pressed) {
1800 options.params._show_deleted = 1;
1804 update : function (_self, record, operation)
1806 if (operation != 'commit') {
1809 // only used to change active status.
1811 new Pman.request({
\r
1813 url : baseURL + '/Roo/Cms_page',
\r
1815 id : record.data.id,
\r
1816 is_draft : record.data.is_draft
\r
1818 success : function(res) {
1819 _this.child_element_grid.footer.onClick('refresh');
1825 '|xns' : 'Roo.data',
1827 xtype : 'HttpProxy',
1829 url : baseURL + '/Roo/cms_page.php',
1834 xtype : 'JsonReader',
1845 'name': 'element_id_name',
1857 'name': 'is_deleted',
1865 'name': 'translation_type',
1871 totalProperty : 'total',
1877 xtype : 'RowSelectionModel',
1878 singleSelect : true,
1884 xtype : 'ColumnModel',
1885 dataIndex : 'is_draft',
1886 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1887 renderer : function(v,x,r) {
1889 var state = v> 0 ? '' : '-checked';
1891 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1898 xtype : 'ColumnModel',
1899 dataIndex : 'element_id_name',
1900 header : _this._strings['ce5bf551379459c1c61d2a204061c455'] /* Location */,
1901 renderer : function(v,x,r) {
1903 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1905 return String.format( fmt, v);
1912 xtype : 'ColumnModel',
1913 dataIndex : 'title',
1914 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1915 renderer : function(v,x,r) {
1917 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1919 return String.format( fmt, v);
1926 xtype : 'ColumnModel',
1927 dataIndex : 'language',
1928 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1929 renderer : function(v, x, r)
1933 if (r.data.language.length) {
1934 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1937 if(r.data.translation_type.length){
1939 var types = r.data.translation_type.split(',');
1941 Roo.each(types, function(t){
1942 ret.push('>> ' + Pman.I18n.toName('l', t));
1946 return ret.join("<br/>");
1954 xtype : 'ColumnModel',
1955 dataIndex : 'seq_id',
1956 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1957 renderer : function(v,x,r)
1960 var fmt = String.format(
1961 '<a href="#" class="down" style="font-weight: bold; font-size: 20px; text-decoration: none;" tooltip="Down">↑</a>' +
1962 '<a href="#" class="up" style="font-weight: bold; font-size: 20px; text-decoration: none; margin-left: 15px;" tooltip="Up">↓</a>'
1973 xtype : 'ColumnModel',
1974 dataIndex : 'seq_id',
1975 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1977 renderer : function(v,x,r)