From d51a95a8a09dcadbbd11393135206f4513696ca6 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 24 Nov 2022 11:48:46 +0100 Subject: [PATCH] test controller & views --- application/controllers/Test.php | 63 ++++++++++++++++++++++++++++++++ application/views/test/Admin.php | 32 ++++++++++++++++ application/views/test/Test.php | 32 ++++++++++++++++ public/js/apps/Test.js | 19 ++++++++++ 4 files changed, 146 insertions(+) create mode 100644 application/controllers/Test.php create mode 100644 application/views/test/Admin.php create mode 100644 application/views/test/Test.php create mode 100644 public/js/apps/Test.js diff --git a/application/controllers/Test.php b/application/controllers/Test.php new file mode 100644 index 000000000..497f12f85 --- /dev/null +++ b/application/controllers/Test.php @@ -0,0 +1,63 @@ + 'dashboard/benutzer:r', + 'db' => 'dashboard/benutzer:r', + 'admin' => 'dashboard/admin:r', + ) + ); + + $this->load->library('AuthLib'); + + $this->_setAuthUID(); // sets property uid + + $this->setControllerId(); // sets the controller id + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + public function index() + { + $this->load->view('test/Test.php', ['dashboard' => 'CIS']); + } + + // Public methods + public function db($dashboard) + { + $this->load->view('test/Test.php', ['dashboard' => $dashboard]); + } + + public function admin() + { + $this->load->view('test/Admin.php', []); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Private methods + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + +} diff --git a/application/views/test/Admin.php b/application/views/test/Admin.php new file mode 100644 index 000000000..837f6411b --- /dev/null +++ b/application/views/test/Admin.php @@ -0,0 +1,32 @@ +load->view('templates/FHC-Header', + array( + 'title' => 'FH-Complete', + 'bootstrap5' => true, + 'fontawesome6' => true, + 'axios027' => true, + 'restclient' => true, + 'vue3' => true, + 'customJSModules' => ['public/js/apps/Test.js'], + 'customCSSs' => [ + 'public/css/components/dashboard.css' + ], + 'navigationcomponent' => true + ) +); +?> + +
+ + +
+
+

Dashboard

+
+ + + +
+
+ +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/test/Test.php b/application/views/test/Test.php new file mode 100644 index 000000000..d297bf4ec --- /dev/null +++ b/application/views/test/Test.php @@ -0,0 +1,32 @@ +load->view('templates/FHC-Header', + array( + 'title' => 'FH-Complete', + 'bootstrap5' => true, + 'fontawesome6' => true, + 'axios027' => true, + 'restclient' => true, + 'vue3' => true, + 'customJSModules' => ['public/js/apps/Test.js'], + 'customCSSs' => [ + 'public/css/components/dashboard.css' + ], + 'navigationcomponent' => true + ) +); +?> + +
+ + +
+
+

Dashboard

+
+ + + +
+
+ +load->view('templates/FHC-Footer'); ?> diff --git a/public/js/apps/Test.js b/public/js/apps/Test.js new file mode 100644 index 000000000..cdf3e78f3 --- /dev/null +++ b/public/js/apps/Test.js @@ -0,0 +1,19 @@ +import {CoreNavigationCmpt} from '../components/navigation/Navigation.js'; +import CoreDashboard from '../components/Dashboard/Dashboard.js'; +import DashboardAdmin from '../components/Dashboard/Admin.js'; + +Vue.createApp({ + data: () => ({ + appSideMenuEntries: {} + }), + components: { + CoreNavigationCmpt, + DashboardAdmin, + CoreDashboard/*, + "CoreFilterCmpt": CoreFilterCmpt, + "verticalsplit": verticalsplit, + "searchbar": searchbar*/ + }, + mounted() { + } +}).mount('#main');