diff --git a/application/config/navigation.php b/application/config/navigation.php index d57cd697a..2327513ad 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -1,6 +1,12 @@ array( 'fhcomplete' => array( @@ -50,7 +56,7 @@ $config['navigation_header'] = array( 'requiredPermissions' => 'basis/vilesci:r', 'children' => array( 'cis' => array( - 'link' => CIS_ROOT, + 'link' => $root, 'icon' => '', 'description' => 'CIS', 'sort' => 10 @@ -223,7 +229,7 @@ $config['navigation_menu']['organisation/Reihungstest/index'] = array( 'target' => '_blank' ), 'auswertung' => array( - 'link' => CIS_ROOT.'/cis/testtool/admin/auswertung.php', + 'link' => $root.'/cis/testtool/admin/auswertung.php', 'description' => 'Auswertung', 'icon' => 'list-alt', 'sort' => 1, @@ -319,5 +325,4 @@ $config['navigation_menu']['system/issues/Issues/*'] = array( 'target' => '_blank', 'requiredPermissions' => array('admin:rw') ), -); - +); \ No newline at end of file diff --git a/application/controllers/Cis4.php b/application/controllers/Cis4.php index e2b49c388..5b3f67403 100644 --- a/application/controllers/Cis4.php +++ b/application/controllers/Cis4.php @@ -34,6 +34,7 @@ class Cis4 extends FHC_Controller show_error("name couldn't be loaded for username ".getAuthUID()); } $begruesung = getData($begruesung); + $this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]); } -} +} \ No newline at end of file diff --git a/application/controllers/CisVue/Dashboard.php b/application/controllers/CisVue/Dashboard.php index ec58c6735..94af6531b 100644 --- a/application/controllers/CisVue/Dashboard.php +++ b/application/controllers/CisVue/Dashboard.php @@ -27,6 +27,15 @@ class Dashboard extends Auth_Controller */ public function index() { - $this->load->view('CisVue/Dashboard.php'); + + $this->load->model('person/Person_model','PersonModel'); + $begruesung = $this->PersonModel->getFirstName(getAuthUID()); + if(isError($begruesung)) + { + show_error("name couldn't be loaded for username ".getAuthUID()); + } + $begruesung = getData($begruesung); + $this->load->view('CisVue/Dashboard.php',["name"=> $begruesung]); + } -} +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/Phrasen.php b/application/controllers/api/frontend/v1/Phrasen.php index 472308d2b..317f515e0 100644 --- a/application/controllers/api/frontend/v1/Phrasen.php +++ b/application/controllers/api/frontend/v1/Phrasen.php @@ -28,8 +28,11 @@ class Phrasen extends FHCAPI_Controller public function __construct() { parent::__construct([ - 'loadModule' => self::PERM_ANONYMOUS + 'loadModule' => self::PERM_ANONYMOUS, + 'setLanguage' => self::PERM_ANONYMOUS ]); + + $this->load->helper('hlp_language'); } //------------------------------------------------------------------------------------------------------------------ @@ -43,4 +46,18 @@ class Phrasen extends FHCAPI_Controller $this->load->library('PhrasesLib', [$module], 'pj'); $this->terminateWithSuccess(json_decode($this->pj->getJSON())); } -} + + public function setLanguage() + { + $postParams = $this->getPostJSON(); + $language = $postParams->language; + $categories = $postParams->categories; + + setUserLanguage($language); + + $this->load->library('PhrasesLib', array($categories, $language), 'p'); + + $phrases = $this->p->setPhrases($categories, $language); + $this->terminateWithSuccess($phrases); + } +} \ No newline at end of file diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index dec3d54c0..ecd8094d6 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -200,6 +200,17 @@ class PhrasesLib return '<< PHRASE '.$phrase.' >>'; } + /** + * Workaround to reload the phrases array on an already constructed library. + * @parameters -> look for _setPhrases docs + */ + public function setPhrases($categories, $language) + { + if (count($categories) > 0) $this->_setPhrases($categories, $language); + + return $this->_phrases; + } + // ----------------------------------------------------------------------------------------------------------------- // Private methods @@ -319,6 +330,7 @@ class PhrasesLib { $this->_phrases = $phrases->retval; } + } /** @@ -329,4 +341,4 @@ class PhrasesLib { return json_encode($this->_phrases); } -} +} \ No newline at end of file diff --git a/application/views/templates/CISVUE-Header.php b/application/views/templates/CISVUE-Header.php index 692d73b86..732800cea 100644 --- a/application/views/templates/CISVUE-Header.php +++ b/application/views/templates/CISVUE-Header.php @@ -36,11 +36,13 @@ if (!isset($menu)) { logo-url="" avatar-url="" logout-url="" - :selectedtypes="selectedtypes" + at-flag-url="" + uk-flag-url="" + :selectedtypes="selectedtypes" :searchbaroptions="searchbaroptions" :searchfunction="searchfunction" :menu="" > -
+
\ No newline at end of file diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 60a3baccd..81e35e63e 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -218,12 +218,27 @@ html { max-height: calc(100vh - var(--fhc-cis-header-height)); } +#nav-user-menu img { + object-fit: cover; + height: calc( 3 * var(--fhc-cis-header-py)); +} + +#fhc-languages { + display: flex; + text-align: center; +} + +#fhc-languages .btn { + flex: 1; + display: flex; +} + /* desktop */ @media (min-width: 992px) { body { display: flex; padding-top: var(--fhc-cis-header-height); - width: 100vw; + width: 99vw; /* overflow: visible !important; */ } #cis-header { @@ -310,6 +325,22 @@ html { min-width: var(--fhc-cis-menu-width); background-color: var(--fhc-cis-menu-lvl-2-bg); } + + #nav-user-menu img { + object-fit: cover; + height: calc( 3 * var(--fhc-cis-header-py)); + } + + #fhc-languages { + display: flex; + text-align: center; + } + + #fhc-languages .btn { + flex: 1; + display: flex; + } + #nav-main-menu { height: 100%; background-color: var(--fhc-cis-menu-bg); diff --git a/public/images/icons/at.png b/public/images/icons/at.png new file mode 100644 index 000000000..5fb12554a Binary files /dev/null and b/public/images/icons/at.png differ diff --git a/public/images/icons/uk.png b/public/images/icons/uk.png new file mode 100644 index 000000000..2357ad975 Binary files /dev/null and b/public/images/icons/uk.png differ diff --git a/public/js/api/phrasen.js b/public/js/api/phrasen.js index 896641bcf..c5994ea9b 100644 --- a/public/js/api/phrasen.js +++ b/public/js/api/phrasen.js @@ -18,5 +18,9 @@ export default { loadCategory(category) { return this.$fhcApi.get('/api/frontend/v1/phrasen/loadModule/' + category); + }, + setLanguage(categories,language) { + const payload = {categories, language} + return this.$fhcApi.post('/api/frontend/v1/phrasen/setLanguage', payload); } -}; +}; \ No newline at end of file diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index b626df690..4e67a28cb 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -1,10 +1,11 @@ import FhcSearchbar from "../components/searchbar/searchbar.js"; import CisMenu from "../components/Cis/Menu.js"; - +import FhcApi from '../plugin/FhcApi.js'; +import Phrasen from '../plugin/Phrasen.js'; import fhcapifactory from "./api/fhcapifactory.js"; Vue.$fhcapi = fhcapifactory; -Vue.createApp({ +const app = Vue.createApp({ components: { FhcSearchbar, CisMenu @@ -90,4 +91,7 @@ Vue.createApp({ }, } -}).mount('#cis-header'); \ No newline at end of file +}); +app.use(FhcApi); +app.use(Phrasen); +app.mount('#cis-header'); \ No newline at end of file diff --git a/public/js/apps/Cis/Cms.js b/public/js/apps/Cis/Cms.js index a2f9691b3..e812c354f 100644 --- a/public/js/apps/Cis/Cms.js +++ b/public/js/apps/Cis/Cms.js @@ -35,6 +35,6 @@ const app = Vue.createApp({ }, }); app.use(primevue.config.default, { zIndex: { overlay: 9999 } }); -app.use(Phrasen); +app.use(Phrasen, {reload: true}); app.mount("#cms"); -//#cms [data-confirm], #cms [data-href] +//#cms [data-confirm], #cms [data-href] \ No newline at end of file diff --git a/public/js/apps/Cis/Documents.js b/public/js/apps/Cis/Documents.js index d484c06db..e5d1e8fad 100644 --- a/public/js/apps/Cis/Documents.js +++ b/public/js/apps/Cis/Documents.js @@ -1,12 +1,13 @@ -import Phrasen from '../../mixins/Phrasen.js'; +// import Phrasen from '../../mixins/Phrasen.js'; +import Phrasen from '../../plugin/Phrasen.js'; //import {TabulatorFull as Tabulator} from '../../../../vendor/olifolkerd/tabulator5/dist/js/tabulator_esm.min.js'; //import CssLib from '../../helpers/CssLib.js'; //CssLib.import('../../vendor/olifolkerd/tabulator5/dist/css/tabulator_bootstrap5.min.css'); const app = Vue.createApp({ - mixins: [ - Phrasen - ], + // mixins: [ + // Phrasen + // ], data() { return { inscriptiontable: null, @@ -90,4 +91,5 @@ const app = Vue.createApp({ }); } }); +app.use(Phrasen, {reload: true}); app.mount('#content'); \ No newline at end of file diff --git a/public/js/apps/Cis/MyLv/Student.js b/public/js/apps/Cis/MyLv/Student.js index ded0178fb..e0a13a728 100644 --- a/public/js/apps/Cis/MyLv/Student.js +++ b/public/js/apps/Cis/MyLv/Student.js @@ -5,4 +5,4 @@ Vue.createApp({ components: { MylvStudent } -}).use(Phrasen).mount('#content'); \ No newline at end of file +}).use(Phrasen, {reload: true}).mount('#content'); \ No newline at end of file diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 807f192d7..9ab22affa 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -109,5 +109,5 @@ const app = Vue.createApp({ ` }); app.config.unwrapInjectedRef = true; -app.use(Phrasen); +app.use(Phrasen, {reload: true}); app.mount('#content'); \ No newline at end of file diff --git a/public/js/apps/Dashboard.js b/public/js/apps/Dashboard.js index e56425a6d..039e7b901 100644 --- a/public/js/apps/Dashboard.js +++ b/public/js/apps/Dashboard.js @@ -1,7 +1,9 @@ import {CoreNavigationCmpt} from '../components/navigation/Navigation.js'; import CoreDashboard from '../components/Dashboard/Dashboard.js'; +import FhcApi from '../../plugin/FhcApi.js'; +import Phrasen from '../../plugin/Phrasen.js'; -Vue.createApp({ +const app = Vue.createApp({ data: () => ({ appSideMenuEntries: {} }), @@ -9,4 +11,7 @@ Vue.createApp({ CoreNavigationCmpt, CoreDashboard } -}).mount('#main'); +}) +app.use(FhcApi); +app.use(Phrasen); +app.mount('#main'); \ No newline at end of file diff --git a/public/js/apps/lehre/Antrag.js b/public/js/apps/lehre/Antrag.js index d0c8ab89a..179e810cc 100644 --- a/public/js/apps/lehre/Antrag.js +++ b/public/js/apps/lehre/Antrag.js @@ -20,5 +20,5 @@ const app = Vue.createApp({ } }); app - .use(Phrasen) - .mount('#wrapper'); + .use(Phrasen, {reload: true}) + .mount('#wrapper'); \ No newline at end of file diff --git a/public/js/components/Calendar/Header.js b/public/js/components/Calendar/Header.js index 663833aef..60c724162 100644 --- a/public/js/components/Calendar/Header.js +++ b/public/js/components/Calendar/Header.js @@ -5,7 +5,6 @@ export default { modes:{ week:"Woche", month:"Monat", - years:"Jahre", }, } }, @@ -44,9 +43,23 @@ export default { }, template: `
+ +
+
+
+ +
+
+
+
- -
+
+ +
+
- -
-
-
-
- -
+
+
` -} +} \ No newline at end of file diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index c226eba6a..a5d68bfbe 100644 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -12,6 +12,8 @@ export default { logoUrl: String, avatarUrl: String, logoutUrl: String, + atFlagUrl: String, + ukFlagUrl: String, selectedtypes: Array, searchbaroptions: Object, searchfunction: Function @@ -60,10 +62,14 @@ export default { setActiveEntry(content_id){ this.activeEntry = content_id; + }, + handleChangeLanguage(lang) { + this.$p.setLanguage(lang, this.$fhcApi) } }, mounted(){ this.entries = this.menu; + this.$p.loadCategory(['ui', 'global']) }, template: /*html*/`