Skip to content

Commit

Permalink
Dev: removed TemplateConfig::$sFilesDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Oct 19, 2017
1 parent 18f33e6 commit 3fd27d7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/templates.php
Expand Up @@ -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;

Expand Down
3 changes: 0 additions & 3 deletions application/models/TemplateConfig.php
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions application/models/TemplateManifest.php
Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3fd27d7

Please sign in to comment.