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/weblink/ |
/** * Loads the update weblink resource page * * @class MODx.page.UpdateWebLink * @extends MODx.Component * @param {Object} config An object of config properties * @xtype modx-page-weblink-update */ MODx.page.UpdateWebLink = function(config) { config = config || {}; Ext.applyIf(config,{ url: MODx.config.connectors_url+'resource/index.php' ,which_editor: 'none' ,formpanel: 'modx-panel-resource' ,id: 'modx-page-update-resource' ,action: 'update' ,actions: { 'new': MODx.action['resource/create'] ,edit: MODx.action['resource/update'] ,preview: MODx.action['resource/preview'] ,cancel: MODx.action['welcome'] } ,components: [{ xtype: 'modx-panel-weblink' ,renderTo: 'modx-panel-weblink-div' ,resource: config.resource ,record: config.record || {} ,publish_document: config.publish_document ,access_permissions: config.access_permissions ,show_tvs: config.show_tvs ,url: config.url }] ,loadStay: true ,buttons: this.getButtons(config) }); MODx.page.UpdateWebLink.superclass.constructor.call(this,config); }; Ext.extend(MODx.page.UpdateWebLink,MODx.Component,{ preview: function() { window.open(this.config.preview_url); return false; } ,duplicateResource: function(btn,e) { MODx.msg.confirm({ text: _('resource_duplicate_confirm') ,url: MODx.config.connectors_url+'resource/index.php' ,params: { action: 'duplicate' ,id: this.config.resource } ,listeners: { success: {fn:function(r) { MODx.loadPage(MODx.action['resource/update'], 'id='+r.object.id); },scope:this} } }); } ,deleteResource: function(btn,e) { MODx.msg.confirm({ text: _('resource_delete_confirm') ,url: MODx.config.connectors_url+'resource/index.php' ,params: { action: 'delete' ,id: this.config.resource } ,listeners: { success: {fn:function(r) { MODx.loadPage(MODx.action['resource/update'], 'id='+r.object.id); },scope:this} } }); } ,cancel: function(btn,e) { var fp = Ext.getCmp(this.config.formpanel); if (fp && fp.isDirty()) { Ext.Msg.confirm(_('warning'),_('resource_cancel_dirty_confirm'),function(e) { if (e == 'yes') { MODx.releaseLock(MODx.request.id); MODx.sleep(400); MODx.loadPage(MODx.action['welcome']); } },this); } else { MODx.releaseLock(MODx.request.id); MODx.loadPage(MODx.action['welcome']); } } ,getButtons: function(cfg) { var btns = []; if (cfg.canSave == 1) { btns.push({ process: 'update' ,id: 'modx-abtn-save' ,text: _('save') ,method: 'remote' ,checkDirty: cfg.richtext || MODx.request.reload ? false : true ,keys: [{ key: MODx.config.keymap_save || 's' ,ctrl: true }] }); btns.push('-'); } else { btns.push({ text: cfg.lockedText || _('locked') ,handler: Ext.emptyFn ,disabled: true ,id: 'modx-abtn-locked' }); btns.push('-'); } if (cfg.canCreate == 1) { btns.push({ process: 'duplicate' ,id: 'modx-abtn-duplicate' ,text: _('duplicate') ,handler: this.duplicateResource ,scope:this }); btns.push('-'); } if (cfg.canDelete == 1 && !cfg.locked) { btns.push({ process: 'delete' ,id: 'modx-abtn-delete' ,text: _('delete') ,handler: this.deleteResource ,scope:this }); btns.push('-'); } btns.push({ process: 'preview' ,id: 'modx-abtn-preview' ,text: _('view') ,handler: this.preview ,scope: this }); btns.push('-'); btns.push({ process: 'cancel' ,id: 'modx-abtn-cancel' ,text: _('cancel') ,handler: this.cancel ,scope: this }); btns.push('-'); btns.push({ text: _('help_ex') ,handler: MODx.loadHelpPane ,id: 'modx-abtn-help' }); return btns; } }); Ext.reg('modx-page-weblink-update',MODx.page.UpdateWebLink);