Use indented select list in TemplateListPage
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 23 May 2014 22:29:36 +0000 (00:29 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 10 Jun 2014 17:17:14 +0000 (19:17 +0200)
wcfsetup/install/files/acp/templates/templateList.tpl
wcfsetup/install/files/lib/acp/page/TemplateListPage.class.php

index de7a0d7f61a6deed820fd61b9ff618f146d6d9c8..17ea03c4e258d0cea1f4672f15f632fdcc2f50da 100644 (file)
@@ -36,9 +36,7 @@
                                <dd>
                                        <select name="templateGroupID" id="templateGroupID">
                                                <option value="0">{lang}wcf.acp.template.group.default{/lang}</option>
-                                               {foreach from=$availableTemplateGroups item=availableTemplateGroup}
-                                                       <option value="{@$availableTemplateGroup->templateGroupID}"{if $availableTemplateGroup->templateGroupID == $templateGroupID} selected="selected"{/if}>{$availableTemplateGroup->templateGroupName}</option>
-                                               {/foreach}
+                                               {htmlOptions options=$availableTemplateGroups selected=$templateGroupID disableEncoding=true}
                                        </select>
                                </dd>
                        </dl>
index 90002505753009a0f0c3771faff395a75faa0592..ada1662f1b675e91290955604cfe21b2cfdf4682 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\acp\page;
 use wcf\data\package\PackageCache;
-use wcf\data\template\group\TemplateGroupList;
+use wcf\data\template\group\TemplateGroup;
 use wcf\page\SortablePage;
 use wcf\system\application\ApplicationHandler;
 use wcf\system\WCF;
@@ -109,10 +109,7 @@ class TemplateListPage extends SortablePage {
                parent::readData();
                
                // get template groups
-               $templateGroupList = new TemplateGroupList();
-               $templateGroupList->sqlOrderBy = "templateGroupName";
-               $templateGroupList->readObjects();
-               $this->availableTemplateGroups = $templateGroupList->getObjects();
+               $this->availableTemplateGroups = TemplateGroup::getSelectList(array(), 1);
                
                // get applications
                $applications = ApplicationHandler::getInstance()->getApplications();