diff --git a/src/app/controllers/Page/ComposePage.php b/src/app/controllers/Page/ComposePage.php index 87e96ba075f9c5d5a979c1f7191e3e0a4da5381a..689fe635c93f7c75944b08377e968b0d75e660e5 100644 --- a/src/app/controllers/Page/ComposePage.php +++ b/src/app/controllers/Page/ComposePage.php @@ -1,20 +1,31 @@ <?php require_once SRC_ROOT_PATH . "/app/baseclasses/BaseController.php"; +require_once SRC_ROOT_PATH . "/app/controllers/Post/PostController.php"; + class ComposePage extends BaseController{ protected static $instance; - public function __construct(){ - parent::__construct(null); + public function __construct($srv){ + parent::__construct($srv); } public static function getInstance(){ if(!isset(self::$instance)){ - self::$instance = new static(); + self::$instance = new static( + PostController::getInstance() + ); } return self::$instance; } + public function post($urlParams) + { + $srv->post(); + require PAGE_PATH . "/submission.php"; + exit(); + } + public function get($urlParams) { require PAGE_PATH . "/post.php"; diff --git a/src/app/view/post.php b/src/app/view/post.php index e6dc18508ae08ed8c41460ced0af9d6980a3ea70..852691f625fcda97fb317fdcf0bb8c2871f9a7e1 100644 --- a/src/app/view/post.php +++ b/src/app/view/post.php @@ -11,9 +11,9 @@ <body> <section id="overlay"> - <img src="/public/assets/github_post_logo.jpg" alt="Github Logo" id="logo"> + <img src="/public/assets/Logo.png" alt="Kicau Logo" id="logo"> <hr> - <form action="submission.php" method="POST"> + <form action="create" method="POST"> <h1>Create a post!</h1> <section class="text-input"> <label for="textarea-input">Type in the box below:</label> @@ -22,21 +22,11 @@ </section> <br> - <section class="image"> - <label for="image-input">Select an image file:</label> - <input type="file" id="image-input" name="image-input"> + <section class="file"> + <label for="file-input">Select a file:</label> + <input type="file" id="file-input" name="image-input"> </section> <hr> - <section class="video"> - <label for="video-input">Select a video file:</label> - <input type="file" id="video-input" name="video-input"> - </section> - <hr> - <section class="audio"> - <label for="audio-input">Select an audio file:</label> - <input type="file" id="audio-input" name="audio-input"> - </section> - <br> <section class="submission"> <input type="submit" value="Post"> diff --git a/src/app/view/submission.php b/src/app/view/submission.php index a5447c4abeb4491ee0b7536db27bd54124f4242f..e576f7ec2067c3f12005434e153f7958b631fe3c 100644 --- a/src/app/view/submission.php +++ b/src/app/view/submission.php @@ -3,14 +3,14 @@ <head> <meta charset="utf-8"> - <link rel="stylesheet" type="text/css" href="public/css/post.css"> + <link rel="stylesheet" type="text/css" href="/public/css/post.css"> <link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet"> <title>Post Review</title> </head> <body> <section id="overlay"> - <img src="public/assets/github_post_logo.jpg" alt="Github Logo" id="logo"> + <img src="/public/assets/github_post_logo.jpg" alt="Github Logo" id="logo"> <hr> <h1>You have made a new post!</h1> </section>