summaryrefslogtreecommitdiff
path: root/src/web/_controller
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-05-20 17:11:38 -0400
committerFreya Murphy <freya@freyacat.org>2024-05-20 17:11:38 -0400
commit708594d32ffe779cf547c816fa7cdd19d095be2e (patch)
tree30d28553316db02bc027664e17b76d58f2e352ff /src/web/_controller
parentadd en_CAT makefile and use ucfirst/ucwords (diff)
downloadxssbook2-708594d32ffe779cf547c816fa7cdd19d095be2e.tar.gz
xssbook2-708594d32ffe779cf547c816fa7cdd19d095be2e.tar.bz2
xssbook2-708594d32ffe779cf547c816fa7cdd19d095be2e.zip
v2 done
Diffstat (limited to 'src/web/_controller')
-rw-r--r--src/web/_controller/apps/settings.php41
-rw-r--r--src/web/_controller/modal.php4
-rw-r--r--src/web/_controller/template.php3
3 files changed, 47 insertions, 1 deletions
diff --git a/src/web/_controller/apps/settings.php b/src/web/_controller/apps/settings.php
new file mode 100644
index 0000000..8a409cc
--- /dev/null
+++ b/src/web/_controller/apps/settings.php
@@ -0,0 +1,41 @@
+<?php /* Copyright (c) 2024 Freya Murphy */
+class Settings_controller extends Controller {
+
+ // the home model
+ private $settings_model;
+
+ // the format model
+ protected $format_model;
+
+ // the post controller
+ protected $post_controller;
+
+ // the people controller
+ protected $people_controller;
+
+ function __construct($load) {
+ parent::__construct($load);
+ $this->settings_model = $this->load->model('apps/settings');
+ }
+
+ public function index(): void {
+ if (!$this->main->session) {
+ $this->redirect('/auth/login');
+ }
+
+ parent::index();
+ $data = $this->settings_model->get_data();
+
+ if (!$data) {
+ $this->error(404);
+ }
+
+ $this->load->app_lang($this->main->info['lang'], 'auth');
+ $this->view('header', $data);
+ $this->view('apps/settings/main', $data);
+ $this->view('footer', $data);
+ }
+
+}
+
+?>
diff --git a/src/web/_controller/modal.php b/src/web/_controller/modal.php
index 40a2b42..da17cca 100644
--- a/src/web/_controller/modal.php
+++ b/src/web/_controller/modal.php
@@ -21,6 +21,10 @@ class Modal_controller extends Controller {
$this->modal('new_post');
}
+ public function about(): void {
+ $this->modal('about');
+ }
+
public function register(): void {
$this->load->app_lang(
$this->main->info['lang'],
diff --git a/src/web/_controller/template.php b/src/web/_controller/template.php
index 7a8cdf8..879eadc 100644
--- a/src/web/_controller/template.php
+++ b/src/web/_controller/template.php
@@ -13,7 +13,8 @@ class Template_controller extends Controller {
$data = array(
'msg' => $this->request_model->get_str('msg', FALSE),
'detail' => $this->request_model->get_str('detail', FALSE),
- 'hint' => $this->request_model->get_str('hint', FALSE)
+ 'hint' => $this->request_model->get_str('hint', FALSE),
+ 'type' => $this->request_model->get_str('type', 'error')
);
$this->view('template/toast', $data);
}