Compiled ACP templates are stored using the active application in filename
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Jul 2014 11:09:19 +0000 (13:09 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 22 Jul 2014 11:09:19 +0000 (13:09 +0200)
Fixes uninstalling applications

wcfsetup/install/files/lib/data/application/Application.class.php
wcfsetup/install/files/lib/system/template/ACPTemplateEngine.class.php

index 3cd3350374aeb202ccbb2014d2072d8a16fa1c73..333cd9a57cb642872960105718b17dd3223122dc 100644 (file)
@@ -3,8 +3,9 @@ namespace wcf\data\application;
 use wcf\data\package\Package;
 use wcf\data\package\PackageList;
 use wcf\data\DatabaseObject;
-use wcf\system\request\RouteHandler;
+use wcf\system\application\ApplicationHandler;
 use wcf\system\exception\SystemException;
+use wcf\system\request\RouteHandler;
 use wcf\util\FileUtil;
 
 /**
@@ -45,6 +46,15 @@ class Application extends DatabaseObject {
         */
        protected static $directories = null;
        
+       /**
+        * Returns the abbreviation of the application.
+        * 
+        * @return      string
+        */
+       public function getAbbreviation() {
+               return ApplicationHandler::getInstance()->getAbbreviation($this->packageID);
+       }
+       
        /**
         * Returns absolute page URL.
         * 
index a2833007466ae6355acb60d95664fa4596a2c758..72d41bb08fbdebcdbb9521d048edbe06c304c525 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\template;
+use wcf\system\application\ApplicationHandler;
 
 /**
  * Loads and displays template in the ACP.
@@ -42,6 +43,13 @@ class ACPTemplateEngine extends TemplateEngine {
                self::deleteCompiledTemplates($compileDir);
        }
        
+       /**
+        * @see \wcf\system\template\TemplateEngine::getCompiledFilename()
+        */
+       public function getCompiledFilename($templateName, $application) {
+               return $this->compileDir.$this->templateGroupID.'_'.ApplicationHandler::getInstance()->getActiveApplication()->getAbbreviation().'_'.$this->languageID.'_'.$templateName.'.php';
+       }
+       
        /**
         * @see \wcf\system\template\TemplateEngine::setTemplateGroupID()
         */