summaryrefslogtreecommitdiff
path: root/src/web/_controller/_modal.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/web/_controller/_modal.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/web/_controller/_modal.php b/src/web/_controller/_modal.php
new file mode 100644
index 0000000..0447ca8
--- /dev/null
+++ b/src/web/_controller/_modal.php
@@ -0,0 +1,28 @@
+<?php /* Copyright (c) 2024 Freya Murphy */
+class _modal_controller extends XSS_Controller {
+
+ /**
+ * @param string $name
+ * @param array $data
+ */
+ private function modal($name): void {
+ $data = $this->model->get_data();
+ $data['title'] = ucwords(lang($name . '_modal_title'));
+ $data['content'] = $name;
+ $this->view('_template/modal', $data);
+ }
+
+ public function new_post(): void {
+ $this->load_lang('post');
+ $this->modal('new_post');
+ }
+
+ public function about(): void {
+ $this->modal('about');
+ }
+
+ public function register(): void {
+ $this->load_lang('auth');
+ $this->modal('register');
+ }
+}