Bilder für Erklärtexte in eigene Ordner ausgelagert
This commit is contained in:
committed by
Eric Blommel
parent
ad09024f48
commit
b81068b701
@@ -136,7 +136,7 @@ class TopicData
|
||||
if (!isset($article)) {
|
||||
$article = "Kein Erklärtext vorhanden";
|
||||
}
|
||||
$article = str_replace('$TOPICPATH', Config::getTopicDirectory($subjectId, $topicId), $article);
|
||||
$article = str_replace('$TOPICPATH', Config::getTopicDirectory($subjectId, $topicId) . "images", $article);
|
||||
|
||||
$result->article = $article;
|
||||
|
||||
@@ -232,7 +232,7 @@ class TopicData
|
||||
*/
|
||||
public function addImage(string $name, string $tmp_name): bool
|
||||
{
|
||||
$imageDirectory = Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "";
|
||||
$imageDirectory = Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "images/";
|
||||
|
||||
if(!is_dir($imageDirectory)) {
|
||||
if(!mkdir($imageDirectory)) {
|
||||
@@ -248,13 +248,13 @@ class TopicData
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht eine downloadbare Datei des Themas
|
||||
* Löscht ein Bild des Themas
|
||||
* @param string $name Dateiname
|
||||
* @return bool true, wenn erfolgreich, sonst false
|
||||
*/
|
||||
public function deleteImage(string $name): bool
|
||||
{
|
||||
if(!unlink(Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "$name")) {
|
||||
if(!unlink(Config::getTopicDirectory($this->getSubjectId() , $this->getId()) . "images/$name")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user