Adds missing permission checks before displaying the style list button
authorMatthias Schmidt <gravatronics@live.com>
Sun, 9 Dec 2012 15:21:44 +0000 (16:21 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 9 Dec 2012 15:21:44 +0000 (16:21 +0100)
acptemplates/styleAdd.tpl
acptemplates/styleImport.tpl

index d20b8d4f47d333e86b8f8220025a9a03c3557cbc..904b5c2249fbf39656c03b41831df13d30e3cff8 100644 (file)
        <p class="success">{lang}wcf.global.form.{$action}.success{/lang}</p>   
 {/if}
 
-<div class="contentNavigation">
-       <nav>
-               <ul>
-                       {if $action == 'edit'}
-                               <li><a href="{link controller='StyleExport' id=$style->styleID}{/link}" class="button"><img src="{@$__wcf->getPath()}icon/download.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.exportStyle{/lang}</span></a></li>
-                               {if $__wcf->getSession()->getPermission('admin.style.canAddStyle')}<li><a class="jsCopyStyle button"><img src="{@$__wcf->getPath()}icon/add.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.copyStyle{/lang}</span></a></li>{/if}
-                       {/if}
-                       <li><a href="{link controller='StyleList'}{/link}" title="{lang}wcf.acp.menu.link.style.list{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.style.list{/lang}</span></a></li>
-               </ul>
-       </nav>
-</div>
+{hascontent}
+       <div class="contentNavigation">
+               <nav>
+                       <ul>
+                               {content}
+                                       {if $action == 'edit'}
+                                               <li><a href="{link controller='StyleExport' id=$style->styleID}{/link}" class="button"><img src="{@$__wcf->getPath()}icon/download.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.exportStyle{/lang}</span></a></li>
+                                               {if $__wcf->getSession()->getPermission('admin.style.canAddStyle')}<li><a class="jsCopyStyle button"><img src="{@$__wcf->getPath()}icon/add.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.style.copyStyle{/lang}</span></a></li>{/if}
+                                       {/if}
+                                       
+                                       {if $__wcf->session->getPermission('admin.style.canDeleteStyle') || $__wcf->session->getPermission('admin.style.canEditStyle')}
+                                               <li><a href="{link controller='StyleList'}{/link}" title="{lang}wcf.acp.menu.link.style.list{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.style.list{/lang}</span></a></li>
+                                       {/if}
+                               {/content}
+                       </ul>
+               </nav>
+       </div>
+{/hascontent}
 
 <form method="post" action="{if $action == 'add'}{link controller='StyleAdd'}{/link}{else}{link controller='StyleEdit' id=$styleID}{/link}{/if}">
        <div class="tabMenuContainer" data-active="{$activeTabMenuItem}" data-store="activeTabMenuItem">
index 848f7d93745d190c1455bfc1906bf2ad848037e4..3ff111b65e7837773ecf5b7a6c1016d041255008 100644 (file)
        <p class="success">{lang}wcf.global.form.add.success{/lang}</p> 
 {/if}
 
-<div class="contentNavigation">
-       <nav>
-               <ul>
-                       <li><a href="{link controller='StyleList'}{/link}" title="{lang}wcf.acp.menu.link.style.list{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.style.list{/lang}</span></a></li>
-               </ul>
-       </nav>
-</div>
+{hascontent}
+       <div class="contentNavigation">
+               <nav>
+                       <ul>
+                               {content}
+                                       {if $__wcf->session->getPermission('admin.style.canDeleteStyle') || $__wcf->session->getPermission('admin.style.canEditStyle')}
+                                               <li><a href="{link controller='StyleList'}{/link}" title="{lang}wcf.acp.menu.link.style.list{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/list.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.menu.link.style.list{/lang}</span></a></li>
+                                       {/if}
+                               {/content}
+                       </ul>
+               </nav>
+       </div>
+{/hascontent}
 
 <form method="post" action="{link controller='StyleImport'}{/link}" enctype="multipart/form-data">
        <div class="container containerPadding marginTop shadow">
@@ -45,7 +51,7 @@
                
                {event name='fieldsets'}
        </div>
-
+       
        <div class="formSubmit">
                <input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
        </div>