From ecbc6d8e3dda0c1ebfafd2948cb8440847e492bc Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 17 Oct 2022 13:37:08 +0200 Subject: [PATCH] Added Dashboard Controller & View --- .../controllers/dashboard/Dashboard.php | 55 +++++++++++++++++++ application/views/dashboard/dashboard.php | 31 +++++++++++ public/js/apps/Dashboard.js | 16 ++++++ 3 files changed, 102 insertions(+) create mode 100644 application/controllers/dashboard/Dashboard.php create mode 100644 application/views/dashboard/dashboard.php create mode 100644 public/js/apps/Dashboard.js diff --git a/application/controllers/dashboard/Dashboard.php b/application/controllers/dashboard/Dashboard.php new file mode 100644 index 000000000..2769bb8e5 --- /dev/null +++ b/application/controllers/dashboard/Dashboard.php @@ -0,0 +1,55 @@ + 'user:r', + ) + ); + + $this->load->library('AuthLib'); + $this->load->library('WidgetLib'); + + $this->_setAuthUID(); // sets property uid + + $this->setControllerId(); // sets the controller id + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + public function index() + { + $this->load->view('dashboard/dashboard.php', []); + } + // TODO löschen + public function test(){ + echo "
"; print_r('in Dashboard Test function'); echo "
"; + } + + // ----------------------------------------------------------------------------------------------------------------- + // 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/dashboard/dashboard.php b/application/views/dashboard/dashboard.php new file mode 100644 index 000000000..3518d769a --- /dev/null +++ b/application/views/dashboard/dashboard.php @@ -0,0 +1,31 @@ +load->view('templates/FHC-Header', + array( + 'title' => 'FH-Complete', + 'bootstrap5' => true, + 'fontawesome6' => true, + 'axios027' => true, + 'restclient' => true, + 'vue3' => true, + 'customJSModules' => ['public/js/apps/Dashboard.js'], + 'customCSSs' => [ + 'public/css/components/dashboard.css' + ], + 'navigationcomponent' => true + ) +); +?> + +
+ + + +
+
+

Dashboard

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