Added 'position' column in menu list
authorMarcel Werk <burntime@woltlab.com>
Thu, 19 May 2016 19:41:46 +0000 (21:41 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 19 May 2016 19:46:07 +0000 (21:46 +0200)
wcfsetup/install/files/acp/templates/menuList.tpl
wcfsetup/install/files/lib/acp/page/MenuListPage.class.php

index 73807825735caaf90d52d93e8f5d87c5fa8bf786..8fe4c78e24c8dc2bf50ee775e600331191f10bf2 100644 (file)
@@ -35,6 +35,7 @@
                                <tr>
                                        <th class="columnPageID{if $sortField == 'menuID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='MenuList'}pageNo={@$pageNo}&sortField=menuID&sortOrder={if $sortField == 'menuID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
                                        <th class="columnTitle{if $sortField == 'title'} active {@$sortOrder}{/if}"><a href="{link controller='MenuList'}pageNo={@$pageNo}&sortField=title&sortOrder={if $sortField == 'title' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
+                                       <th class="columnText columnPosition{if $sortField == 'position'} active {@$sortOrder}{/if}"><a href="{link controller='MenuList'}pageNo={@$pageNo}&sortField=position&sortOrder={if $sortField == 'position' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.box.position{/lang}</a></th>
                                        <th class="columnDigits columnItems{if $sortField == 'items'} active {@$sortOrder}{/if}"><a href="{link controller='MenuList'}pageNo={@$pageNo}&sortField=items&sortOrder={if $sortField == 'items' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.menu.items{/lang}</a></th>
                                        
                                        {event name='columnHeads'}
@@ -57,6 +58,7 @@
                                                </td>
                                                <td class="columnID columnPageID">{@$menu->menuID}</td>
                                                <td class="columnTitle"><a href="{link controller='MenuItemList' id=$menu->menuID}{/link}">{lang}{$menu->title}{/lang}</a></td>
+                                               <td class="columnText columnPosition">{$menu->position}</td>
                                                <td class="columnDigits columnItems">{#$menu->items}</td>
                                                
                                                {event name='columns'}
index aebc64d68fa36dc7f6cc7961b0907bf3880be9cc..cbcefbd22ee4bd317c287d5d72f930903482e5a5 100644 (file)
@@ -37,7 +37,7 @@ class MenuListPage extends SortablePage {
        /**
         * @inheritDoc
         */
-       public $validSortFields = ['menuID', 'title', 'items'];
+       public $validSortFields = ['menuID', 'title', 'position', 'items'];
        
        /**
         * @inheritDoc
@@ -45,6 +45,6 @@ class MenuListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf'.WCF_N.'_menu_item WHERE menuID = menu.menuID) AS items';
+               $this->objectList->sqlSelects .= '(SELECT COUNT(*) FROM wcf'.WCF_N.'_menu_item WHERE menuID = menu.menuID) AS items, (SELECT position FROM wcf'.WCF_N.'_box WHERE menuID = menu.menuID) AS position';
        }
 }