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

index ff1e78e9951189e1c492b76467befe373f092af6..506b5414052be00262113da2beb43d0cf833a452 100644 (file)
@@ -31,9 +31,7 @@
                                        <dt><label for="templateGroupID">{lang}wcf.acp.template.group{/lang}</label></dt>
                                        <dd>
                                                <select name="templateGroupID" id="templateGroupID">
-                                                       {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 ba2178ad007730832747cca72bce75c25eabaad1..b134da106a79daec0dd510fa86e491e1cf292c4c 100644 (file)
@@ -3,7 +3,6 @@ namespace wcf\acp\form;
 use wcf\data\package\Package;
 use wcf\data\package\PackageCache;
 use wcf\data\template\group\TemplateGroup;
-use wcf\data\template\group\TemplateGroupList;
 use wcf\data\template\Template;
 use wcf\data\template\TemplateAction;
 use wcf\form\AbstractForm;
@@ -218,10 +217,7 @@ class TemplateAddForm extends AbstractForm {
        public function readData() {
                parent::readData();
                
-               $templateGroupList = new TemplateGroupList();
-               $templateGroupList->sqlOrderBy = "templateGroupName";
-               $templateGroupList->readObjects();
-               $this->availableTemplateGroups = $templateGroupList->getObjects();
+               $this->availableTemplateGroups = TemplateGroup::getSelectList();
                
                if (!count($_POST) && $this->copiedTemplate !== null) {
                        $this->tplName = $this->copiedTemplate->templateName;