diff --git a/application/controllers/admin/templates.php b/application/controllers/admin/templates.php index 545822d997c..0c093ce67fd 100644 --- a/application/controllers/admin/templates.php +++ b/application/controllers/admin/templates.php @@ -355,7 +355,7 @@ public function templatefiledelete() $templatedir = $oEditedTemplate->viewPath; $filesdir = $oEditedTemplate->filesPath; $sPostedFile = App()->request->getPost('otherfile'); - $sFileToDelete = str_replace($oEditedTemplate->sFilesDirectory, '', $sPostedFile); + $sFileToDelete = str_replace($oEditedTemplate->filesPath, '', $sPostedFile); $sFileToDelete = sanitize_filename( $sFileToDelete ,false,false); $the_full_file_path = $filesdir . $sFileToDelete; diff --git a/application/models/TemplateConfig.php b/application/models/TemplateConfig.php index b591c32b5dc..618646a0d27 100644 --- a/application/models/TemplateConfig.php +++ b/application/models/TemplateConfig.php @@ -37,9 +37,6 @@ class TemplateConfig extends CActiveRecord /** @var string $viewPath Path of the views files (twig template) */ public $viewPath; - /** @var string $sFilesDirectory name of the file directory */ - public $sFilesDirectory; - /** @var string $filesPath Path of the tmeplate's files */ public $filesPath; diff --git a/application/models/TemplateManifest.php b/application/models/TemplateManifest.php index f747565c8a0..bfb35735d5e 100644 --- a/application/models/TemplateManifest.php +++ b/application/models/TemplateManifest.php @@ -200,7 +200,7 @@ public function getOtherFiles() while (false !== ($file = readdir($handle))){ if (!array_search($file, array("DUMMYENTRY", ".", "..", "preview.png"))) { if (!is_dir($this->viewPath . DIRECTORY_SEPARATOR . $file)) { - $otherfiles[$file] = $this->sFilesDirectory . DIRECTORY_SEPARATOR . $file; + $otherfiles[$file] = $this->filesPath . DIRECTORY_SEPARATOR . $file; } } } @@ -697,7 +697,6 @@ protected function setThisTemplate() $this->viewPath = $this->path.DIRECTORY_SEPARATOR.$this->getTemplateForPath($this, '//viewdirectory')->config->engine->viewdirectory.DIRECTORY_SEPARATOR; $this->filesPath = $this->path.DIRECTORY_SEPARATOR.$this->getTemplateForPath($this, '//filesdirectory')->config->engine->filesdirectory.DIRECTORY_SEPARATOR; - $this->sFilesDirectory = $this->filesPath; // TODO: remove doublon $this->templateEditor = $this->getTemplateForPath($this, '//template_editor')->config->engine->template_editor; // Options are optional