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

@@ -0,0 +1,6 @@
{
"displayName": "test",
"description": "tests",
"color": "#000000",
"icon": "fa-vial"
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
{
"displayName": "bildtest",
"icon": "fa-vial",
"description": "tests mit bildern",
"relatedTopics": []
}

View File

@@ -0,0 +1 @@
[]

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) {