Skip to content
Snippets Groups Projects
Commit 1380d8e4 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix my courses portal widget, re #4301, fixes #4728

Closes #4728

Merge request studip/studip!3524
parent 0b8be447
No related branches found
No related tags found
No related merge requests found
...@@ -27,11 +27,13 @@ class MyCoursesWidget extends CorePlugin implements PortalPlugin ...@@ -27,11 +27,13 @@ class MyCoursesWidget extends CorePlugin implements PortalPlugin
{ {
// get the MyCoursesController in order to prepare the correct data for the overview // get the MyCoursesController in order to prepare the correct data for the overview
$controller = app(MyCoursesController::class, ['dispatcher' => app(\Trails\Dispatcher::class)]); $controller = app(MyCoursesController::class, ['dispatcher' => app(\Trails\Dispatcher::class)]);
$data = $controller->getPortalWidgetData();
// add the json data to the head so vue can grab it return Studip\VueApp::create('MyCourses')
PageLayout::addHeadElement('script', [], 'STUDIP.MyCoursesData = ' . json_encode($data) . ';'); ->withStore(
'MyCoursesStore',
return $GLOBALS['template_factory']->open('start/my_courses'); 'mycourses',
$controller->getPortalWidgetData()
)
->getTemplate();
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment