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.");
517 Roo.MessageBox.confirm("Confirm",
518 "Are you sure you want to delete this, it can not be recovered if you make a mistake!",
525 url : baseURL + '/Roo/cms_page',
527 _delete : sel.data.id
529 success : function() {
530 _this.grid.footer.onClick('refresh');
542 url : baseURL + '/Roo/cms_page',
547 success : function() {
548 _this.grid.footer.onClick('refresh');
555 '|xns' : 'Roo.Toolbar'
562 sortInfo : { field : 'created' , direction : 'DESC' },
564 beforeload : function (_self, options)
566 if (Pman.building || !Pman.Tab.Cms.panel.active) {
570 var sel = _this.category_grid.getSelectionModel().getSelected();
572 if(!sel || sel.data.pid * 1 < 1){
577 options.params._with_primary_image = 1;
579 var cm = _this.grid.colModel;
581 category_type_id_name : true,
582 menu_page_id_title : true
585 var cm = _this.grid.getColumnModel();
588 return cm.getIndexByDataIndex(str);
591 options.params['search[name]'] = _this.searchBox.getValue();
593 options.params._exclude_columns = 'body,extended';
595 if(sel.data.type == 'page_type'){
596 options.params._page_type_id = sel.data.pid;
599 if(sel.data.type == 'category'){
600 options.params._category_id = sel.data.pid;
603 var size = _this.image_size_sel.getValue() * 1;
605 cm.setHidden(cid('primary_image_id'), false);
606 cm.setColumnWidth(cid('primary_image_id'), size + 10);
609 cm.setHidden(cid('primary_image_id'), true);
612 // options.params._treeview = 1;
613 options.params._pman_short = 1;
615 options.params.translation_of_id = 0;
617 options.params._with_translation_type = 1;
619 //options.params._requestMeta = 1; // always fetch meta.. as different types return different data..
622 switch(sel.data.name) {
624 // options.params.limit = 9999;
625 // _this.grid.footer.pageSize = 9999;
626 vis.menu_page_id_title = false;
627 cm.setHidden(cid('created'), true);
628 cm.setHidden(cid('published'), true);
629 cm.setHidden(cid('template_id_template'), false);
630 this.sortInfo.field = 'tree_sequence'; // force sort.
631 this.sortInfo.direction = 'ASC'; // force sort.
635 // options.params.limit = 20;
636 // options.params['search[category]'] = _this.category_type.getValue();
637 // _this.grid.footer.pageSize = 20;
638 vis.menu_page_id_title = false;
639 cm.setHidden(cid('created'), false);
640 cm.setHidden(cid('published'), false);
641 cm.setHidden(cid('template_id_template'), true);
642 this.sortInfo.field = 'published'; // force sort.
643 this.sortInfo.direction = 'DESC'; // force sort.
648 // options.params.limit = 9999;
649 // _this.grid.footer.pageSize = 9999;
650 vis.category_type_id_name = false;
651 cm.setHidden(cid('created'), true);
652 cm.setHidden(cid('published'), true);
653 cm.setHidden(cid('template_id_template'), true);
654 this.sortInfo.field = 'tree_sequence'; // force sort.
655 this.sortInfo.direction = 'ASC'; // force sort.
659 // options.params.limit = 20;
660 // _this.grid.footer.pageSize = 20;
661 vis.menu_page_id_title = false;
662 cm.setHidden(cid('created'), false);
663 cm.setHidden(cid('published'), false);
664 cm.setHidden(cid('template_id_template'), true);
665 this.sortInfo.field = 'tree_sequence'; // force sort.
666 this.sortInfo.direction = 'ASC'; // force sort.
671 if (_this.showDeleted.pressed) {
672 options.params._show_deleted = 1;
676 cm.setHidden(cm.getIndexByDataIndex(i), !vis[i]);
680 load : function (_self, records, options)
682 _this.child_element_panel.region.collapse();
684 update : function (_self, record, operation)
686 if (operation != 'commit') {
689 // only used to change active status.
693 url : baseURL + '/Roo/Cms_page',
\r
695 id : record.data.id,
\r
696 is_draft : record.data.is_draft
\r
698 success : function(res) {
699 _this.grid.footer.onClick('refresh');
709 url : baseURL + '/Roo/cms_page.php',
714 xtype : 'JsonReader',
727 'format' : 'Y-m-d H:i:s'
734 'name': 'comments_no',
738 'name': 'trackbacks_no',
746 'name': 'has_extended',
754 'name': 'category_id',
758 'name': 'category_id_title',
768 'format' : 'Y-m-d H:i:s'
773 'format' : 'Y-m-d H:i:s'
776 'name': 'to_replace_id',
792 'name': 'parent_id_title',
797 'name': 'author_id_id',
801 'name': 'author_id_office_id',
805 'name': 'author_id_name',
809 'name': 'author_id_phone',
813 'name': 'author_id_fax',
817 'name': 'author_id_email',
821 'name': 'author_id_company_id',
825 'name': 'author_id_role',
829 'name': 'author_id_active',
833 'name': 'author_id_remarks',
837 'name': 'author_id_passwd',
841 'name': 'author_id_owner_id',
845 'name': 'author_id_lang',
849 'name': 'author_id_no_reset_sent',
853 'name': 'author_id_action_type',
857 'name': 'author_id_project_id',
861 'name': 'category_id_id',
865 'name': 'category_id_parent_id',
869 'name': 'category_id_short_name',
873 'name': 'category_id_title',
877 'name': 'category_id_page_text',
881 'name': 'category_id_type',
885 'name': 'category_id_search_on',
889 'name': 'category_id_image_menu_id',
893 'name': 'category_id_image_menuover_id',
897 'name': 'category_id_image_leftactive_id',
901 'name': 'category_id_image_page_id',
905 'name': 'category_id_display_order',
909 'name': 'category_id_more_info_title',
913 'name': 'category_id_more_info_text',
917 'name': 'category_id_visible',
921 'name': 'to_replace_id_id',
925 'name': 'to_replace_id_title',
929 'name': 'to_replace_id_published',
933 'name': 'to_replace_id_body',
937 'name': 'to_replace_id_comments_no',
941 'name': 'to_replace_id_trackbacks_no',
945 'name': 'to_replace_id_extended',
949 'name': 'to_replace_id_has_extended',
953 'name': 'to_replace_id_author_id',
957 'name': 'to_replace_id_category_id',
961 'name': 'to_replace_id_is_draft',
965 'name': 'to_replace_id_updated',
969 'name': 'to_replace_id_created',
973 'name': 'to_replace_id_to_replace_id',
977 'name': 'to_replace_id_page_link',
981 'name': 'to_replace_id_in_rss',
985 'name': 'to_replace_id_parent_id',
989 'name': 'parent_id_id',
993 'name': 'parent_id_title',
997 'name': 'parent_id_published',
1001 'name': 'parent_id_body',
1005 'name': 'parent_id_comments_no',
1009 'name': 'parent_id_trackbacks_no',
1013 'name': 'parent_id_extended',
1017 'name': 'parent_id_has_extended',
1021 'name': 'parent_id_author_id',
1025 'name': 'parent_id_category_id',
1029 'name': 'parent_id_is_draft',
1033 'name': 'parent_id_updated',
1037 'name': 'parent_id_created',
1041 'name': 'parent_id_to_replace_id',
1045 'name': 'parent_id_page_link',
1049 'name': 'parent_id_in_rss',
1053 'name': 'parent_id_parent_id',
1059 totalProperty : 'total',
1066 xtype : 'ColumnModel',
1067 dataIndex : 'is_draft',
1068 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1069 renderer : function(v,x,r) {
1071 if (r.data.is_deleted) {
1075 var state = v> 0 ? '' : '-checked';
1077 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1084 xtype : 'ColumnModel',
1085 dataIndex : 'primary_image_id',
1086 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1087 renderer : function(v,x,r)
1089 var size = _this.image_size_sel.getValue() * 1;
1091 if(v * 1 < 1 || size == 0){
1095 return String.format('<img src="{0}/Images/Thumb/{1}/{2}" width="{1}">', baseURL, size, v);
1103 xtype : 'ColumnModel',
1104 dataIndex : 'created',
1105 header : _this._strings['0eceeb45861f9585dd7a97a3e36f85c6'] /* Created */,
1106 renderer : function(v) { return v? v.format('d/M/Y') : '--' },
1112 xtype : 'ColumnModel',
1113 dataIndex : 'published',
1114 header : _this._strings['9b9d8a976b42e0bd66381797644943d5'] /* Published */,
1115 renderer : function(v,x,r) {
1116 if (r.data.is_draft) {
1120 return v? v.format('d/M/Y') : '--'
1127 xtype : 'ColumnModel',
1128 dataIndex : 'page_link',
1129 header : _this._strings['2cbaa804531fc7367ccc699fb1eef52a'] /* Page link / Name / Order */,
1130 renderer : function(v,x,r) {
1132 if (r.data.page_type_id_name == 'page') {
1133 return String.format('{0}', v);
1137 if (r.data.page_type_id_name == 'blog') {
1138 return String.format('{0}', v);
1140 // what about categories.??
1142 // menu, or elements.. ??
1144 var d = r.json.depth || 0;
1146 for (i = 0; i < d; i++) {
1149 if (r.data.page_type_id_name == 'element') {
1150 return String.format('{0}<i>{1}</i>', pr, v);
1153 return String.format('{0}{1}', pr, v);
1162 xtype : 'ColumnModel',
1163 dataIndex : 'title',
1164 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1165 renderer : function(v,x,r) {
1167 var d = r.json.tree_depth || 0;
1169 for (i = 0; i < d; i++) {
1173 var fmt = '<span style="color:blue">{2}{3}</span>' +
1174 (r.data.is_draft ? '<s>{0}</s> <b style="color:#a94442;">{1}</b>' : '{0} <b style="color:#a94442;">{1}</b>');
1176 return String.format( fmt,
1178 (r.data.has_child * 1 > 0) ? '[has child]' : '',
1180 (r.data.page_type_id_name == 'menu' ? '('+r.data.seq_id +')' : ''),
1181 (r.data.category_page_id *1 ? ( '[' + r.data.category_page_id_title +'] ' ): '')
1190 xtype : 'ColumnModel',
1191 dataIndex : 'template_id_template',
1192 header : _this._strings['ebd9bec4d70abc789d439c1f136b0538'] /* Layout */,
1193 renderer : function(v) { return String.format('{0}', v || ''); },
1199 xtype : 'ColumnModel',
1200 dataIndex : 'category_type_id_name',
1201 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1202 renderer : function(v, x, r)
1206 if (r.data.language.length) {
1207 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1210 if(r.data.translation_type.length){
1212 var types = r.data.translation_type.split(',');
1214 Roo.each(types, function(t){
1215 ret.push('>> ' + Pman.I18n.toName('l', t));
1219 return ret.join("<br/>");
1222 if (r.data.language.length) {
1223 return '>> ' + Pman.I18n.toName('l', r.data.language);
1227 /* if (r.data.in_rss) {
1228 return String.format('{0}', v);
1230 if (r.data.is_element) {
1231 return String.format('[Element:{0}]', r.data.element_id_name.length ? r.data.element_id_name : '');
1241 xtype : 'ColumnModel',
1242 dataIndex : 'menu_page_id_title',
1243 header : _this._strings['f7070be7ec7d2443714a2e5dc63f4de2'] /* Links to */,
1244 renderer : function(v,x,r) {
1246 if (r.data.is_attachment) {
1247 return "[ATTACHMENT]";
1249 return String.format('{0}', v);
1256 xtype : 'ColumnModel',
1257 dataIndex : 'author_id_name',
1258 header : _this._strings['a517747c3d12f99244ae598910d979c5'] /* Author */,
1259 renderer : function(v) { return String.format('{0}', v); },
1265 xtype : 'ColumnModel',
1266 dataIndex : 'parent_id_title',
1267 header : _this._strings['30269022e9d8f51beaabb52e5d0de2b7'] /* Parent */,
1269 renderer : function(v) { return String.format('{0}', v || ''); },
1275 xtype : 'ColumnModel',
1276 dataIndex : 'to_replace_id_title',
1277 header : _this._strings['75ae2cfdf786e5577f1b619f4ca8d728'] /* To replace */,
1279 renderer : function(v) { return String.format('{0}', v); },
1285 xtype : 'ColumnModel',
1286 dataIndex : 'has_extended',
1287 header : _this._strings['f46885d21c98f597303699f41b3d7afd'] /* Ex? */,
1288 renderer : function(v) { return String.format('{0}', v); },
1294 xtype : 'ColumnModel',
1295 dataIndex : 'trackbacks_no',
1296 header : _this._strings['a4863ff1cdfa709d5bf80939cd2e6757'] /* T# */,
1298 renderer : function(v) { return String.format('{0}', v); },
1304 xtype : 'ColumnModel',
1305 dataIndex : 'comments_no',
1306 header : _this._strings['d7efa19fbe7d3972fd5adb6024223d74'] /* C# */,
1307 renderer : function(v) { return String.format('{0}', v); },
1313 xtype : 'ColumnModel',
1314 dataIndex : 'seq_id',
1315 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1317 renderer : function(v,x,r)
1331 xtype : 'NestedLayoutPanel',
1333 fitContainer : true,
1339 xtype : 'BorderLayout',
1343 xtype : 'LayoutRegion',
1349 xtype : 'LayoutRegion',
1357 xtype : 'GridPanel',
1360 fitContainer : true,
1363 tableName : 'cms_page_category',
1364 title : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1366 activate : function() {
1368 _this.category_panel = this;
1370 if (_this.category_grid) {
1371 _this.category_grid.ds.load({});
1379 autoExpandColumn : 'display_name',
1384 _this.category_grid = this;
1386 if (_this.category_panel.active) {
1392 '|xns' : 'Roo.grid',
1400 text : _this._strings['63a6a88c066880c5ac42394a22803ca6'] /* Refresh */,
1402 click : function (_self, e)
1404 _this.category_grid.ds.load({});
1408 '|xns' : 'Roo.Toolbar'
1415 sortInfo : { field : 'category_id' , direction : 'ASC' },
1417 beforeload : function (_self, o)
1419 o.params = o.params || {};
1421 o.params._category_list = 1;
1425 '|xns' : 'Roo.data',
1427 xtype : 'HttpProxy',
1429 url : baseURL + '/Roo/cms_page_category.php',
1434 xtype : 'JsonReader',
1445 'name': 'display_name',
1459 totalProperty : 'total',
1465 xtype : 'RowSelectionModel',
1466 singleSelect : true,
1468 afterselectionchange : function (_self)
1470 _this.grid.footer.onClick('first');
1478 xtype : 'ColumnModel',
1479 dataIndex : 'display_name',
1480 header : _this._strings['3adbdb3ac060038aa0e6e6c138ef9873'] /* Category */,
1481 renderer : function(v,x,r) {
1482 return String.format('{0}', v ? v : '');
1492 xtype : 'ContentPanel',
1493 autoCreate : { tag: 'iframe', src : 'about:blank' },
1494 fitContainer : true,
1497 title : _this._strings['08d0135e24822f43171ed4944fc3bdda'] /* Preview (resize by dragging next to this bar) */,
1499 render : function (_self)
1501 _this.prepanel = _self;
1503 this.el.dom.onload = function(){
1506 !_this.targetData ||
1507 !_this.targetData.data.page_link.length ||
1509 typeof(uiConfig.cms_page_preview_base) == 'undefined'
1514 Roo.get(this.contentDocument.body).on('click', function(){
1515 var url = uiConfig.cms_page_preview_base + _this.targetData.data.page_link;
1528 xtype : 'GridPanel',
1530 fitContainer : true,
1533 tableName : 'cms_page',
1534 title : _this._strings['695e93e1d9db8283a9dd66782625065d'] /* Child Elements */,
1536 activate : function() {
1537 _this.child_element_panel = this;
1538 if (_this.child_element_grid) {
1539 //_this.child_element_grid.footer.onClick('first');
1548 autoExpandColumn : 'title',
1550 trigger_link_click : function(g, rowIndex, columnIndex, e)
1554 var target = e.getTarget();
1556 if(target.nodeName.toLowerCase() != 'a'){
1560 var rec = _this.grid.ds.getAt(rowIndex);
1562 var el = Roo.get(target);
1564 if(!el.hasClass('down') && !el.hasClass('up')){
1568 var s = this.dataSource.getAt(rowIndex);
1570 if(!s || s.data.id * 1 < 1){
1576 url : baseURL + '/Roo/cms_page',
1579 _move : el.hasClass('down') ? 'down' : 'up'
1581 success : function() {
1582 _this.child_element_grid.footer.onClick('refresh');
1590 cellclick : function (g, ri,ci, e)
\r
1592 var h = this.colModel.getDataIndex(ci);
1596 _this.child_element_grid.trigger_link_click(g, ri, ci, e);
1601 if (h != 'is_draft') {
\r
1605 var rec = g.ds.getAt(ri);
1607 rec.set('is_draft', rec.data.is_draft ? 0 : 1);
\r
1613 _this.child_element_grid = this;
1614 if (_this.child_element_panel.active) {
1615 // this.footer.onClick('first');
1618 rowdblclick : function (_self, rowIndex, e)
1620 var s = this.dataSource.getAt(rowIndex);
1622 _this.dialog.show(s.data, function() {
1623 _this.child_element_grid.footer.onClick('refresh');
1629 '|xns' : 'Roo.grid',
1631 xtype : 'PagingToolbar',
1633 displayMsg : _this._strings['040dcb21af4618f18d04e667c07ef314'] /* {0} - {1} of {2} */,
1634 emptyMsg : _this._strings['a9581db07856efb481fddef1b3e168f8'] /* No page found */,
1641 enableToggle : true,
1642 text : _this._strings['c8043f5cd3d28cb76c548338497b06ab'] /* Show Deleted */,
1644 click : function (_self, e)
1646 _this.child_element_grid.footer.onClick.defer(100, _this.child_element_grid.footer, ['first'] );
1647 this.setText( this.pressed ? "Hide Deleted" : "Show Deleted");
1649 render : function (_self)
1651 _this.child_show_deleted = this;
1655 '|xns' : 'Roo.Toolbar'
1666 cls : 'x-btn-text-icon',
1667 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1668 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1672 var s = _this.grid.selModel.getSelected();
1674 if(!s || s.data.id * 1 < 1 || s.data.template_id * 1 < 1){
1675 Roo.MessageBox.alert('Error', 'Please select a page');
1679 Pman.Dialog.AddChildElementToPage.show({
1680 template_id : s.data.template_id
1685 element_id : res.element_id,
1686 element_id_name : res.element_id_name,
1687 page_type_id : s.data.element_page_type_id,
1688 page_type_id_name : 'element',
1689 page_type_id_display_name : 'Elements',
1690 parent_id : s.data.id,
1691 parent_id_title : s.data.title
1694 _this.dialog.show( params, function() {
1695 _this.grid.footer.onClick('first');
1704 '|xns' : 'Roo.Toolbar'
1709 '|xns' : 'Roo.Toolbar'
1713 cls : 'x-btn-text-icon',
1714 icon : rootURL + '/Pman/templates/images/trash.gif',
1715 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1719 var sel = _this.child_element_grid.selModel.getSelected();
1721 if(!sel || sel.data.id * 1< 1){
1722 Roo.MessageBox.alert("Error", "Select page to delete");
1728 url : baseURL + '/Roo/cms_page',
1733 success : function() {
1734 _this.child_element_grid.footer.onClick('refresh');
1740 '|xns' : 'Roo.Toolbar'
1747 sortInfo : { field : 'created' , direction : 'DESC' },
1749 beforeload : function (_self, options)
1751 options.params = options.params || {};
1753 var sel = _this.grid.selModel.getSelected();
1757 sel.data.id * 1< 1 ||
1758 sel.data.page_type_id_name != 'page' ||
1759 sel.data.template_id * 1 < 1 ||
1760 sel.data.has_child_element_type * 1 < 1
1764 _this.child_element_panel.region.collapse();
1769 _this.child_element_panel.region.expand();
1771 options.params._list_elements = sel.data.id;
1773 if (_this.child_show_deleted.pressed) {
1774 options.params._show_deleted = 1;
1778 update : function (_self, record, operation)
1780 if (operation != 'commit') {
1783 // only used to change active status.
1785 new Pman.request({
\r
1787 url : baseURL + '/Roo/Cms_page',
\r
1789 id : record.data.id,
\r
1790 is_draft : record.data.is_draft
\r
1792 success : function(res) {
1793 _this.child_element_grid.footer.onClick('refresh');
1799 '|xns' : 'Roo.data',
1801 xtype : 'HttpProxy',
1803 url : baseURL + '/Roo/cms_page.php',
1808 xtype : 'JsonReader',
1819 'name': 'element_id_name',
1831 'name': 'is_deleted',
1839 'name': 'translation_type',
1843 'name': 'primary_image_id',
1849 totalProperty : 'total',
1855 xtype : 'RowSelectionModel',
1856 singleSelect : true,
1862 xtype : 'ColumnModel',
1863 dataIndex : 'primary_image_id',
1864 header : _this._strings['be53a0541a6d36f6ecb879fa2c584b08'] /* Image */,
1865 renderer : function(v,x,r)
1871 return String.format('<img src="{0}/Images/Thumb/40/{1}" width="40">', baseURL, v);
1878 xtype : 'ColumnModel',
1879 dataIndex : 'is_draft',
1880 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
1881 renderer : function(v,x,r) {
1883 var state = v> 0 ? '' : '-checked';
1885 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
1892 xtype : 'ColumnModel',
1893 dataIndex : 'element_id_name',
1894 header : _this._strings['ce5bf551379459c1c61d2a204061c455'] /* Location */,
1895 renderer : function(v,x,r) {
1897 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1899 return String.format( fmt, v);
1906 xtype : 'ColumnModel',
1907 dataIndex : 'title',
1908 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1909 renderer : function(v,x,r) {
1911 var fmt = (r.data.is_deleted ? '<s>{0}</s>' : '{0}');
1913 return String.format( fmt, v);
1920 xtype : 'ColumnModel',
1921 dataIndex : 'language',
1922 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
1923 renderer : function(v, x, r)
1927 if (r.data.language.length) {
1928 ret.push('>> ' + Pman.I18n.toName('l', r.data.language));
1931 if(r.data.translation_type.length){
1933 var types = r.data.translation_type.split(',');
1935 Roo.each(types, function(t){
1936 ret.push('>> ' + Pman.I18n.toName('l', t));
1940 return ret.join("<br/>");
1948 xtype : 'ColumnModel',
1949 dataIndex : 'seq_id',
1950 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1951 renderer : function(v,x,r)
1954 var fmt = String.format(
1955 '<a href="#" class="down" style="font-weight: bold; font-size: 20px; text-decoration: none;" tooltip="Down">↑</a>' +
1956 '<a href="#" class="up" style="font-weight: bold; font-size: 20px; text-decoration: none; margin-left: 15px;" tooltip="Up">↓</a>'
1967 xtype : 'ColumnModel',
1968 dataIndex : 'seq_id',
1969 header : _this._strings['7ee49db2b46c732d681edc761cf487ae'] /* Postion */,
1971 renderer : function(v,x,r)