diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-22 10:31:47 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-22 10:31:47 +0000 |
| commit | 1380d8e444d5961ecacd95dcb9dda6443da65acf (patch) | |
| tree | 2d2754455b5d3e72a79e5368b37c4ea8c222ce07 /lib/modules | |
| parent | 0b8be44713be358c3b2854eaf44964dcbc66ba2b (diff) | |
fix my courses portal widget, re #4301, fixes #4728
Closes #4728
Merge request studip/studip!3524
Diffstat (limited to 'lib/modules')
| -rw-r--r-- | lib/modules/MyCoursesWidget.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/modules/MyCoursesWidget.php b/lib/modules/MyCoursesWidget.php index ba73e5b..f4f2939 100644 --- a/lib/modules/MyCoursesWidget.php +++ b/lib/modules/MyCoursesWidget.php @@ -27,11 +27,13 @@ class MyCoursesWidget extends CorePlugin implements PortalPlugin { // get the MyCoursesController in order to prepare the correct data for the overview $controller = app(MyCoursesController::class, ['dispatcher' => app(\Trails\Dispatcher::class)]); - $data = $controller->getPortalWidgetData(); - // add the json data to the head so vue can grab it - PageLayout::addHeadElement('script', [], 'STUDIP.MyCoursesData = ' . json_encode($data) . ';'); - - return $GLOBALS['template_factory']->open('start/my_courses'); + return Studip\VueApp::create('MyCourses') + ->withStore( + 'MyCoursesStore', + 'mycourses', + $controller->getPortalWidgetData() + ) + ->getTemplate(); } } |
