defined new CI routes to differentiate between 5 cases CI doesnt handle anymore but vue router does; define Stundenplan/:lv_id? route for old links to redirect to new route Stundenplan/:mode/:focus_date/lv_id; new route with props route param handling to put them into viewData to always check for the same object; define day as allowed init mode; WIP same thing for raum calendar page;

This commit is contained in:
Johann Hoffmann
2025-02-18 10:18:39 +01:00
parent f6f06c4d5e
commit d45a41b949
6 changed files with 143 additions and 22 deletions
+10 -1
View File
@@ -23,9 +23,18 @@ class Stundenplan extends Auth_Controller
/**
* @return void
*/
public function index($lv_id = null)
public function index($mode = 'Week', $focus_date = null, $lv_id = null)
{
// Convert string "null" to actual null values -> ci3 reroute fix
$mode = ($mode === 'null') ? 'Week' : ucfirst(strtolower($mode));
$focus_date = ($focus_date === 'null') ? date('Y-m-d') : $focus_date;
$lv_id = ($lv_id === 'null') ? null : $lv_id;
if($mode) $mode = ucfirst(strtolower($mode));
$viewData = array(
'mode' => $mode,
'focus_date' => $focus_date,
'lv_id' => $lv_id,
'uid'=>getAuthUID(),
);