Hides smiley tab if user has no permission to use smileys
authorMatthias Schmidt <gravatronics@live.com>
Wed, 5 Jun 2013 14:13:15 +0000 (16:13 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 5 Jun 2013 14:13:15 +0000 (16:13 +0200)
com.woltlab.wcf/templates/messageFormSettings.tpl
com.woltlab.wcf/templates/messageFormTabs.tpl
wcfsetup/install/files/lib/form/MessageForm.class.php

index 5c4f52354eb495de2c3e5b46b99c97608f7c732e..4b1f4bfcd330fd30e8d2541d9586a855f5116bd0 100644 (file)
@@ -1,24 +1,24 @@
 <fieldset id="settings" class="settingsContent tabMenuContent container containerPadding">
        <dl class="wide">
-               {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')}
+               {if $__wcf->getSession()->getPermission($permissionCanUseBBCodes)}
                        <dd>
                                <label><input id="preParse" name="preParse" type="checkbox" value="1"{if $preParse} checked="checked"{/if} /> {lang}wcf.message.settings.preParse{/lang}</label>
                                <small>{lang}wcf.message.settings.preParse.description{/lang}</small>
                        </dd>
                {/if}
-               {if $__wcf->getSession()->getPermission('user.message.canUseSmilies')}
+               {if $__wcf->getSession()->getPermission($permissionCanUseSmilies)}
                        <dd>
                                <label><input id="enableSmilies" name="enableSmilies" type="checkbox" value="1"{if $enableSmilies} checked="checked"{/if} /> {lang}wcf.message.settings.enableSmilies{/lang}</label>
                                <small>{lang}wcf.message.settings.enableSmilies.description{/lang}</small>
                        </dd>
                {/if}
-               {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')}
+               {if $__wcf->getSession()->getPermission($permissionCanUseBBCodes)}
                        <dd>
                                <label><input id="enableBBCodes" name="enableBBCodes" type="checkbox" value="1"{if $enableBBCodes} checked="checked"{/if} /> {lang}wcf.message.settings.enableBBCodes{/lang}</label>
                                <small>{lang}wcf.message.settings.enableBBCodes.description{/lang}</small>
                        </dd>
                {/if}
-               {if $__wcf->getSession()->getPermission('user.message.canUseHtml')}
+               {if $__wcf->getSession()->getPermission($permissionCanUseHtml)}
                        <dd>
                                <label><input id="enableHtml" name="enableHtml" type="checkbox" value="1"{if $enableHtml} checked="checked"{/if} /> {lang}wcf.message.settings.enableHtml{/lang}</label>
                                <small>{lang}wcf.message.settings.enableHtml.description{/lang}</small>
index e8660effaef14a7c32b471c91e1fef7fdacbe945..b81e937a97bf4b1ad3caf8381e6eaf3685ca0fa4 100644 (file)
@@ -1,7 +1,7 @@
 <div class="tabMenuContainer" data-active="{$activeTabMenuItem}" data-store="activeTabMenuItem">
        <nav class="tabMenu jsOnly">
                <ul>
-                       {if MODULE_SMILEY && $smileyCategories|count}<li id="smiliesTab"><a href="{@$__wcf->getAnchor('smilies')}" title="{lang}wcf.message.smilies{/lang}">{lang}wcf.message.smilies{/lang}</a></li>{/if}
+                       {if MODULE_SMILEY && $__wcf->getSession()->getPermission($permissionCanUseSmilies) && $smileyCategories|count}<li id="smiliesTab"><a href="{@$__wcf->getAnchor('smilies')}" title="{lang}wcf.message.smilies{/lang}">{lang}wcf.message.smilies{/lang}</a></li>{/if}
                        {if MODULE_ATTACHMENT && $attachmentHandler !== null && $attachmentHandler->canUpload()}<li id="attachmentsTab"><a href="{@$__wcf->getAnchor('attachments')}" title="{lang}wcf.attachment.attachments{/lang}">{lang}wcf.attachment.attachments{/lang}</a></li>{/if}
                        <li><a href="{@$__wcf->getAnchor('settings')}" title="{lang}wcf.message.settings{/lang}">{lang}wcf.message.settings{/lang}</a></li>
                        {if $__showPoll|isset && $__showPoll}<li><a href="{@$__wcf->getAnchor('poll')}" title="{lang}wcf.poll.management{/lang}">{lang}wcf.poll.management{/lang}</a></li>{/if}
@@ -9,7 +9,7 @@
                </ul>
        </nav>
        
-       {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'}
index 0b3f0e20f4766a1f9b1a06934b78368df3f7740d..ad4bf420ab0478c86df04353804d4d00b3561651 100644 (file)
@@ -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,