aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/my_courses.php
diff options
context:
space:
mode:
authorRon Lucke <lucke@elan-ev.de>2021-11-05 15:03:40 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2021-11-05 15:03:40 +0000
commitf652829c6b50d02a2f6e49aea7314968b7d608ba (patch)
tree7a8d9782f419e5f91441b408d810d31a1bc91ab4 /app/controllers/my_courses.php
parentd0d03433aed8eb5931dd1a9a1d367c3c2ea3e0c7 (diff)
Biest #254
Diffstat (limited to 'app/controllers/my_courses.php')
-rw-r--r--app/controllers/my_courses.php42
1 files changed, 11 insertions, 31 deletions
diff --git a/app/controllers/my_courses.php b/app/controllers/my_courses.php
index 96d6a67..8a4f472 100644
--- a/app/controllers/my_courses.php
+++ b/app/controllers/my_courses.php
@@ -189,6 +189,7 @@ class MyCoursesController extends AuthenticatedController
'allow_dozent_visibility' => Config::get()->ALLOW_DOZENT_VISIBILITY,
'open_groups' => $GLOBALS['user']->cfg->MY_COURSES_OPEN_GROUPS,
'sem_number' => Config::get()->IMPORTANT_SEMNUMBER,
+ 'allow_tiled_display' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY,
'display_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY ? 'tiles' : 'tables',
'responsive_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? 'tiles' : 'tables',
'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
@@ -764,28 +765,6 @@ class MyCoursesController extends AuthenticatedController
}
/**
- * Changes a config setting for the current use
- * @param string $config Config setting
- * @param bool $state State of setting
- */
- public function config_action($config, $state = null)
- {
- if ($config === 'tiled') {
- if ($state === null) {
- $state = !$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY;
- }
- $GLOBALS['user']->cfg->store('MY_COURSES_TILED_DISPLAY', (bool) $state);
- } elseif ($config === 'new') {
- if ($state === null) {
- $state = !$GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY;
- }
- $GLOBALS['user']->cfg->store('MY_COURSES_SHOW_NEW_ICONS_ONLY', (bool) $state);
- }
-
- $this->redirect('my_courses');
- }
-
- /**
* Get widget for grouping selected courses (e.g. by colors, ...)
* @param $action
* @param bool $selected
@@ -927,22 +906,23 @@ class MyCoursesController extends AuthenticatedController
$views->id = 'tiled-courses-sidebar-switch';
$views->addLink(
_('Tabellarische Ansicht'),
- $this->config('tiled', 0)
+ '#'
)->setActive(!$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
$views->addLink(
_('Kachelansicht'),
- $this->config('tiled', 1)
+ '#'
)->setActive($GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
- $options = $sidebar->addWidget(new OptionsWidget());
- $options->id = 'tiled-courses-new-contents-toggle';
- $options->addCheckbox(
- _('Nur neue Inhalte anzeigen'),
- $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
- $this->config('new')
- );
}
+ $options = $sidebar->addWidget(new OptionsWidget());
+ $options->id = 'tiled-courses-new-contents-toggle';
+ $options->addCheckbox(
+ _('Nur neue Inhalte anzeigen'),
+ $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
+ '#'
+ );
+
$export_widget = $sidebar->addWidget(new ExportWidget());
$export_widget->addLink(
_('Veranstaltungsübersicht exportieren'),