summaryrefslogtreecommitdiff
path: root/src/web/_controller/apps/settings.php
blob: 8a409cc831327998ac379ce02b9c5696bcfbc769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
	}

}

?>