3 namespace wcf\system\template
;
5 use wcf\system\application\ApplicationHandler
;
8 * Loads and displays template in the ACP.
10 * @author Alexander Ebert
11 * @copyright 2001-2019 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 class ACPTemplateEngine
extends TemplateEngine
19 protected $environment = 'admin';
24 protected function init()
28 $this->templatePaths
= ['wcf' => WCF_DIR
. 'acp/templates/'];
29 $this->compileDir
= WCF_DIR
. 'acp/templates/compiled/';
33 * Deletes all compiled acp templates.
35 * @param string $compileDir
37 public static function deleteCompiledACPTemplates($compileDir = '')
39 if (empty($compileDir)) {
40 $compileDir = WCF_DIR
. 'acp/templates/compiled/';
43 self
::deleteCompiledTemplates($compileDir);
49 public function getCompiledFilename($templateName, $application)
51 $abbreviation = 'wcf';
53 $abbreviation = ApplicationHandler
::getInstance()->getActiveApplication()->getAbbreviation();
56 return $this->getCompileFilePrefix($templateName) . '_' . $abbreviation . '_' . $this->languageID
. '_' . $templateName . '.php';
60 * This method always throws, because changing the template group is not supported.
62 * @param int $templateGroupID
63 * @throws \BadMethodCallException
65 public function setTemplateGroupID($templateGroupID)
67 throw new \
BadMethodCallException("You may not change the template group of the acp template engine");
73 public function getTemplateListenerCode($templateName, $eventName)
75 // skip template listeners within WCFSetup
80 return parent
::getTemplateListenerCode($templateName, $eventName);