Testfach hinzugefügt

This commit is contained in:
Matthias Grief
2025-01-01 18:05:25 +01:00
parent 0f0cdaacc1
commit ee5d41d478
5 changed files with 20 additions and 2 deletions

View File

@@ -80,6 +80,10 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
$relatedTopics[] = $relatedTopic;
}
$dom = new DOMDocument();
$dom->loadHTML($_POST['article']);
$article = $dom->textContent;
if(isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) {
$newTopic = $allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']];
@@ -89,9 +93,9 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
$newTopic->setIcon($_POST['icon']);
$newTopic->setRelatedTopics($relatedTopics);
$newTopic->setArticle($_POST['article']);
$newTopic->setArticle($article);
} else {
$newTopic = TopicData::createNew($_POST['id'], $_POST['subjectId'], $_POST['displayName'], $_POST['icon'], $_POST['description'], $relatedTopics, $_POST['article']);
$newTopic = TopicData::createNew($_POST['id'], $_POST['subjectId'], $_POST['displayName'], $_POST['icon'], $_POST['description'], $relatedTopics, $article);
}
if(!$newTopic) {