Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d28560b77e | |||
| ee6dd0ddae | |||
| feb64eb769 | |||
| ecc76e453e | |||
| 949ca542ab | |||
| b090195d9f | |||
| 1f1e7dc814 | |||
| 3606a750be | |||
| 8762bc1b07 | |||
| c7f279b7e9 | |||
| 92f1f077d2 | |||
| 50120f974d | |||
| 713a258d48 | |||
| 0a7e6df734 | |||
| 8c769ba280 | |||
| 5bcb64f7f8 | |||
| 944f40d89f | |||
| b15421efee | |||
| 2044853f94 | |||
| 9a3e4cc7dc | |||
| f508a222c6 | |||
| 365f37dcea | |||
| 2472143146 | |||
| a1184299b1 | |||
| c41302d046 | |||
| aaefd2917e | |||
| ee7986bef3 | |||
| 8de1b1bdb5 | |||
| 4a663391ef | |||
| 4cd877ea4c | |||
| 0f573d30ae | |||
| fdd56c10b8 | |||
| 46daf72a14 | |||
| 896e6abcd8 | |||
| 95e5cf0908 | |||
| be35a00cef | |||
| b616251511 | |||
| 3f5313dd00 | |||
| f909d0453b | |||
| d5f4f2b8a5 | |||
| 87a8e9b7d2 |
@@ -1,40 +0,0 @@
|
|||||||
<!--
|
|
||||||
Seite: 404 Seite nicht gefunden
|
|
||||||
Funktion: Wenn eine Seite nicht gefunden wurde oder noch fehlt, dann wird hierauf verwiesen.
|
|
||||||
-->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<main>
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h1>404 - Seite nicht vorhanden</h1>
|
|
||||||
<p>
|
|
||||||
Später im Projekt sollen über index.php?pfad= ... der Inhalt der index.php dynamisch gesetzt werden.
|
|
||||||
Alle Content-Links der Navbar führen zunächst hier her. Exemplarisch wurden für die Fächer Informatik, Physik, Mathematik der Content als Seite erstellt und kann über die Navbar ausgekundschaftet werden.
|
|
||||||
</p>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<!--
|
||||||
|
Seite: 404 Seite nicht gefunden
|
||||||
|
Funktion: Wenn eine Seite nicht gefunden wurde oder noch fehlt, dann wird hierauf verwiesen.
|
||||||
|
-->
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<h1>404 - Seite nicht vorhanden</h1>
|
||||||
|
<p>
|
||||||
|
Später im Projekt sollen über index.php?pfad= ... der Inhalt der index.php dynamisch gesetzt werden.
|
||||||
|
Alle Content-Links der Navbar führen zunächst hier her. Exemplarisch wurden für die Fächer Informatik, Physik, Mathematik der Content als Seite erstellt und kann über die Navbar ausgekundschaftet werden.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<!--
|
||||||
|
Seite: Beitrag erstellen
|
||||||
|
Inhalt: Formular für die Erstellung eines neuen Beitrags
|
||||||
|
-->
|
||||||
|
<?php
|
||||||
|
include_once $abs_path . '/php/model/ArticleManagerDAO.php';
|
||||||
|
include_once $abs_path . '/php/model/ArticleManager.php';
|
||||||
|
|
||||||
|
if(isset($_POST['title']) && isset($_POST['content']) && isset($_POST['category'])) {
|
||||||
|
|
||||||
|
}else{
|
||||||
|
// TODO: Exception werfen.
|
||||||
|
echo"Fehler!";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form method="post" action="php/controller/createArticle-controller.php" id="editor-form" class="wp-editor-scope editor-container">
|
||||||
|
|
||||||
|
<main class="editor-main">
|
||||||
|
<input type="text" id="title" name="title" placeholder="Titel hier eingeben" required>
|
||||||
|
<textarea id="content" name="content" placeholder="Schreibe deinen Beitrag..."></textarea>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- Seitenleiste -->
|
||||||
|
<aside class="editor-sidebar">
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<button type="submit" class="btn-publish">Veröffentlichen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<label for="category">Kategorie <span class="required">*</span></label>
|
||||||
|
<select id="category" name="category" required>
|
||||||
|
<option value="" disabled selected>Kategorie wählen...</option>
|
||||||
|
|
||||||
|
<optgroup label="Sprachen">
|
||||||
|
<option value="deutsch">Deutsch</option>
|
||||||
|
<option value="englisch">Englisch</option>
|
||||||
|
<option value="franzoesisch">Französisch</option>
|
||||||
|
<option value="latein">Latein</option>
|
||||||
|
<option value="literatur">Literatur</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="MINT">
|
||||||
|
<option value="mathe">Mathematik</option>
|
||||||
|
<option value="biologie">Biologie</option>
|
||||||
|
<option value="chemie">Chemie</option>
|
||||||
|
<option value="physik">Physik</option>
|
||||||
|
<option value="informatik">Informatik</option>
|
||||||
|
<option value="astronomie">Astronomie</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="Gesellschaft & Werte">
|
||||||
|
<option value="geschichte">Geschichte</option>
|
||||||
|
<option value="erdkunde">Erdkunde</option>
|
||||||
|
<option value="sozialkunde">Sozialkunde</option>
|
||||||
|
<option value="wirtschaft">Wirtschaftskunde</option>
|
||||||
|
<option value="religion">Religion</option>
|
||||||
|
<option value="ethik">Ethikunterricht</option>
|
||||||
|
<option value="philosophie">Philosophie</option>
|
||||||
|
<option value="psychologie">Psychologie</option>
|
||||||
|
<option value="kunst">Kunst</option>
|
||||||
|
<option value="musik">Musik</option>
|
||||||
|
<option value="theater">Theater</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="Technik & Praxis">
|
||||||
|
<option value="technik">Technik</option>
|
||||||
|
<option value="werken">Werken</option>
|
||||||
|
<option value="hauswirtschaft">Hauswirtschaft</option>
|
||||||
|
<option value="sport">Sport</option>
|
||||||
|
</optgroup>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<label for="tags">Schlagwörter</label>
|
||||||
|
<input type="text" id="tags" name="tags" placeholder="z.B. Technik, IT (mit Komma trennen)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
</form>
|
||||||
@@ -2,28 +2,6 @@
|
|||||||
Seite: Datenschutzerklärung
|
Seite: Datenschutzerklärung
|
||||||
Inhalt: Informationen zur Datenverarbeitung gemäß DSGVO
|
Inhalt: Informationen zur Datenverarbeitung gemäß DSGVO
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<h1>Datenschutz</h1>
|
<h1>Datenschutz</h1>
|
||||||
@@ -38,10 +16,3 @@ include_once 'includes/navbar.php';
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
+3
-3
@@ -17,21 +17,21 @@
|
|||||||
<!-- Flexbox -->
|
<!-- Flexbox -->
|
||||||
<div class="flexbox">
|
<div class="flexbox">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a href="informatik.php" class="category-link">Informatik</a>
|
<a href="index.php?pfad=informatik" class="category-link">Informatik</a>
|
||||||
<div class="article-link">
|
<div class="article-link">
|
||||||
<a href="datenschutzVSdatensicherheit.php">Datenschutz vs. Datensicherheit</a>
|
<a href="datenschutzVSdatensicherheit.php">Datenschutz vs. Datensicherheit</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a href="mathe.php" class="category-link">Mathe</a>
|
<a href="index.php?pfad=mathe" class="category-link">Mathe</a>
|
||||||
<div class="article-link">
|
<div class="article-link">
|
||||||
<a href="pythagoras.php">Satz des Pythagoras</a>
|
<a href="pythagoras.php">Satz des Pythagoras</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a href="physik.php" class="category-link">Physik</a>
|
<a href="index.php?pfad=physik" class="category-link">Physik</a>
|
||||||
<div class="article-link">
|
<div class="article-link">
|
||||||
<a href="tunneleffekt.php">Der Tunneleffekt</a>
|
<a href="tunneleffekt.php">Der Tunneleffekt</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,27 +2,6 @@
|
|||||||
Seite: Impressum
|
Seite: Impressum
|
||||||
Inhalt: wer wie was auf der Webseite
|
Inhalt: wer wie was auf der Webseite
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
@@ -38,10 +17,3 @@ include_once 'includes/navbar.php';
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -2,26 +2,6 @@
|
|||||||
Seite: Informatik
|
Seite: Informatik
|
||||||
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<h1>Informatik</h1>
|
<h1>Informatik</h1>
|
||||||
@@ -39,10 +19,3 @@ include_once 'includes/navbar.php';
|
|||||||
<a href="datenschutzVSdatensicherheit.php">Datenschutz vs. Datensicherheit</a>
|
<a href="datenschutzVSdatensicherheit.php">Datenschutz vs. Datensicherheit</a>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -2,27 +2,6 @@
|
|||||||
Form: Login-Bereich
|
Form: Login-Bereich
|
||||||
Funktion: Benutzerauthentifizierung und Zugang zum eigenen Profil, Erstellen von Beiträgen, etc.
|
Funktion: Benutzerauthentifizierung und Zugang zum eigenen Profil, Erstellen von Beiträgen, etc.
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main class="login-page">
|
<main class="login-page">
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
|
|
||||||
@@ -50,11 +29,4 @@ include_once 'includes/navbar.php';
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -2,27 +2,6 @@
|
|||||||
Seite: Mathe
|
Seite: Mathe
|
||||||
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<h1>Mathe</h1>
|
<h1>Mathe</h1>
|
||||||
@@ -40,11 +19,4 @@ include_once 'includes/navbar.php';
|
|||||||
<div>
|
<div>
|
||||||
<a href="pythagoras.php">Satz des Pythagoras</a>
|
<a href="pythagoras.php">Satz des Pythagoras</a>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -2,27 +2,6 @@
|
|||||||
Seite: Physik
|
Seite: Physik
|
||||||
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
Inhalt: Eine Übersicht über alle Beiträge zum Fach
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<h1>Physik</h1>
|
<h1>Physik</h1>
|
||||||
@@ -41,11 +20,4 @@ include_once 'includes/navbar.php';
|
|||||||
<a href="tunneleffekt.php">Der Tunneleffekt</a>
|
<a href="tunneleffekt.php">Der Tunneleffekt</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1,27 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
Seite: Profil
|
Content: Profil
|
||||||
Inhalt: Das eigene Profil, wenn man angemeldet ist. Dort hat man die Möglichkeit seine Angaben zu ändern.
|
Inhalt: Das eigene Profil, wenn man angemeldet ist. Dort hat man die Möglichkeit seine Angaben zu ändern.
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main class="form-page">
|
<main class="form-page">
|
||||||
|
|
||||||
@@ -63,11 +43,4 @@ include_once 'includes/navbar.php';
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -2,27 +2,6 @@
|
|||||||
Form: Registrierung
|
Form: Registrierung
|
||||||
Funktion: Erstellung neuer Benutzerkonten
|
Funktion: Erstellung neuer Benutzerkonten
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="de">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="description" content="EduForge">
|
|
||||||
<meta name="author" content="Niklas Ortmann">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
||||||
<link rel="stylesheet" href="css/main.css">
|
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
|
||||||
<title>EduForge</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include_once 'includes/navbar.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<main class="login-page">
|
<main class="login-page">
|
||||||
<div class="login-container">
|
<div class="login-container">
|
||||||
|
|
||||||
@@ -50,10 +29,4 @@ include_once 'includes/navbar.php';
|
|||||||
<button type="submit" value="anmelden" name="loginSubmit" class="login-button">kostenlos registrieren</button>
|
<button type="submit" value="anmelden" name="loginSubmit" class="login-button">kostenlos registrieren</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<?php
|
|
||||||
include_once 'includes/footer.php';
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/* editor in Flexbox */
|
||||||
|
.wp-editor-scope.editor-container {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
|
color: #1e1e1e;
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope * {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hauptbereich */
|
||||||
|
.wp-editor-scope .editor-main {
|
||||||
|
flex: 1;
|
||||||
|
padding: 40px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20px;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #title {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #content {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
resize: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Seitenleiste */
|
||||||
|
.wp-editor-scope .editor-sidebar {
|
||||||
|
width: 300px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-left: 1px solid #e0e0e0;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .sidebar-block {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .sidebar-block label {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .required {
|
||||||
|
color: #d94f4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Formularelemente innerhalb der Editor-Sidebar */
|
||||||
|
.wp-editor-scope .editor-sidebar select,
|
||||||
|
.wp-editor-scope .editor-sidebar input[type="text"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Button-Zeugs */
|
||||||
|
.wp-editor-scope .btn-publish {
|
||||||
|
background-color: #007cba;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .btn-publish:hover {
|
||||||
|
background-color: #006ba1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 760px) {
|
||||||
|
.wp-editor-scope.editor-container {
|
||||||
|
/* Sidebar nach unten */
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .editor-main {
|
||||||
|
/* weniger Innenabstand */
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #content {
|
||||||
|
/* Verhindert, dass das Textfeld auf kleinen Displays kollabiert */
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .editor-sidebar {
|
||||||
|
width: 100%;
|
||||||
|
/* Entfernt den linken Rand und setzt ihn nach oben als Trenner */
|
||||||
|
border-left: none;
|
||||||
|
border-top: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-1
@@ -3,7 +3,6 @@ main {
|
|||||||
max-width:1200px;
|
max-width:1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -12,6 +11,10 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a, button, input, select, textarea, label, main{
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
.flexbox {
|
.flexbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
+2
-2
@@ -149,8 +149,8 @@ CSS für die navbar
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive Anpassungen unter 660px (für z.B. Smartphones) */
|
/* Responsive Anpassungen unter 760px (für z.B. Smartphones) */
|
||||||
@media (max-width: 660px) {
|
@media (max-width: 760px) {
|
||||||
.nav {
|
.nav {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
+63
-58
@@ -15,56 +15,60 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<ul id="mobile-nav" class="nav__mobile-menu">
|
<ul id="mobile-nav" class="nav__mobile-menu">
|
||||||
<li><a href="profile.php">Profil</a></li>
|
<li>
|
||||||
<li><a href="login.php">Anmelden</a></li>
|
<label for="nav-toggle" class="nav__close-btn">×</label>
|
||||||
<li><a href="register.php">Registrieren</a></li>
|
</li>
|
||||||
|
<li><a href="index.php?pfad=profile">Profil</a></li>
|
||||||
|
<li><a href="index.php?pfad=login">Anmelden</a></li>
|
||||||
|
<li><a href="index.php?pfad=register">Registrieren</a></li>
|
||||||
|
<li><a href="index.php?pfad=createArticle">Beitrag erstellen</a></li>
|
||||||
<li>
|
<li>
|
||||||
<label class="nav__mobile-label">Sprachen</label>
|
<label class="nav__mobile-label">Sprachen</label>
|
||||||
<ul class="nav__mobile-submenu">
|
<ul class="nav__mobile-submenu">
|
||||||
<li><a href="404.php">Deutsch</a></li>
|
<li><a href="index.php?pfad=deutsch">Deutsch</a></li>
|
||||||
<li><a href="404.php">Englisch</a></li>
|
<li><a href="index.php?pfad=englisch">Englisch</a></li>
|
||||||
<li><a href="404.php">Französisch</a></li>
|
<li><a href="index.php?pfad=franzoesisch">Französisch</a></li>
|
||||||
<li><a href="404.php">Latein</a></li>
|
<li><a href="index.php?pfad=latein">Latein</a></li>
|
||||||
<li><a href="404.php">Literatur</a></li>
|
<li><a href="index.php?pfad=literatur">Literatur</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label class="nav__mobile-label">MINT</label>
|
<label class="nav__mobile-label">MINT</label>
|
||||||
<ul class="nav__mobile-submenu">
|
<ul class="nav__mobile-submenu">
|
||||||
<li><a href="mathe.php">Mathematik</a></li>
|
<li><a href="index.php?pfad=mathe">Mathematik</a></li>
|
||||||
<li><a href="404.php">Biologie</a></li>
|
<li><a href="index.php?pfad=biologie">Biologie</a></li>
|
||||||
<li><a href="404.php">Chemie</a></li>
|
<li><a href="index.php?pfad=chemie">Chemie</a></li>
|
||||||
<li><a href="physik.php">Physik</a></li>
|
<li><a href="index.php?pfad=englisch">Physik</a></li>
|
||||||
<li><a href="informatik.php">Informatik</a></li>
|
<li><a href="index.php?pfad=informatik">Informatik</a></li>
|
||||||
<li><a href="404.php">Astronomie</a></li>
|
<li><a href="index.php?pfad=astronomie">Astronomie</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label class="nav__mobile-label">Gesellschaft & Werte</label>
|
<label class="nav__mobile-label">Gesellschaft & Werte</label>
|
||||||
<ul class="nav__mobile-submenu">
|
<ul class="nav__mobile-submenu">
|
||||||
<li><a href="404.php">Geschichte</a></li>
|
<li><a href="index.php?pfad=geschichte">Geschichte</a></li>
|
||||||
<li><a href="404.php">Erdkunde</a></li>
|
<li><a href="index.php?pfad=erdkunde">Erdkunde</a></li>
|
||||||
<li><a href="404.php">Sozialkunde</a></li>
|
<li><a href="index.php?pfad=sozialkunde">Sozialkunde</a></li>
|
||||||
<li><a href="404.php">Wirtschaftskunde</a></li>
|
<li><a href="index.php?pfad=wirtschaft">Wirtschaftskunde</a></li>
|
||||||
<li><a href="404.php">Religion</a></li>
|
<li><a href="index.php?pfad=religion">Religion</a></li>
|
||||||
<li><a href="404.php">Ethikunterricht</a></li>
|
<li><a href="index.php?pfad=ethik">Ethikunterricht</a></li>
|
||||||
<li><a href="404.php">Philosophie</a></li>
|
<li><a href="index.php?pfad=philosophie">Philosophie</a></li>
|
||||||
<li><a href="404.php">Psychologie</a></li>
|
<li><a href="index.php?pfad=psychologie">Psychologie</a></li>
|
||||||
<li><a href="404.php">Kunst</a></li>
|
<li><a href="index.php?pfad=kunst">Kunst</a></li>
|
||||||
<li><a href="404.php">Musik</a></li>
|
<li><a href="index.php?pfad=musik">Musik</a></li>
|
||||||
<li><a href="404.php">Theater</a></li>
|
<li><a href="index.php?pfad=theater">Theater</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label class="nav__mobile-label">Technik & Praxis</label>
|
<label class="nav__mobile-label">Technik & Praxis</label>
|
||||||
<ul class="nav__mobile-submenu">
|
<ul class="nav__mobile-submenu">
|
||||||
<li><a href="404.php">Technik</a></li>
|
<li><a href="index.php?pfad=technik">Technik</a></li>
|
||||||
<li><a href="404.php">Werken</a></li>
|
<li><a href="index.php?pfad=werken">Werken</a></li>
|
||||||
<li><a href="404.php">Hauswirtschaft</a></li>
|
<li><a href="index.php?pfad=hauswirtschaft">Hauswirtschaft</a></li>
|
||||||
<li><a href="404.php">Sport</a></li>
|
<li><a href="index.php?pfad=sport">Sport</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -74,59 +78,60 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">Sprachen</button>
|
<button class="nav__dropdown-toggle">Sprachen</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
<a href="404.php">Deutsch</a>
|
<a href="index.php?pfad=deutsch">Deutsch</a>
|
||||||
<a href="404.php">Englisch</a>
|
<a href="index.php?pfad=englisch">Englisch</a>
|
||||||
<a href="404.php">Französisch</a>
|
<a href="index.php?pfad=franzoesisch">Französisch</a>
|
||||||
<a href="404.php">Latein</a>
|
<a href="index.php?pfad=latein">Latein</a>
|
||||||
<a href="404.php">Literatur</a>
|
<a href="index.php?pfad=literatur">Literatur</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">MINT</button>
|
<button class="nav__dropdown-toggle">MINT</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
<a href="mathe.php">Mathematik</a>
|
<a href="index.php?pfad=mathe">Mathematik</a>
|
||||||
<a href="404.php">Biologie</a>
|
<a href="index.php?pfad=biologie">Biologie</a>
|
||||||
<a href="404.php">Chemie</a>
|
<a href="index.php?pfad=chemie">Chemie</a>
|
||||||
<a href="physik.php">Physik</a>
|
<a href="index.php?pfad=physik">Physik</a>
|
||||||
<a href="informatik.php">Informatik</a>
|
<a href="index.php?pfad=informatik">Informatik</a>
|
||||||
<a href="404.php">Astronomie</a>
|
<a href="index.php?pfad=astronomie">Astronomie</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">Gesellschaft & Werte</button>
|
<button class="nav__dropdown-toggle">Gesellschaft & Werte</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
<a href="404.php">Geschichte</a>
|
<a href="index.php?pfad=geschichte">Geschichte</a>
|
||||||
<a href="404.php">Erdkunde</a>
|
<a href="index.php?pfad=erdkunde">Erdkunde</a>
|
||||||
<a href="404.php">Sozialkunde</a>
|
<a href="index.php?pfad=sozialkunde">Sozialkunde</a>
|
||||||
<a href="404.php">Wirtschaftskunde</a>
|
<a href="index.php?pfad=wirtschaft">Wirtschaftskunde</a>
|
||||||
<a href="404.php">Religion</a>
|
<a href="index.php?pfad=religion">Religion</a>
|
||||||
<a href="404.php">Ethikunterricht</a>
|
<a href="index.php?pfad=ethik">Ethikunterricht</a>
|
||||||
<a href="404.php">Philosophie</a>
|
<a href="index.php?pfad=philosophie">Philosophie</a>
|
||||||
<a href="404.php">Psychologie</a>
|
<a href="index.php?pfad=psychologie">Psychologie</a>
|
||||||
<a href="404.php">Kunst</a>
|
<a href="index.php?pfad=kunst">Kunst</a>
|
||||||
<a href="404.php">Musik</a>
|
<a href="index.php?pfad=musik">Musik</a>
|
||||||
<a href="404.php">Theater</a>
|
<a href="index.php?pfad=theater">Theater</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">Technik & Praxis</button>
|
<button class="nav__dropdown-toggle">Technik & Praxis</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
<a href="404.php">Technik</a>
|
<a href="index.php?pfad=technik">Technik</a>
|
||||||
<a href="404.php">Werken</a>
|
<a href="index.php?pfad=werken">Werken</a>
|
||||||
<a href="404.php">Hauswirtschaft</a>
|
<a href="index.php?pfad=hauswirtschaft">Hauswirtschaft</a>
|
||||||
<a href="404.php">Sport</a>
|
<a href="index.php?pfad=sport">Sport</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav__right">
|
<div class="nav__right">
|
||||||
<a href = "profile.php" class="nav_item nav__link">Profil</a>
|
<a href="index.php?pfad=profile" class="nav_item nav__link">Profil</a>
|
||||||
<div class="nav__search">
|
<div class="nav__search">
|
||||||
<?php
|
<?php
|
||||||
include_once 'search.php';
|
include_once 'search.php';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<a href = "login.php" class="nav__item nav__button">Anmelden</a>
|
<a href="index.php?pfad=login" class="nav__item nav__button">Anmelden</a>
|
||||||
<a href = "register.php" class="nav__item nav__button">Registrieren</a>
|
<a href="index.php?pfad=register" class="nav__item nav__button">Registrieren</a>
|
||||||
|
<a href="index.php?pfad=createArticle" class="nav__item nav__button">Beitrag erstellen</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
|
||||||
|
<?php
|
||||||
|
if (!isset($abs_path)) {
|
||||||
|
require_once "path.php";
|
||||||
|
}
|
||||||
|
require_once $abs_path . "/php/controller/index-controller.php";
|
||||||
|
?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Seite: Hompage der Lernplattform
|
Seite: Index der Lernplattform
|
||||||
Funktion: Webseitengerüst, Anzeigen von Beiträgen, Suchfunktion etc.
|
Funktion: Webseitengerüst, Anzeigen von Content
|
||||||
-->
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
@@ -14,6 +22,7 @@
|
|||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
<link rel="stylesheet" href="css/navbar.css">
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
<link rel="stylesheet" href="css/footer.css">
|
||||||
|
<link rel="stylesheet" href="css/article.css">
|
||||||
<title>EduForge</title>
|
<title>EduForge</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -21,13 +30,18 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once 'includes/navbar.php';
|
include_once $abs_path . '/includes/navbar.php';
|
||||||
//Dynamischer Inhalt (später mit php...):
|
//Dynamischer Inhalt:
|
||||||
include_once 'content/home.php';
|
if (isset($_GET["pfad"])) {
|
||||||
?>
|
if (file_exists($abs_path . '/content/' . $_GET["pfad"] . '.php')) {
|
||||||
|
include_once $abs_path . '/content/' . $_GET["pfad"] . '.php';
|
||||||
<?php
|
} else {
|
||||||
include_once 'includes/footer.php';
|
include_once $abs_path . '/content/404.php';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
include_once $abs_path . '/content/home.php';
|
||||||
|
}
|
||||||
|
include_once $abs_path . '/includes/footer.php';
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once $abs_path . '/php/model/ArticleManager.php';
|
||||||
|
require_once $abs_path . '/php/model/Article.php';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$articleManager = new ArticleManager();
|
||||||
|
}catch (Exception $e){
|
||||||
|
die("Fehler bei der Initialisierung des Artikel-Managers: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$author = "max.mustermann@web.de"; // wird später aus session bezogen.
|
||||||
|
$articleManager->newArticle($_POST['post-title'], $_POST['post-content'], $author);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "Fehler beim Erstellen des Beitrags: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Klasse: Artikel
|
||||||
|
* Diese Klasse stellt alle Daten eines Artikels (Beitrag) bereit
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
class Article
|
||||||
|
{
|
||||||
|
private $id;
|
||||||
|
private $title;
|
||||||
|
private $content;
|
||||||
|
private $author;
|
||||||
|
private $date;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt die ID eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Titel eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return $this->title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setzt den Titel eines Artikels.
|
||||||
|
*/
|
||||||
|
public function setTitle($title)
|
||||||
|
{
|
||||||
|
$this->title = $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Content eines Artikels zurück.
|
||||||
|
* TODO: Content muss noch definiert werden.
|
||||||
|
*/
|
||||||
|
public function getContent()
|
||||||
|
{
|
||||||
|
return $this->content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setzt den Content eines Artikels.
|
||||||
|
* TODO: Content muss noch definiert werden.
|
||||||
|
*/
|
||||||
|
public function setContent($content)
|
||||||
|
{
|
||||||
|
$this->content = $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Autor eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getAuthor()
|
||||||
|
{
|
||||||
|
return $this->author;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt das Veröffentlichungsdatum des Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getDate()
|
||||||
|
{
|
||||||
|
return $this->date;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
require_once 'ArticleManagerDAO.php';
|
||||||
|
/*
|
||||||
|
* Klasse: Eine lokale Lösung der DatenbankDAO.
|
||||||
|
* schreibt zunächst Daten lokal in das Verzeichnis und kann diese wieder auslesen.
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
class ArticleManager implements ArticleManagerDAO {
|
||||||
|
/*
|
||||||
|
* Gibt die Datenbank-Instanz zurück.
|
||||||
|
*/
|
||||||
|
public static function getInstance()
|
||||||
|
{
|
||||||
|
if (self::$instance == null) {
|
||||||
|
self::$instance = new ArticleManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prüft, ob die lokalen txt-Dateien existieren.
|
||||||
|
* Wenn nicht, werden diese erstellt.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newArticle($title, $content, $author, $category) {
|
||||||
|
$newData = array(
|
||||||
|
"title" => $title,
|
||||||
|
"content" => $content,
|
||||||
|
"author" => $author,
|
||||||
|
"category" => $category,
|
||||||
|
//"tags" => isset($_POST["tags"]) ? $_POST["tags"] : '', TODO: Später hinzufügen
|
||||||
|
"date" => date("d.m.Y, H:i")
|
||||||
|
);
|
||||||
|
$newData = base64_encode(serialize($newData));
|
||||||
|
if (!file_exists("articles.txt")) {
|
||||||
|
$newData = fopen("articles.txt", "xb");
|
||||||
|
fclose($newData);
|
||||||
|
}
|
||||||
|
$previousData = file_get_contents("articles.txt");
|
||||||
|
if (file_put_contents("articles.txt", "$newData\n$previousData")) {
|
||||||
|
// TODO: Vernünftige Rückmeldung implementieren.
|
||||||
|
echo "Artikel erfolgreich gespeichert!";
|
||||||
|
} else {
|
||||||
|
// TODO: passende Exceptions werfen.
|
||||||
|
echo "Fehler!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateArticle($id, $title, $content, $author)
|
||||||
|
{
|
||||||
|
// TODO: Implement updateArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteArticle($id)
|
||||||
|
{
|
||||||
|
// TODO: Implement deleteArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getArticle($id)
|
||||||
|
{
|
||||||
|
// TODO: Implement getArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllArticles()
|
||||||
|
{
|
||||||
|
// TODO: Implement getAllArticles() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Die Klasse binhaltet alle Methoden für die Operation auf der Datenbank.
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface ArticleManagerDAO
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer erstellt einen neuen Beitrag.
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
* $category Kategorie des Beitrags
|
||||||
|
* $tags optionale Schlagworte für eine bessere Suche
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function newArticle($title, $content, $author, $category);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer bearbeitet einen Beitrag.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function updateArticle($id, $title, $content, $author);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer löscht einen seiner Beiträge.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function deleteArticle($id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Beitrag aufrufen.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function getArticle($id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Alle Beiträge aufrufen.
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function getAllArticles();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
-56
@@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Webhook: erfasst einen push auf dem dev (und aktualisiert das Webverzeichnis des Servers)
|
|
||||||
// Quelle: https://docs.gitea.com/usage/webhooks
|
|
||||||
ini_set('error_log', __DIR__ . '/tmp.log');
|
|
||||||
$secret_key = '763489347';
|
|
||||||
|
|
||||||
// check for POST request
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
|
||||||
error_log('FAILED - not POST - '. $_SERVER['REQUEST_METHOD']);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// get content type
|
|
||||||
$content_type = isset($_SERVER['CONTENT_TYPE']) ? strtolower(trim($_SERVER['CONTENT_TYPE'])) : '';
|
|
||||||
|
|
||||||
if ($content_type != 'application/json') {
|
|
||||||
error_log('FAILED - not application/json - '. $content_type);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// get payload
|
|
||||||
$payload = trim(file_get_contents("php://input"));
|
|
||||||
|
|
||||||
if (empty($payload)) {
|
|
||||||
error_log('FAILED - no payload');
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// get header signature
|
|
||||||
$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : '';
|
|
||||||
|
|
||||||
if (empty($header_signature)) {
|
|
||||||
error_log('FAILED - header signature missing');
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculate payload signature
|
|
||||||
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false);
|
|
||||||
|
|
||||||
// check payload signature against header signature
|
|
||||||
if ($header_signature !== $payload_signature) {
|
|
||||||
error_log('FAILED - payload signature');
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert json to array
|
|
||||||
$decoded = json_decode($payload, true);
|
|
||||||
|
|
||||||
// check for json decode errors
|
|
||||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
|
||||||
error_log('FAILED - json decode - '. json_last_error());
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// success, do something
|
|
||||||
error_log('SUCCESS - Webhook hat funktioniert');
|
|
||||||
Reference in New Issue
Block a user