Commit a0d455b0 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

Don't display the theme controls for views which don't respect theming (Fixes #619284).


Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 8ccb18bb
......@@ -3142,6 +3142,17 @@ class View {
),
);
}
/**
* Determine whether the current view is of a type which can be themed.
* Certain view types do not respect themes when displayed.
*
* @return boolean whether the view type may be themed
*/
function is_themeable() {
$unthemable_types = array('grouphomepage', 'dashboard');
return !in_array($this->type, $unthemable_types);
}
}
......
......@@ -239,7 +239,8 @@ $smarty->assign('groupid', $group);
$smarty->assign('institution', $institution);
$smarty->assign('can_change_layout', (!$USER->get_account_preference('addremovecolumns') || ($view->get('numcolumns') > 1 && $view->get('numcolumns') < 5)));
if (get_config('userscanchooseviewthemes')) {
if (get_config('userscanchooseviewthemes')
&& $view->is_themeable()) {
$smarty->assign('viewtheme', $viewtheme);
$smarty->assign('viewthemes', $allowedthemes);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment