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 ...@@ -192,9 +192,8 @@ class MyCoursesController extends AuthenticatedController
'allow_dozent_visibility' => Config::get()->ALLOW_DOZENT_VISIBILITY, 'allow_dozent_visibility' => Config::get()->ALLOW_DOZENT_VISIBILITY,
'open_groups' => $GLOBALS['user']->cfg->MY_COURSES_OPEN_GROUPS, 'open_groups' => $GLOBALS['user']->cfg->MY_COURSES_OPEN_GROUPS,
'sem_number' => Config::get()->IMPORTANT_SEMNUMBER, 'sem_number' => Config::get()->IMPORTANT_SEMNUMBER,
'allow_tiled_display' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY, 'display_type' => $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY ? 'tiles' : 'tables',
'display_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY ? 'tiles' : 'tables', 'responsive_type' => $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? '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, 'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
'group_by' => $this->getGroupField(), 'group_by' => $this->getGroupField(),
], ],
...@@ -904,19 +903,16 @@ class MyCoursesController extends AuthenticatedController ...@@ -904,19 +903,16 @@ class MyCoursesController extends AuthenticatedController
$this->setGroupingSelector($group_field); $this->setGroupingSelector($group_field);
if (Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY) { $views = $sidebar->addWidget(new ViewsWidget());
$views = $sidebar->addWidget(new ViewsWidget()); $views->id = 'tiled-courses-sidebar-switch';
$views->id = 'tiled-courses-sidebar-switch'; $views->addLink(
$views->addLink( _('Tabellarische Ansicht'),
_('Tabellarische Ansicht'), '#tabular'
'#' )->setActive(!$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
)->setActive(!$GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY); $views->addLink(
$views->addLink( _('Kachelansicht'),
_('Kachelansicht'), '#tiles'
'#' )->setActive($GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
)->setActive($GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY);
}
$options = $sidebar->addWidget(new OptionsWidget()); $options = $sidebar->addWidget(new OptionsWidget());
$options->id = 'tiled-courses-new-contents-toggle'; $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 @@ ...@@ -21,7 +21,7 @@
</studip-message-box> </studip-message-box>
<component v-else :is="displayComponent" :icon-size="iconSize"></component> <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> <my-courses-sidebar-switch></my-courses-sidebar-switch>
</MountingPortal> </MountingPortal>
...@@ -49,9 +49,6 @@ export default { ...@@ -49,9 +49,6 @@ export default {
MyCoursesNewContentToggle, MyCoursesNewContentToggle,
}, },
computed: { computed: {
allowTiled () {
return this.getConfig('allow_tiled_display');
},
displayComponent () { displayComponent () {
return this.displayedType === 'tiles' return this.displayedType === 'tiles'
? MyCoursesTiles ? MyCoursesTiles
......
const configMapping = { const configMapping = {
allow_tiled_display: value => {
return {
MY_COURSES_ALLOW_TILED_DISPLAY: value,
}
},
display_type: value => { display_type: value => {
return { return {
MY_COURSES_TILED_DISPLAY: value === 'tiles', 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