diff --git a/webseite/assets/css/topic.css b/webseite/assets/css/topic.css index 4a1674e..6b6fc8b 100644 --- a/webseite/assets/css/topic.css +++ b/webseite/assets/css/topic.css @@ -345,4 +345,12 @@ body { border: 2px solid; border-radius: 8px; text-align: center; +} + +.content { + margin: auto; + padding: 2rem; + background: white; + border-radius: 1rem; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); } \ No newline at end of file diff --git a/webseite/subjectEditor.php b/webseite/subjectEditor.php index 020bd33..d0c99fd 100644 --- a/webseite/subjectEditor.php +++ b/webseite/subjectEditor.php @@ -160,24 +160,19 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
"; + } + ?>
diff --git a/webseite/topicEditor.php b/webseite/topicEditor.php index 208aa43..8611fa6 100644 --- a/webseite/topicEditor.php +++ b/webseite/topicEditor.php @@ -20,7 +20,7 @@ $defaultValues['displayName'] = ""; $defaultValues['id'] = ""; $defaultValues['subjectId'] = ""; $defaultValues['description'] = ""; -$defaultValues['icon'] = ""; +$defaultValues['icon'] = "fa-book"; $defaultValues['relatedTopics'] = ""; $defaultValues['existing_files'] = ""; $defaultValues['formulas'] = ""; @@ -52,62 +52,62 @@ if (isset($_GET['subject']) && isset($_GET['topic'])) { $defaultValues['formulas'] = implode(";;;;", $tasks); $defaultValues['article'] = $editingTopic->getFinishedArticle(); } -} else if(isset($_GET['subject'])) { +} else if (isset($_GET['subject'])) { $defaultValues['subjectId'] = $_GET['subject']; } -if($_SERVER['REQUEST_METHOD'] == 'POST') { +if ($_SERVER['REQUEST_METHOD'] == 'POST') { foreach ($defaultValues as $key => $value) { $defaultValues[$key] = $_POST[$key]; } - if(!isset($_POST['displayName']) || trim($_POST['displayName']) == "") { + if (!isset($_POST['displayName']) || trim($_POST['displayName']) == "") { $errors["displayName"] = "Bitte geben Sie einen Namen an."; } - if(!isset($_POST['id']) || trim($_POST['id']) == "") { + if (!isset($_POST['id']) || trim($_POST['id']) == "") { $errors["id"] = "Bitte geben Sie eine ID an."; } - if(!isset($_POST['subjectId']) || trim($_POST['subjectId']) == "") { + if (!isset($_POST['subjectId']) || trim($_POST['subjectId']) == "") { $errors["subjectId"] = "Bitte geben Sie ein Fach an."; } - if(!isset($_POST['description']) || trim($_POST['description']) == "") { + if (!isset($_POST['description']) || trim($_POST['description']) == "") { $errors["description"] = "Bitte geben Sie eine Beschreibung an."; } - if(!isset($_POST['icon']) || trim($_POST['icon']) == "") { + if (!isset($_POST['icon']) || trim($_POST['icon']) == "") { $errors["icon"] = "Bitte geben Sie ein Icon an."; } - if(!isset($_POST['relatedTopics'])) { + if (!isset($_POST['relatedTopics'])) { $errors["relatedTopics"] = "Feld relatedTopics nicht mitgesendet!"; } - if(!isset($_POST['existing_files'])) { + if (!isset($_POST['existing_files'])) { $errors["existing_files"] = "Feld existing_files nicht mitgesendet!"; } - if(!isset($_POST['formulas'])) { + if (!isset($_POST['formulas'])) { $errors["formulas"] = "Feld formulas nicht mitgesendet!"; } - if(!isset($_POST['article']) || trim($_POST['article']) == "") { + if (!isset($_POST['article']) || trim($_POST['article']) == "") { $errors["article"] = "Bitte geben Sie einen Erklärtext an."; } - if(!isset($_POST['submit']) || !($_POST['submit'] == "Speichern" || $_POST['submit'] == "Thema löschen")) { + if (!isset($_POST['submit']) || !($_POST['submit'] == "Speichern" || $_POST['submit'] == "Thema löschen")) { $errors["submit"] = "Ungültig abgeschickt!"; } - if(empty($errors)) { + if (empty($errors)) { $newTopic = false; $relatedTopics = array(); foreach (explode(",", $_POST['relatedTopics']) as $relatedTopic) { $relatedTopic = trim($relatedTopic); - if($relatedTopic == "") { + if ($relatedTopic == "") { continue; } $relatedTopics[] = $relatedTopic; @@ -116,7 +116,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { $existingFiles = array(); foreach (explode(",", $_POST['existing_files']) as $existingTopic) { $existingTopic = trim($existingTopic); - if($existingTopic == "") { + if ($existingTopic == "") { continue; } $existingFiles[] = trim($existingTopic); @@ -162,7 +162,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { $newImages = array(); foreach ($htmlImages as $htmlImage) { $src = $htmlImage->getAttribute('src'); - if(str_starts_with($src, "data:image")) { + if (str_starts_with($src, "data:image")) { $image = file_get_contents($src); if (!$image) { continue; @@ -190,7 +190,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { // extension=mbstring in php.ini muss aktiviert sein! $article = mb_convert_encoding($dom->saveHTML(), 'UTF-8', 'HTML-ENTITIES'); - if(isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) { + if (isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) { $newTopic = $allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']]; $newTopic->setDisplayName($_POST['displayName']); @@ -199,7 +199,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { $newTopic->setIcon($_POST['icon']); $newTopic->setRelatedTopics($relatedTopics); foreach ($newTopic->getFiles() as $file) { - if(!in_array($file, $existingFiles)) { + if (!in_array($file, $existingFiles)) { $newTopic->deleteDownload($file); } } @@ -209,10 +209,10 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { $newTopic = TopicData::createNew($_POST['id'], $_POST['subjectId'], $_POST['displayName'], $_POST['icon'], $_POST['description'], $relatedTopics, $article); } - if(!$newTopic) { + if (!$newTopic) { $errors["error"] = "Fehler beim Speichern des Themas."; } else { - for($i = 0; $i < count($_FILES['new_files']['name']); $i++) { + for ($i = 0; $i < count($_FILES['new_files']['name']); $i++) { !$newTopic->addDownload($_FILES['new_files']['name'][$i], $_FILES['new_files']['tmp_name'][$i]); } @@ -224,7 +224,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { $newTopic->addTask($formula); } - if($_POST['submit'] == "Thema löschen") { + if ($_POST['submit'] == "Thema löschen") { $newTopic->delete(); header("Location: " . "subject.php?subject=" . $_POST['subjectId']); } else { @@ -238,6 +238,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { } ?> + @@ -254,169 +255,177 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { - - + + -
-
- -
-
- - -
+ -
- - -
+
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - +
+
+ +
- --> -
-
- - -
+
+ + +
-
- - -
-
+
+ +
+ +
+ + + +
-
+ + +
- echo $article; +
+ +
+
"; + } + ?> +
+ +
+
+ + +
- ?>
+
+ + +
+ +
+ +
+ +
+ + Dateien hier ablegen oder klicken, um Dateien auszuwählen +
+
+
+ +
+ + +
+ +
+ + +
+
+
+ +
+ + +
+
+ +
+
- -
- - - -
- -
-

Vorschau

-
-
- -
- - - -
- - -
+
+ + + + + +
+ + +