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',
114 cellclick : function (g, ri,ci, e)
\r
116 var h = this.colModel.getDataIndex(ci);
118 if (h != 'is_draft') {
\r
121 var rec = g.ds.getAt(ri);
123 if(rec.data.is_system_page * 1 == 1){
124 Roo.MessageBox.alert('Error', 'You cannot de-active the system page');
127 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
133 _this.dialog = Pman.Dialog.CmsBlog;
134 if (_this.panel.active) {
135 this.footer.onClick('first');
138 rowclick : function (_self, rowIndex, e)
140 var s = this.dataSource.getAt(rowIndex);
142 _this.prepanel.el.dom.innerHTML = '';
144 if(s.data.id * 1 < 1){
147 if (s.data.is_deleted) {
148 _this.deleteBtn.setText("Un-delete");
150 _this.deleteBtn.setText("Delete");
154 _this.prepanel.el.dom.src = baseURL + '/Cms/PageThumb/' + s.data.id;
156 _this.targetData = s;
158 _this.child_element_grid.footer.onClick('first');
161 rowdblclick : function (_self, rowIndex, e)
163 var s = this.dataSource.getAt(rowIndex);
165 if (s.data.language.length) {
167 _this.dialog.show({ id : s.data.parent_id } , function() {
168 _this.grid.footer.onClick('refresh');
172 _this.dialog.show(s.data, function() {
173 _this.grid.footer.onClick('refresh');
181 xtype : 'PagingToolbar',
183 displayMsg : _this._strings['30a2a59b5adaa49803297d4c06e09e67'] /* Displaying cms_page{0} - {1} of {2} */,
184 emptyMsg : _this._strings['f17755c3f16cb257f7793b9865ebafb3'] /* No cms_page found */,
192 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
194 click : function (_self, e)
196 _this.grid.footer.onClick.defer(100, _this.grid.footer, ['first'] );
197 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
199 render : function (_self)
201 _this.showDeleted = this;
205 '|xns' : 'Roo.Toolbar'
210 '|xns' : 'Roo.Toolbar'
214 text : _this._strings['0ecfa7150815d4ddb07470e3862c92c4'] /* Export CMS (ZIP) */,
216 click : function (_self, e)
219 url: baseURL + '/Roo/Cms_page',
226 Roo.MessageBox.alert("Downloading", "The file is downloading");
230 '|xns' : 'Roo.Toolbar'
235 '|xns' : 'Roo.Toolbar'
240 displayField : 'value',
243 triggerAction : 'all',
248 render : function (_self)
250 _this.image_size_sel = _self;
252 select : function (combo, record, index)
254 _this.grid.footer.onClick('first');
260 xtype : 'SimpleStore',
266 fields : [ 'key', 'value'],
281 render : function (_self)
283 _this.searchBox= _self;
285 specialkey : function (_self, e)
287 _this.grid.footer.onClick('first');
296 icon : rootURL + '/Pman/templates/images/search.gif',
298 click : function (_self, e)
300 _this.grid.footer.onClick('first');
304 '|xns' : 'Roo.Toolbar'
309 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
311 click : function (_self, e)
313 _this.searchBox.setValue('');
315 _this.grid.footer.onClick('first');
319 '|xns' : 'Roo.Toolbar'
324 '|xns' : 'Roo.Toolbar'
328 cls : 'x-btn-text-icon',
329 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
330 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
337 if(_this.grid.selModel.getSelections().length == 1){
338 ds = _this.grid.selModel.getSelected().data;
341 var page_type_id = 0;
342 var page_type_id_name = '';
343 var page_type_id_display_name = '';
345 var sel = _this.category_grid.getSelectionModel().getSelected();
347 if(!ds && sel && sel.data.pid * 1 > 0 && sel.data.type == 'page_type'){
348 page_type_id = sel.data.pid;
349 page_type_id_name = sel.data.name;
350 page_type_id_display_name = sel.data.display_name;
352 if(sel.data.name == 'page'){
353 page_type_id_display_name = 'Pages';
356 if(sel.data.name == 'blog'){
357 page_type_id_display_name = 'Blog Entries';
363 var s = _this.page_type.selectedData;
367 page_type_id_name = s.name;
368 page_type_id_display_name = s.display_name;
370 if(s.name == 'page'){
371 page_type_id_display_name = 'Pages';
378 parent_id : ds ? ds.id : '',
379 parent_id_title : ds ? ds.title : '',
380 page_link : ds && !ds.is_element ? (ds.page_link + '/') : '',
381 page_type_id : ds ? ds.page_type_id : page_type_id,
382 page_type_id_name : ds ? ds.page_type_id_name : page_type_id_name,
383 page_type_id_display_name : ds ? ds.page_type_id_display_name : page_type_id_display_name
386 _this.dialog.show( q, function() {
387 _this.grid.footer.onClick('first');
392 '|xns' : 'Roo.Toolbar'
397 '|xns' : 'Roo.Toolbar'
401 cls : 'x-btn-text-icon',
402 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
403 text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
407 var s = _this.grid.selModel.getSelections();
409 if(_this.grid.selModel.getSelections().length != 1){
410 Roo.MessageBox.alert('Error', 'Please select one row to copy');
414 var sel = _this.grid.selModel.getSelected();
416 if(!sel || sel.data.id * 1 < 1){
417 Roo.MessageBox.alert('Error', 'Please select one row to copy');
421 var editIt = function() {
423 url : baseURL + '/Roo/cms_page.php',
428 success : function(res) {
430 var params = Roo.apply({}, res.data);
435 if(params.page_link.length){
436 params.page_link = params.page_link + '-copy';
439 if(params.title.length){
440 params.title = 'Copy of ' + params.title;
443 _this.dialog.show( params, function() {
444 _this.grid.footer.onClick('first');
450 var copyIt = function() {
453 url : baseURL + '/Roo/cms_page.php',
456 _copy_of : sel.data.id
458 success : function(res) {
462 _this.dialog.show( { id : res.data }, function() {
463 _this.grid.footer.onClick('first');
471 Roo.MessageBox.confirm(
473 "Are you wish to copy the child elements as well?",
490 '|xns' : 'Roo.Toolbar'
495 '|xns' : 'Roo.Toolbar'
499 cls : 'x-btn-text-icon',
500 icon : rootURL + '/Pman/templates/images/trash.gif',
501 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
506 if(_this.grid.selModel.getSelections().length != 1){
507 Roo.MessageBox.alert("Error", "Select page to delete");
510 var sel = _this.grid.selModel.getSelected();
511 if(sel.data.is_system_page){
512 Roo.MessageBox.alert("Error", "System pages can not be deleted.");
516 if (!sel.data.is_deleted) {
517 Roo.MessageBox.confirm("Confirm",
518 "Are you sure you want to delete this, - to un-delete, select 'Show Deleted' at bottom, select this item and press this button again",
526 url : baseURL + '/Roo/cms_page',
531 success : function() {
532 _this.grid.footer.onClick('refresh');
545 url : baseURL + '/Roo/cms_page',
551 success : function() {
552 _this.grid.footer.onClick('refresh');
557 render : function (_self)
559 _this.deleteBtn = this;
563 '|xns' : 'Roo.Toolbar'
570 sortInfo : { field : 'created' , direction : 'DESC' },
572 beforeload : function (_self, options)
574 if (Pman.building || !Pman.Tab.Cms.panel.active) {
578 var sel = _this.category_grid.getSelectionModel().getSelected();
580 if(!sel || sel.data.pid * 1 < 1){
585 options.params._with_primary_image = 1;
587 var cm = _this.grid.colModel;
589 category_type_id_name : true,
590 menu_page_id_title : true
593 var cm = _this.grid.getColumnModel();
596 return cm.getIndexByDataIndex(str);
599 options.params['search[name]'] = _this.searchBox.getValue();
601 options.params._exclude_columns = 'body,extended';
603 if(sel.data.type == 'page_type'){
604 options.params._page_type_id = sel.data.pid;
607 if(sel.data.type == 'category'){
608 options.params._category_id = sel.data.pid;
611 var size = _this.image_size_sel.getValue() * 1;
613 cm.setHidden(cid('primary_image_id'), false);
614 cm.setColumnWidth(cid('primary_image_id'), size + 10);
617 cm.setHidden(cid('primary_image_id'), true);
620 // options.params._treeview = 1;
621 options.params._pman_short = 1;
623 options.params.translation_of_id = 0;
625 options.params._with_translation_type = 1;
627 //options.params._requestMeta = 1; // always fetch meta.. as different types return different data..
630 switch(sel.data.name) {
632 // options.params.limit = 9999;
633 // _this.grid.footer.pageSize = 9999;
634 vis.menu_page_id_title = false;
635 cm.setHidden(cid('created'), true);
636 cm.setHidden(cid('published'), true);
637 cm.setHidden(cid('template_id_template'), false);
638 this.sortInfo.field = 'tree_sequence'; // force sort.
639 this.sortInfo.direction = 'ASC'; // force sort.
643 // options.params.limit = 20;
644 // options.params['search[category]'] = _this.category_type.getValue();
645 // _this.grid.footer.pageSize = 20;
646 vis.menu_page_id_title = false;
647 cm.setHidden(cid('created'), false);
648 cm.setHidden(cid('published'), false);
649 cm.setHidden(cid('template_id_template'), true);
650 this.sortInfo.field = 'published'; // force sort.
651 this.sortInfo.direction = 'DESC'; // force sort.
656 // options.params.limit = 9999;
657 // _this.grid.footer.pageSize = 9999;
658 vis.category_type_id_name = false;
659 cm.setHidden(cid('created'), true);
660 cm.setHidden(cid('published'), true);
661 cm.setHidden(cid('template_id_template'), true);
662 this.sortInfo.field = 'tree_sequence'; // force sort.
663 this.sortInfo.direction = 'ASC'; // force sort.
667 // options.params.limit = 20;
668 // _this.grid.footer.pageSize = 20;
669 vis.menu_page_id_title = false;
670 cm.setHidden(cid('created'), false);
671 cm.setHidden(cid('published'), false);
672 cm.setHidden(cid('template_id_template'), true);
673 this.sortInfo.field = 'tree_sequence'; // force sort.
674 this.sortInfo.direction = 'ASC'; // force sort.
679 if (_this.showDeleted.pressed) {
680 options.params._show_deleted = 1;
684 cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);
688 load : function (_self, records, options)
690 _this.child_element_panel.region.collapse();
692 update : function (_self, record, operation)
694 if (operation != 'commit') {
697 // only used to change active status.
701 url : baseURL + '/Roo/Cms_page',
\r
703 id : record.data.id,
\r
704 is_draft : record.data.is_draft
\r
706 success : function(res) {
707 _this.grid.footer.onClick('refresh');
717 url : baseURL + '/Roo/cms_page.php',
722 xtype : 'JsonReader',
735 'format' : 'Y-m-d H:i:s'
742 'name': 'comments_no',
746 'name': 'trackbacks_no',
754 'name': 'has_extended',
762 'name': 'category_id',
766 'name': 'category_id_title',
776 'format' : 'Y-m-d H:i:s'
781 'format' : 'Y-m-d H:i:s'
784 'name': 'to_replace_id',
800 'name': 'parent_id_title',
805 'name': 'author_id_id',
809 'name': 'author_id_office_id',
813 'name': 'author_id_name',
817 'name': 'author_id_phone',
821 'name': 'author_id_fax',
825 'name': 'author_id_email',
829 'name': 'author_id_company_id',
833 'name': 'author_id_role',
837 'name': 'author_id_active',
841 'name': 'author_id_remarks',
845 'name': 'author_id_passwd',
849 'name': 'author_id_owner_id',
853 'name': 'author_id_lang',
857 'name': 'author_id_no_reset_sent',
861 'name': 'author_id_action_type',
865 'name': 'author_id_project_id',
869 'name': 'category_id_id',
873 'name': 'category_id_parent_id',
877 'name': 'category_id_short_name',
881 'name': 'category_id_title',
885 'name': 'category_id_page_text',
889 'name': 'category_id_type',
893 'name': 'category_id_search_on',
897 'name': 'category_id_image_menu_id',
901 'name': 'category_id_image_menuover_id',
905 'name': 'category_id_image_leftactive_id',
909 'name': 'category_id_image_page_id',
913 'name': 'category_id_display_order',
917 'name': 'category_id_more_info_title',
921 'name': 'category_id_more_info_text',
925 'name': 'category_id_visible',
929 'name': 'to_replace_id_id',
933 'name': 'to_replace_id_title',
937 'name': 'to_replace_id_published',
941 'name': 'to_replace_id_body',
945 'name': 'to_replace_id_comments_no',
949 'name': 'to_replace_id_trackbacks_no',
953 'name': 'to_replace_id_extended',
957 'name': 'to_replace_id_has_extended',
961 'name': 'to_replace_id_author_id',
965 'name': 'to_replace_id_category_id',
969 'name': 'to_replace_id_is_draft',
973 'name': 'to_replace_id_updated',
977 'name': 'to_replace_id_created',
981 'name': 'to_replace_id_to_replace_id',
985 'name': 'to_replace_id_page_link',
989 'name': 'to_replace_id_in_rss',
993 'name': 'to_replace_id_parent_id',
997 'name': 'parent_id_id',
1001 'name': 'parent_id_title',
1005 'name': 'parent_id_published',
1009 'name': 'parent_id_body',
1013 'name': 'parent_id_comments_no',
1017 'name': 'parent_id_trackbacks_no',
1021 'name': 'parent_id_extended',
1025 'name': 'parent_id_has_extended',
1029 'name': 'parent_id_author_id',
1033 'name': 'parent_id_category_id',
1037 'name': 'parent_id_is_draft',
1041 'name': 'parent_id_updated',
1045 'name': 'parent_id_created',
1049 'name': 'parent_id_to_replace_id',
1053 'name': 'parent_id_page_link',
1057 'name': 'parent_id_in_rss',
1061 'name': 'parent_id_parent_id',
1067 totalProperty : 'total',
1074 xtype : 'ColumnModel',
1075 dataIndex : 'is_draft',
1076 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1077 renderer : function(v,x,r) {
1079 if (r.data.is_deleted) {
1083 var state = v> 0 ? '' : '-checked';
1085 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1092 xtype : 'ColumnModel',
1093 dataIndex : 'primary_image_id',
1094 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1095 renderer : function(v,x,r)
1097 var size = _this.image_size_sel.getValue() * 1;
1099 if(v * 1 < 1 || size == 0){
1103 return String.format('<img src="{0}/Images/Thumb/{1}/{2}" width="{1}">', baseURL, size, v);
1111 xtype : 'ColumnModel',
1112 dataIndex : 'created',
1113 header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
1114 renderer : function(v) { return v? v.format('d/M/Y') : '--' },
1120 xtype : 'ColumnModel',
1121 dataIndex : 'published',
1122 header : _this._strings['9b9d8a976b42e0bd66381797644943d5'] /* Published */,
1123 renderer : function(v,x,r) {
1124 if (r.data.is_draft) {
1128 return v? v.format('d/M/Y') : '--'
1135 xtype : 'ColumnModel',
1136 dataIndex : 'page_link',
1137 header : _this._strings['2cbaa804531fc7367ccc699fb1eef52a'] /* Page link / Name / Order */,
1138 renderer : function(v,x,r) {
1140 if (r.data.page_type_id_name == 'page') {
1141 return String.format('{0}', v);
1145 if (r.data.page_type_id_name == 'blog') {
1146 return String.format('{0}', v);
1148 // what about categories.??
1150 // menu, or elements.. ??
1152 var d = r.json.depth || 0;
1154 for (i = 0; i < d; i++) {
1157 if (r.data.page_type_id_name == 'element') {
1158 return String.format('{0}<i>{1}</i>', pr, v);
1161 return String.format('{0}{1}', pr, v);
1170 xtype : 'ColumnModel',
1171 dataIndex : 'title',
1172 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1173 renderer : function(v,x,r) {
1175 var d = r.json.tree_depth || 0;
1177 for (i = 0; i < d; i++) {
1181 var fmt = '<span style="color:blue">{2}{3}</span>' +
1182 (r.data.is_draft ? '<s>{0}</s> <b style="color:#a94442;">{1}</b>' : '{0} <b style="color:#a94442;">{1}</b>');
1184 return String.format( fmt,
1186 (r.data.has_child * 1 > 0) ? '[has child]' : '',
1188 (r.data.page_type_id_name == 'menu' ? '('+r.data.seq_id +')' : ''),
1189 (r.data.category_page_id *1 ? ( '[' + r.data.category_page_id_title +'] ' ): '')
1198 xtype : 'ColumnModel',
1199 dataIndex : 'template_id_template',
1200 header : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1201 renderer : function(v) { return String.format('{0}', v || ''); },
1207 xtype : 'ColumnModel',
1208 dataIndex : 'category_type_id_name',
1209 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1210 renderer : function(v, x, r)
1214 if (r.data.language.length) {
1215 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1218 if(r.data.translation_type.length){
1220 var types = r.data.translation_type.split(',');
1222 Roo.each(types, function(t){
1223 ret.push('>> ' + Pman.I18n.toName('l', t));
1227 return ret.join("<br/>");
1230 if (r.data.language.length) {
1231 return '>> ' + Pman.I18n.toName('l', r.data.language);
1235 /* if (r.data.in_rss) {
1236 return String.format('{0}', v);
1238 if (r.data.is_element) {
1239 return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : '');
1249 xtype : 'ColumnModel',
1250 dataIndex : 'menu_page_id_title',
1251 header : _this._strings['f7070be7ec7d2443714a2e5dc63f4de2'] /* Links to */,
1252 renderer : function(v,x,r) {
1254 if (r.data.is_attachment) {
1255 return "[ATTACHMENT]";
1257 return String.format('{0}', v);
1264 xtype : 'ColumnModel',
1265 dataIndex : 'author_id_name',
1266 header : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1267 renderer : function(v) { return String.format('{0}', v); },
1273 xtype : 'ColumnModel',
1274 dataIndex : 'parent_id_title',
1275 header : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1277 renderer : function(v) { return String.format('{0}', v || ''); },
1283 xtype : 'ColumnModel',
1284 dataIndex : 'to_replace_id_title',
1285 header : _this._strings['75ae2cfdf786e5577f1b619f4ca8d728'] /* To replace */,
1287 renderer : function(v) { return String.format('{0}', v); },
1293 xtype : 'ColumnModel',
1294 dataIndex : 'has_extended',
1295 header : _this._strings['f46885d21c98f597303699f41b3d7afd'] /* Ex? */,
1296 renderer : function(v) { return String.format('{0}', v); },
1302 xtype : 'ColumnModel',
1303 dataIndex : 'trackbacks_no',
1304 header : _this._strings['a4863ff1cdfa709d5bf80939cd2e6757'] /* T# */,
1306 renderer : function(v) { return String.format('{0}', v); },
1312 xtype : 'ColumnModel',
1313 dataIndex : 'comments_no',
1314 header : _this._strings['d7efa19fbe7d3972fd5adb6024223d74'] /* C# */,
1315 renderer : function(v) { return String.format('{0}', v); },
1321 xtype : 'ColumnModel',
1322 dataIndex : 'seq_id',
1323 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1325 renderer : function(v,x,r)
1339 xtype : 'NestedLayoutPanel',
1341 fitContainer : true,
1347 xtype : 'BorderLayout',
1351 xtype : 'LayoutRegion',
1357 xtype : 'LayoutRegion',
1365 xtype : 'GridPanel',
1368 fitContainer : true,
1371 tableName : 'cms_page_category',
1372 title : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1374 activate : function() {
1376 _this.category_panel = this;
1378 if (_this.category_grid) {
1379 _this.category_grid.ds.load({});
1387 autoExpandColumn : 'display_name',
1392 _this.category_grid = this;
1394 if (_this.category_panel.active) {
1400 '|xns' : 'Roo.grid',
1408 text : _this._strings['63a6a88c066880c5ac42394a22803ca6'] /* Refresh */,
1410 click : function (_self, e)
1412 _this.category_grid.ds.load({});
1416 '|xns' : 'Roo.Toolbar'
1423 sortInfo : { field : 'category_id' , direction : 'ASC' },
1425 beforeload : function (_self, o)
1427 o.params = o.params || {};
1429 o.params._category_list = 1;
1433 '|xns' : 'Roo.data',
1435 xtype : 'HttpProxy',
1437 url : baseURL + '/Roo/cms_page_category.php',
1442 xtype : 'JsonReader',
1453 'name': 'display_name',
1467 totalProperty : 'total',
1473 xtype : 'RowSelectionModel',
1474 singleSelect : true,
1476 afterselectionchange : function (_self)
1478 _this.grid.footer.onClick('first');
1486 xtype : 'ColumnModel',
1487 dataIndex : 'display_name',
1488 header : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1489 renderer : function(v,x,r) {
1490 return String.format('{0}', v ? v : '');
1500 xtype : 'ContentPanel',
1501 autoCreate : { tag: 'iframe', src : 'about:blank' },
1502 fitContainer : true,
1505 title : _this._strings['08d0135e24822f43171ed4944fc3bdda'] /* Preview (resize by dragging next to this bar) */,
1507 render : function (_self)
1509 _this.prepanel = _self;
1511 this.el.dom.onload = function(){
1514 !_this.targetData ||
1515 !_this.targetData.data.page_link.length ||
1517 typeof(uiConfig.cms_page_preview_base) == 'undefined'
1522 Roo.get(this.contentDocument.body).on('click', function(){
1523 var url = uiConfig.cms_page_preview_base + _this.targetData.data.page_link;
1536 xtype : 'GridPanel',
1538 fitContainer : true,
1541 tableName : 'cms_page',
1542 title : _this._strings['695e93e1d9db8283a9dd66782625065d'] /* Child Elements */,
1544 activate : function() {
1545 _this.child_element_panel = this;
1546 if (_this.child_element_grid) {
1547 //_this.child_element_grid.footer.onClick('first');
1556 autoExpandColumn : 'title',
1558 trigger_link_click : function(g, rowIndex, columnIndex, e)
1562 var target = e.getTarget();
1564 if(target.nodeName.toLowerCase() != 'a'){
1568 var rec = _this.grid.ds.getAt(rowIndex);
1570 var el = Roo.get(target);
1572 if(!el.hasClass('down') && !el.hasClass('up')){
1576 var s = this.dataSource.getAt(rowIndex);
1578 if(!s || s.data.id * 1 < 1){
1584 url : baseURL + '/Roo/cms_page',
1587 _move : el.hasClass('down') ? 'down' : 'up'
1589 success : function() {
1590 _this.child_element_grid.footer.onClick('refresh');
1598 cellclick : function (g, ri,ci, e)
\r
1600 var h = this.colModel.getDataIndex(ci);
1604 _this.child_element_grid.trigger_link_click(g, ri, ci, e);
1609 if (h != 'is_draft') {
\r
1613 var rec = g.ds.getAt(ri);
1615 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
1621 _this.child_element_grid = this;
1622 if (_this.child_element_panel.active) {
1623 // this.footer.onClick('first');
1626 rowdblclick : function (_self, rowIndex, e)
1628 var s = this.dataSource.getAt(rowIndex);
1630 _this.dialog.show(s.data, function() {
1631 _this.child_element_grid.footer.onClick('refresh');
1637 '|xns' : 'Roo.grid',
1639 xtype : 'PagingToolbar',
1641 displayMsg : _this._strings['040dcb21af4618f18d04e667c07ef314'] /* {0} - {1} of {2} */,
1642 emptyMsg : _this._strings['a9581db07856efb481fddef1b3e168f8'] /* No page found */,
1649 enableToggle : true,
1650 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
1652 click : function (_self, e)
1654 _this.child_element_grid.footer.onClick.defer(100, _this.child_element_grid.footer, ['first'] );
1655 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
1657 render : function (_self)
1659 _this.child_show_deleted = this;
1663 '|xns' : 'Roo.Toolbar'
1674 cls : 'x-btn-text-icon',
1675 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1676 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1680 var s = _this.grid.selModel.getSelected();
1682 if(!s || s.data.id * 1 < 1 || s.data.template_id * 1 < 1){
1683 Roo.MessageBox.alert('Error', 'Please select a page');
1687 Pman.Dialog.AddChildElementToPage.show({
1688 template_id : s.data.template_id
1693 element_id : res.element_id,
1694 element_id_name : res.element_id_name,
1695 page_type_id : s.data.element_page_type_id,
1696 page_type_id_name : 'element',
1697 page_type_id_display_name : 'Elements',
1698 parent_id : s.data.id,
1699 parent_id_title : s.data.title
1702 _this.dialog.show( params, function() {
1703 _this.grid.footer.onClick('first');
1712 '|xns' : 'Roo.Toolbar'
1717 '|xns' : 'Roo.Toolbar'
1721 cls : 'x-btn-text-icon',
1722 icon : rootURL + '/Pman/templates/images/trash.gif',
1723 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1727 var sel = _this.child_element_grid.selModel.getSelected();
1729 if(!sel || sel.data.id * 1< 1){
1730 Roo.MessageBox.alert("Error", "Select page to delete");
1736 url : baseURL + '/Roo/cms_page',
1741 success : function() {
1742 _this.child_element_grid.footer.onClick('refresh');
1748 '|xns' : 'Roo.Toolbar'
1755 sortInfo : { field : 'created' , direction : 'DESC' },
1757 beforeload : function (_self, options)
1759 options.params = options.params || {};
1761 var sel = _this.grid.selModel.getSelected();
1765 sel.data.id * 1< 1 ||
1766 sel.data.page_type_id_name != 'page' ||
1767 sel.data.template_id * 1 < 1 ||
1768 sel.data.has_child_element_type * 1 < 1
1772 _this.child_element_panel.region.collapse();
1777 _this.child_element_panel.region.expand();
1779 options.params._list_elements = sel.data.id;
1781 if (_this.child_show_deleted.pressed) {
1782 options.params._show_deleted = 1;
1786 update : function (_self, record, operation)
1788 if (operation != 'commit') {
1791 // only used to change active status.
1793 new Pman.request({
\r
1795 url : baseURL + '/Roo/Cms_page',
\r
1797 id : record.data.id,
\r
1798 is_draft : record.data.is_draft
\r
1800 success : function(res) {
1801 _this.child_element_grid.footer.onClick('refresh');
1807 '|xns' : 'Roo.data',
1809 xtype : 'HttpProxy',
1811 url : baseURL + '/Roo/cms_page.php',
1816 xtype : 'JsonReader',
1827 'name': 'element_id_name',
1839 'name': 'is_deleted',
1847 'name': 'translation_type',
1851 'name': 'primary_image_id',
1857 totalProperty : 'total',
1863 xtype : 'RowSelectionModel',
1864 singleSelect : true,
1870 xtype : 'ColumnModel',
1871 dataIndex : 'primary_image_id',
1872 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1873 renderer : function(v,x,r)
1879 return String.format('<img src="{0}/Images/Thumb/40/{1}" width="40">', baseURL, v);
1886 xtype : 'ColumnModel',
1887 dataIndex : 'is_draft',
1888 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1889 renderer : function(v,x,r) {
1891 var state = v> 0 ? '' : '-checked';
1893 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1900 xtype : 'ColumnModel',
1901 dataIndex : 'element_id_name',
1902 header : _this._strings['ce5bf551379459c1c61d2a204061c455'] /* Location */,
1903 renderer : function(v,x,r) {
1905 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1907 return String.format( fmt, v);
1914 xtype : 'ColumnModel',
1915 dataIndex : 'title',
1916 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1917 renderer : function(v,x,r) {
1919 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1921 return String.format( fmt, v);
1928 xtype : 'ColumnModel',
1929 dataIndex : 'language',
1930 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1931 renderer : function(v, x, r)
1935 if (r.data.language.length) {
1936 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1939 if(r.data.translation_type.length){
1941 var types = r.data.translation_type.split(',');
1943 Roo.each(types, function(t){
1944 ret.push('>> ' + Pman.I18n.toName('l', t));
1948 return ret.join("<br/>");
1956 xtype : 'ColumnModel',
1957 dataIndex : 'seq_id',
1958 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1959 renderer : function(v,x,r)
1962 var fmt = String.format(
1963 '<a href="#" class="down" style="font-weight: bold; font-size: 20px; text-decoration: none;" tooltip="Down">↑</a>' +
1964 '<a href="#" class="up" style="font-weight: bold; font-size: 20px; text-decoration: none; margin-left: 15px;" tooltip="Up">↓</a>'
1975 xtype : 'ColumnModel',
1976 dataIndex : 'seq_id',
1977 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1979 renderer : function(v,x,r)