Add missing checks in template if page menu item can be deleted
authorMatthias Schmidt <gravatronics@live.com>
Sat, 28 Feb 2015 13:57:12 +0000 (14:57 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 28 Feb 2015 13:57:12 +0000 (14:57 +0100)
wcfsetup/install/files/acp/templates/pageMenuItemList.tpl

index bfa1f57d1ade9e612bc08ec05a63d9a8c8220c02..44adba915a3acd4307b7e6d13d2737fc900765ef 100644 (file)
                                                                                                        <span class="statusDisplay sortableButtonContainer">
                                                                                                                <span class="icon icon16 icon-check{if $childMenuItem->isDisabled}-empty{/if} jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $childMenuItem->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$childMenuItem->menuItemID}"></span>
                                                                                                                <a href="{link controller='PageMenuItemEdit' id=$childMenuItem->menuItemID}{/link}" class="jsTooltip" title="{lang}wcf.global.button.edit{/lang}"><span class="icon icon16 icon-pencil"></span></a>
-                                                                                                               <span class="icon icon16 icon-remove jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$childMenuItem->menuItemID}" data-confirm-message="{lang __menuItem=$childMenuItem}wcf.acp.pageMenu.delete.sure{/lang}"></span>
+                                                                                                               {if $childMenuItem->canDelete()}
+                                                                                                                       <span class="icon icon16 icon-remove jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$childMenuItem->menuItemID}" data-confirm-message="{lang __menuItem=$childMenuItem}wcf.acp.pageMenu.delete.sure{/lang}"></span>
+                                                                                                               {else}
+                                                                                                                       <span class="icon icon16 icon-remove disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
+                                                                                                               {/if}
                                                                                                                
                                                                                                                {event name='subHeaderItemButtons'}
                                                                                                        </span>
                                                                        <span class="statusDisplay sortableButtonContainer">
                                                                                <span class="icon icon16 icon-check{if $menuItem->isDisabled}-empty{/if} jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $menuItem->isDisabled}enable{else}disable{/if}{/lang}" data-object-id="{@$menuItem->menuItemID}"></span>
                                                                                <a href="{link controller='PageMenuItemEdit' id=$menuItem->menuItemID}{/link}" class="jsTooltip" title="{lang}wcf.global.button.edit{/lang}"><span class="icon icon16 icon-pencil"></span></a>
-                                                                               <span class="icon icon16 icon-remove jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$menuItem->menuItemID}" data-confirm-message="{lang __menuItem=$menuItem}wcf.acp.pageMenu.delete.sure{/lang}"></span>
+                                                                               {if $menuItem->canDelete()}
+                                                                                       <span class="icon icon16 icon-remove jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$menuItem->menuItemID}" data-confirm-message="{lang __menuItem=$menuItem}wcf.acp.pageMenu.delete.sure{/lang}"></span>
+                                                                               {else}
+                                                                                       <span class="icon icon16 icon-remove disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
+                                                                               {/if}
                                                                                
                                                                                {event name='footerItemButtons'}
                                                                        </span>