Skip to content
Snippets Groups Projects
Commit b3bed062 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

remove configuration MY_COURSES_ALLOW_TILED_DISPLAY, fixes #1654

Closes #1654

Merge request studip/studip!1065
parent 66308dbc
No related branches found
No related tags found
No related merge requests found
......@@ -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';
......
<?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);
}
}
......@@ -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
......
const configMapping = {
allow_tiled_display: value => {
return {
MY_COURSES_ALLOW_TILED_DISPLAY: value,
}
},
display_type: value => {
return {
MY_COURSES_TILED_DISPLAY: value === 'tiles',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment