</dd>
</dl>
+ <dl>
+ <dt><label for="application">{lang}wcf.acp.template.application{/lang}</label></dt>
+ <dd>
+ <select name="application" id="templateGroupID">
+ <option value="">{lang}wcf.acp.template.application.all{/lang}</option>
+ {foreach from=$availableApplications key=abbreviation item=availableApplication}
+ <option value="{$abbreviation}"{if $abbreviation == $application} selected="selected"{/if}>{$availableApplication}</option>
+ {/foreach}
+ </select>
+ </dd>
+ </dl>
+
<dl>
<dt><label for="searchTemplateName">{lang}wcf.global.name{/lang}</label></dt>
<dd>
<?php
namespace wcf\acp\page;
+use wcf\data\package\PackageCache;
use wcf\data\template\group\TemplateGroupList;
use wcf\page\SortablePage;
+use wcf\system\application\ApplicationHandler;
use wcf\system\WCF;
use wcf\util\StringUtil;
*/
public $searchTemplateName = '';
+ /**
+ * application
+ * @var string
+ */
+ public $application = '';
+
/**
* available template groups
* @var array
*/
public $availableTemplateGroups = array();
+ /**
+ * available applications
+ * @var array
+ */
+ public $availableApplications = array();
+
/**
* @see wcf\page\IPage::readParameters()
*/
if (isset($_REQUEST['templateGroupID'])) $this->templateGroupID = intval($_REQUEST['templateGroupID']);
if (isset($_REQUEST['searchTemplateName'])) $this->searchTemplateName = StringUtil::trim($_REQUEST['searchTemplateName']);
+ if (isset($_REQUEST['application'])) $this->application = StringUtil::trim($_REQUEST['application']);
}
/**
else $this->objectList->getConditionBuilder()->add('template.templateGroupID IS NULL');
if ($this->searchTemplateName) $this->objectList->getConditionBuilder()->add('templateName LIKE ?', array($this->searchTemplateName.'%'));
+ if ($this->application) $this->objectList->getConditionBuilder()->add('application = ?', array($this->application));
}
/**
$templateGroupList = new TemplateGroupList();
$templateGroupList->readObjects();
$this->availableTemplateGroups = $templateGroupList->getObjects();
+
+ // get applications
+ $applications = ApplicationHandler::getInstance()->getApplications();
+ foreach ($applications as $application) {
+ $package = PackageCache::getInstance()->getPackage($application->packageID);
+ $this->availableApplications[ApplicationHandler::getInstance()->getAbbreviation($package->packageID)] = $package;
+ }
}
/**
WCF::getTPL()->assign(array(
'templateGroupID' => $this->templateGroupID,
'searchTemplateName' => $this->searchTemplateName,
- 'availableTemplateGroups' => $this->availableTemplateGroups
+ 'application' => $this->application,
+ 'availableTemplateGroups' => $this->availableTemplateGroups,
+ 'availableApplications' => $this->availableApplications
));
}
}
<item name="wcf.acp.template.list"><![CDATA[Templates]]></item>
<item name="wcf.acp.template.group"><![CDATA[Templategruppe]]></item>
<item name="wcf.acp.template.group.default"><![CDATA[Standardtemplates]]></item>
+ <item name="wcf.acp.template.application"><![CDATA[Anwendung]]></item>
+ <item name="wcf.acp.template.application.all"><![CDATA[Keine Filterung]]></item>
<item name="wcf.acp.template.add"><![CDATA[Template hinzufügen]]></item>
<item name="wcf.acp.template.edit"><![CDATA[Template bearbeiten]]></item>
<item name="wcf.acp.template.copy"><![CDATA[Template kopieren]]></item>
<item name="wcf.acp.template.list"><![CDATA[Templates]]></item>
<item name="wcf.acp.template.group"><![CDATA[Template Group]]></item>
<item name="wcf.acp.template.group.default"><![CDATA[Default Templates]]></item>
+ <item name="wcf.acp.template.application"><![CDATA[Application]]></item>
+ <item name="wcf.acp.template.application.all"><![CDATA[TODO: Keine Filterung]]></item>
<item name="wcf.acp.template.add"><![CDATA[Add Template]]></item>
<item name="wcf.acp.template.edit"><![CDATA[Edit Template]]></item>
<item name="wcf.acp.template.copy"><![CDATA[Copy Template]]></item>