From 1f04b83be337cc91a3fabcf4e574e2306f3d2eaa Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 30 Mar 2024 12:14:42 -0400 Subject: refactor --- web/core/_model.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 web/core/_model.php (limited to 'web/core/_model.php') diff --git a/web/core/_model.php b/web/core/_model.php new file mode 100644 index 0000000..936fab4 --- /dev/null +++ b/web/core/_model.php @@ -0,0 +1,44 @@ +load = $load; + $this->main = $this->load->model('main'); + $this->db = $this->main->db; + $this->config = new Aesthetic(); + } + + /** + * @returns the base model data + */ + public function get_data(): array { + $data = array(); + $data['self'] = $this->main->user(); + + $info = $this->main->info; + $app = $info['app']; + + if ($app) { + $files = $this->config->get_files($app); + $data = array_merge($data, $files); + } else { + $files = $this->config->get_files(); + $data = array_merge($data, $files); + } + + return $data; + } +} -- cgit v1.2.3-freya