Testfach hinzugefügt
This commit is contained in:
6
webseite/config/subjects/test/properties.json
Normal file
6
webseite/config/subjects/test/properties.json
Normal 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
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"displayName": "bildtest",
|
||||||
|
"icon": "fa-vial",
|
||||||
|
"description": "tests mit bildern",
|
||||||
|
"relatedTopics": []
|
||||||
|
}
|
||||||
1
webseite/config/subjects/test/topics/bildtest/tasks.json
Normal file
1
webseite/config/subjects/test/topics/bildtest/tasks.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -80,6 +80,10 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||||||
$relatedTopics[] = $relatedTopic;
|
$relatedTopics[] = $relatedTopic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dom = new DOMDocument();
|
||||||
|
$dom->loadHTML($_POST['article']);
|
||||||
|
$article = $dom->textContent;
|
||||||
|
|
||||||
if(isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) {
|
if(isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) {
|
||||||
$newTopic = $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->setIcon($_POST['icon']);
|
||||||
|
|
||||||
$newTopic->setRelatedTopics($relatedTopics);
|
$newTopic->setRelatedTopics($relatedTopics);
|
||||||
$newTopic->setArticle($_POST['article']);
|
$newTopic->setArticle($article);
|
||||||
} else {
|
} 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) {
|
if(!$newTopic) {
|
||||||
|
|||||||
Reference in New Issue
Block a user