Commit 4305eb0e authored by Richard Mansfield's avatar Richard Mansfield

Set view theme on edit title/layout pages

Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent f683507f
......@@ -1789,6 +1789,14 @@ class View {
}
}
public function set_user_theme() {
global $THEME;
if ($this->theme && $THEME->basename != $this->theme) {
$THEME = new Theme($this->theme);
}
return $this->theme;
}
/**
* This function formats a user's name
* according to their view preference
......
......@@ -137,11 +137,9 @@ $extraconfig = array(
);
// Set up theme
$viewtheme = $view->get('theme');
$viewtheme = $view->set_user_theme();
$allowedthemes = get_user_accessible_themes();
if ($viewtheme && $THEME->basename != $viewtheme) {
$THEME = new Theme($viewtheme);
}
// Pull in cross-theme view stylesheet and file stylesheets
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
......@@ -225,7 +223,6 @@ $smarty->assign('viewtype', $viewtype);
$smarty->assign('view', $view->get('id'));
$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')
&& $view->is_themeable()) {
......
......@@ -50,6 +50,7 @@ if ($view->is_submitted()) {
$group = $view->get('group');
$institution = $view->get('institution');
$view->set_edit_nav();
$view->set_user_theme();
$new = param_boolean('new', 0);
......
......@@ -43,6 +43,7 @@ $back = !$USER->get_account_preference('addremovecolumns');
$group = $view->get('group');
$institution = $view->get('institution');
$view->set_edit_nav();
$view->set_user_theme();
$goto = get_config('wwwroot') . 'view/blocks.php?id=' . $view->get('id');
if ($new) {
$goto .= '&new=1';
......
Markdown is supported
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