Check edit permissions before showing edit link in ACP's article list
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:19:40 +0000 (14:19 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 28 Mar 2023 12:29:25 +0000 (14:29 +0200)
wcfsetup/install/files/acp/templates/articleList.tpl

index 996a547d6daec8caf7e56fa4968e318e37c2b116..a562f818441c642a7b0363e03be283e1f2412b9a 100644 (file)
                                        <tr class="jsArticleRow jsClipboardObject" data-object-id="{@$article->articleID}">
                                                <td class="columnMark"><input type="checkbox" class="jsClipboardItem" data-object-id="{@$article->articleID}"></td>
                                                <td class="columnIcon">
-                                                       <a href="{link controller='ArticleEdit' id=$article->articleID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
+                                                       {if $article->canEdit()}
+                                                               <a href="{link controller='ArticleEdit' id=$article->articleID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
+                                                       {else}
+                                                               <span class="icon icon16 fa-pencil disabled" title="{lang}wcf.global.button.edit{/lang}"></span>
+                                                       {/if}
                                                        {if $article->canDelete()}
                                                                <a href="#" class="jsButtonRestore jsTooltip" title="{lang}wcf.global.button.restore{/lang}" data-confirm-message-html="{lang __encode=true}wcf.acp.article.restore.confirmMessage{/lang}"{if !$article->isDeleted} style="display: none"{/if}><span class="icon icon16 fa-refresh"></span></a>
                                                                <a href="#" class="jsButtonDelete jsTooltip" title="{lang}wcf.global.button.delete{/lang}" data-confirm-message-html="{lang __encode=true}wcf.acp.article.delete.confirmMessage{/lang}"{if !$article->isDeleted} style="display: none"{/if}><span class="icon icon16 fa-times"></span></a>