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

index 657e3e0712f0a16bc84f96ed04cfff1cadbd20b6..10842d58949a5cb8d89fa5e8365049e4e8d36ba5 100644 (file)
                                        <dt><label for="parentTemplateGroupID">{lang}wcf.acp.template.group.parentTemplateGroup{/lang}</label></dt>
                                        <dd>
                                                <select name="parentTemplateGroupID" id="parentTemplateGroupID">
-                                                       <option value="0">{lang}wcf.global.noSelection{/lang}</option>
-                                                       {foreach from=$availableTemplateGroups item=availableTemplateGroup}
-                                                               <option value="{@$availableTemplateGroup->templateGroupID}"{if $availableTemplateGroup->templateGroupID == $parentTemplateGroupID} selected="selected"{/if}>{$availableTemplateGroup->templateGroupName}</option>
-                                                       {/foreach}
+                                                       <option value="0">{lang}wcf.acp.template.group.default{/lang}</option>
+                                                       {htmlOptions options=$availableTemplateGroups selected=$parentTemplateGroupID disableEncoding=true}
                                                </select>
                                        </dd>
                                </dl>
index 05785b5030320c601a75864b74b6bfac2876896f..b9b0fe1e9674e3fc403565dbaff8810e6606bf5d 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\form;
+use wcf\data\template\group\TemplateGroup;
 use wcf\data\template\group\TemplateGroupAction;
 use wcf\data\template\group\TemplateGroupList;
 use wcf\form\AbstractForm;
@@ -149,10 +150,7 @@ class TemplateGroupAddForm extends AbstractForm {
        public function readData() {
                parent::readData();
                
-               $templateGroupList = new TemplateGroupList();
-               $templateGroupList->sqlOrderBy = "templateGroupName";
-               $templateGroupList->readObjects();
-               $this->availableTemplateGroups = $templateGroupList->getObjects();
+               $this->availableTemplateGroups = TemplateGroup::getSelectList(array(), 1);
        }
        
        /**