From: Alexander Ebert Date: Wed, 25 Jan 2017 13:29:36 +0000 (+0100) Subject: Disable access to media when editing signatures X-Git-Tag: 3.0.2~58 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0e1a9950dd56cf604ddb5f59b95f826cb11be698;p=GitHub%2FWoltLab%2FWCF.git Disable access to media when editing signatures --- diff --git a/com.woltlab.wcf/templates/signatureEdit.tpl b/com.woltlab.wcf/templates/signatureEdit.tpl index 55f6531915..142565769f 100644 --- a/com.woltlab.wcf/templates/signatureEdit.tpl +++ b/com.woltlab.wcf/templates/signatureEdit.tpl @@ -28,7 +28,10 @@
- + {if $errorField == 'text'} {if $errorType == 'empty'} diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 34786632c3..f77d6b7a6c 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -121,6 +121,8 @@ element.value = autosave.getInitialValue(); } + var disableMedia = elDataBool(element, 'disable-media'); + var config = { buttons: buttons, clipboardImageUpload: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if}, @@ -237,7 +239,15 @@ // media {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')} - config.plugins.push('WoltLabMedia'); + if (disableMedia) { + var index = config.buttons.indexOf('woltlabMedia'); + if (index !== -1) { + config.buttons.splice(index, 1); + } + } + else { + config.plugins.push('WoltLabMedia'); + } {/if} {if $__redactorConfig|isset}{@$__redactorConfig}{/if} diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 34786632c3..f77d6b7a6c 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -121,6 +121,8 @@ element.value = autosave.getInitialValue(); } + var disableMedia = elDataBool(element, 'disable-media'); + var config = { buttons: buttons, clipboardImageUpload: {if $__wcf->getBBCodeHandler()->isAvailableBBCode('img')}true{else}false{/if}, @@ -237,7 +239,15 @@ // media {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')} - config.plugins.push('WoltLabMedia'); + if (disableMedia) { + var index = config.buttons.indexOf('woltlabMedia'); + if (index !== -1) { + config.buttons.splice(index, 1); + } + } + else { + config.plugins.push('WoltLabMedia'); + } {/if} {if $__redactorConfig|isset}{@$__redactorConfig}{/if}