Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/public_html/manager/assets/modext/sections/resource/ |
/** * Loads the resource data page * * @class MODx.page.ResourceData * @extends MODx.Component * @param {Object} config An object of config properties * @xtype modx-page-resource-data */ MODx.page.ResourceData = function(config) { config = config || {}; var btns = []; if (config.canEdit == 1) { btns.push({ process: 'edit' ,id: 'modx-abtn-edit' ,text: _('edit') ,hidden: config.canEdit == 1 ? false : true ,handler: this.editResource ,scope: this }); btns.push('-'); } btns.push({ process: 'preview' ,text: _('view') ,handler: this.preview ,scope: this ,id: 'modx-abtn-preview' }); btns.push('-'); btns.push({ process: 'cancel' ,text: _('cancel') ,handler: this.cancel ,scope: this ,id: 'modx-abtn-cancel' }); Ext.applyIf(config,{ form: 'modx-resource-data' ,actions: { 'new': MODx.action['resource/create'] ,edit: MODx.action['resource/update'] ,cancel: MODx.action['welcome'] } ,buttons: btns ,components: [{ xtype: 'modx-panel-resource-data' ,renderTo: 'modx-panel-resource-data-div' ,resource: config.record.id ,context: config.record.context_key ,class_key: config.record.class_key ,pagetitle: config.record.pagetitle ,border: false ,url: config.url }] }); MODx.page.ResourceData.superclass.constructor.call(this,config); }; Ext.extend(MODx.page.ResourceData,MODx.Component,{ preview: function() { window.open(this.config.record.preview_url); return false; } ,editResource: function() { MODx.loadPage(MODx.action['resource/update'], 'id='+this.config.record.id); } ,cancel: function() { MODx.loadPage(MODx.action['welcome']); } }); Ext.reg('modx-page-resource-data',MODx.page.ResourceData);