aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/my_courses.php28
-rw-r--r--db/migrations/5.3.4_remove_allow_tiled_display_configuration.php26
-rw-r--r--resources/vue/components/MyCourses.vue5
-rw-r--r--resources/vue/store/MyCoursesStore.js5
4 files changed, 39 insertions, 25 deletions
diff --git a/app/controllers/my_courses.php b/app/controllers/my_courses.php
index da32107..3071e8c 100644
--- a/app/controllers/my_courses.php
+++ b/app/controllers/my_courses.php
@@ -192,9 +192,8 @@ 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',
+ 'display_type' => $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY ? 'tiles' : 'tables',
+ 'responsive_type' => $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? 'tiles' : 'tables',
'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
'group_by' => $this->getGroupField(),
],
@@ -904,19 +903,16 @@ class MyCoursesController extends AuthenticatedController
$this->setGroupingSelector($group_field);
- if (Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY) {
- $views = $sidebar->addWidget(new ViewsWidget());
- $views->id = 'tiled-courses-sidebar-switch';
- $views->addLink(
- _('Tabellarische Ansicht'),
- '#'
- )->setActive(!$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
- $views->addLink(
- _('Kachelansicht'),
- '#'
- )->setActive($GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
-
- }
+ $views = $sidebar->addWidget(new ViewsWidget());
+ $views->id = 'tiled-courses-sidebar-switch';
+ $views->addLink(
+ _('Tabellarische Ansicht'),
+ '#tabular'
+ )->setActive(!$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
+ $views->addLink(
+ _('Kachelansicht'),
+ '#tiles'
+ )->setActive($GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
$options = $sidebar->addWidget(new OptionsWidget());
$options->id = 'tiled-courses-new-contents-toggle';
diff --git a/db/migrations/5.3.4_remove_allow_tiled_display_configuration.php b/db/migrations/5.3.4_remove_allow_tiled_display_configuration.php
new file mode 100644
index 0000000..6aa898a
--- /dev/null
+++ b/db/migrations/5.3.4_remove_allow_tiled_display_configuration.php
@@ -0,0 +1,26 @@
+<?php
+final class RemoveAllowTiledDisplayConfiguration extends Migration
+{
+ protected function up()
+ {
+ $query = "DELETE config, config_values
+ FROM `config`
+ LEFT JOIN `config_values` USING(`field`)
+ WHERE `field` = 'MY_COURSES_ALLOW_TILED_DISPLAY'";
+ DBManager::get()->exec($query);
+ }
+
+ protected function down()
+ {
+ $query = "INSERT IGNORE INTO `config` (
+ `field`, `value`, `type`, `range`,
+ `section`, `description`,
+ `mkdate`, `chdate`
+ ) VALUES (
+ 'MY_COURSES_ALLOW_TILED_DISPLAY', '0', 'boolean', 'global',
+ 'MeineVeranstaltungen', 'Soll die Kachelansicht unter \"Meine Veranstaltungen\" aktiviert werden?',
+ UNIX_TIMESTAMP(), UNIX_TIMESTAMP()
+ )";
+ DBManager::get()->exec($query);
+ }
+}
diff --git a/resources/vue/components/MyCourses.vue b/resources/vue/components/MyCourses.vue
index c458f22..3e99ad7 100644
--- a/resources/vue/components/MyCourses.vue
+++ b/resources/vue/components/MyCourses.vue
@@ -21,7 +21,7 @@
</studip-message-box>
<component v-else :is="displayComponent" :icon-size="iconSize"></component>
- <MountingPortal v-if="allowTiled" mount-to="#tiled-courses-sidebar-switch .sidebar-widget-content .widget-list" name="sidebar-switch">
+ <MountingPortal mount-to="#tiled-courses-sidebar-switch .sidebar-widget-content .widget-list" name="sidebar-switch">
<my-courses-sidebar-switch></my-courses-sidebar-switch>
</MountingPortal>
@@ -49,9 +49,6 @@ export default {
MyCoursesNewContentToggle,
},
computed: {
- allowTiled () {
- return this.getConfig('allow_tiled_display');
- },
displayComponent () {
return this.displayedType === 'tiles'
? MyCoursesTiles
diff --git a/resources/vue/store/MyCoursesStore.js b/resources/vue/store/MyCoursesStore.js
index a2aa2cd..a090040 100644
--- a/resources/vue/store/MyCoursesStore.js
+++ b/resources/vue/store/MyCoursesStore.js
@@ -1,9 +1,4 @@
const configMapping = {
- allow_tiled_display: value => {
- return {
- MY_COURSES_ALLOW_TILED_DISPLAY: value,
- }
- },
display_type: value => {
return {
MY_COURSES_TILED_DISPLAY: value === 'tiles',