From 6f8092bd88918120d35e13eaf0f3b94d4012f104 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 5 Jun 2013 16:13:15 +0200 Subject: [PATCH] Hides smiley tab if user has no permission to use smileys --- com.woltlab.wcf/templates/messageFormSettings.tpl | 8 ++++---- com.woltlab.wcf/templates/messageFormTabs.tpl | 4 ++-- wcfsetup/install/files/lib/form/MessageForm.class.php | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/com.woltlab.wcf/templates/messageFormSettings.tpl b/com.woltlab.wcf/templates/messageFormSettings.tpl index 5c4f52354e..4b1f4bfcd3 100644 --- a/com.woltlab.wcf/templates/messageFormSettings.tpl +++ b/com.woltlab.wcf/templates/messageFormSettings.tpl @@ -1,24 +1,24 @@
- {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')} + {if $__wcf->getSession()->getPermission($permissionCanUseBBCodes)}
{lang}wcf.message.settings.preParse.description{/lang}
{/if} - {if $__wcf->getSession()->getPermission('user.message.canUseSmilies')} + {if $__wcf->getSession()->getPermission($permissionCanUseSmilies)}
{lang}wcf.message.settings.enableSmilies.description{/lang}
{/if} - {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')} + {if $__wcf->getSession()->getPermission($permissionCanUseBBCodes)}
{lang}wcf.message.settings.enableBBCodes.description{/lang}
{/if} - {if $__wcf->getSession()->getPermission('user.message.canUseHtml')} + {if $__wcf->getSession()->getPermission($permissionCanUseHtml)}
{lang}wcf.message.settings.enableHtml.description{/lang} diff --git a/com.woltlab.wcf/templates/messageFormTabs.tpl b/com.woltlab.wcf/templates/messageFormTabs.tpl index e8660effae..b81e937a97 100644 --- a/com.woltlab.wcf/templates/messageFormTabs.tpl +++ b/com.woltlab.wcf/templates/messageFormTabs.tpl @@ -1,7 +1,7 @@
- {if MODULE_SMILEY && $smileyCategories|count}{include file='messageFormSmilies'}{/if} + {if MODULE_SMILEY && $__wcf->getSession()->getPermission($permissionCanUseSmilies) && $smileyCategories|count}{include file='messageFormSmilies'}{/if} {if MODULE_ATTACHMENT && $attachmentHandler !== null && $attachmentHandler->canUpload()}{include file='messageFormAttachments'}{/if} {include file='messageFormSettings'} diff --git a/wcfsetup/install/files/lib/form/MessageForm.class.php b/wcfsetup/install/files/lib/form/MessageForm.class.php index 0b3f0e20f4..ad4bf420ab 100644 --- a/wcfsetup/install/files/lib/form/MessageForm.class.php +++ b/wcfsetup/install/files/lib/form/MessageForm.class.php @@ -369,6 +369,9 @@ abstract class MessageForm extends RecaptchaForm { 'enableSmilies' => $this->enableSmilies, 'languageID' => ($this->languageID ?: 0), 'maxTextLength' => $this->maxTextLength, + 'permissionCanUseBBCodes' => $this->permissionCanUseBBCodes, + 'permissionCanUseHtml' => $this->permissionCanUseHtml, + 'permissionCanUseSmilies' => $this->permissionCanUseSmilies, 'preParse' => $this->preParse, 'showSignature' => $this->showSignature, 'showSignatureSetting' => $this->showSignatureSetting, -- 2.20.1