Commit 5ef293e1 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make all pages that show a view respect the view theme.

parent f80a262a
......@@ -65,15 +65,25 @@ if (!$view || !can_view_view($view->get('id'))) {
throw new AccessDeniedException(get_string('youcannotviewthisusersprofile'));
}
// Set up theme
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
}
$stylesheets = array(
// Basic structure CSS
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/views.css">',
// Extra CSS for the view theme
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/' . $basetheme . '/viewthemes/' . $viewtheme . '/views.css">',
);
$name = display_name($user);
define('TITLE', $name);
$smarty = smarty(
array('lib/pieforms/static/core/pieforms.js'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
array(),
array(
'stylesheets' => array('style/views.css'),
)
$stylesheets
);
$sql = "SELECT g.*, a.type FROM {group} g JOIN (
......
......@@ -115,17 +115,30 @@ if ($category === '') {
$view->process_changes($category, $new);
$extraconfig = array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
// Set up theme
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
}
$stylesheets = array(
// Basic structure CSS
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/views.css">',
// Extra CSS for the view theme
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/' . $basetheme . '/viewthemes/' . $viewtheme . '/views.css">',
);
$stylesheets = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">');
foreach ($THEME->get_url('style/style.css', true, 'artefact/file') as $sheet) {
$stylesheets[] = '<link rel="stylesheet" type="text/css" href="' . $sheet . '">';
}
$smarty = smarty(array('views', 'tinytinymce', 'paginator', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js'), $stylesheets, false, $extraconfig);
$smarty = smarty(
array('views', 'tinytinymce', 'paginator', 'tablerenderer', 'artefact/file/js/filebrowser.js', 'lib/pieforms/static/core/pieforms.js'),
$stylesheets,
false,
array('sidebars' => false)
);
// The list of categories for the tabbed interface
$smarty->assign('category_list', $view->build_category_list($category, $new));
......@@ -133,6 +146,9 @@ $smarty->assign('category_list', $view->build_category_list($category, $new));
// The list of blocktypes for the default category
$smarty->assign('blocktype_list', $view->build_blocktype_list($category));
$smarty->assign('viewtheme', "$basetheme/$viewtheme");
$smarty->assign('viewthemes', View::get_viewthemes());
// Tell smarty we're editing rather than just rendering
$smarty->assign('editing', true);
......
......@@ -127,15 +127,25 @@ if ($USER->is_logged_in()) {
$objectionform = pieform(objection_form());
}
// Set up theme
list($basetheme, $viewtheme) = $view->get_theme();
if ($THEME->basename != $basetheme) {
$THEME = new Theme($basetheme);
}
$stylesheets = array(
// Basic structure CSS
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/views.css">',
// Extra CSS for the view theme
'<link rel="stylesheet" type="text/css" href="'
. get_config('wwwroot') . 'theme/' . $basetheme . '/viewthemes/' . $viewtheme . '/views.css">',
);
$smarty = smarty(
array('mahara', 'tablerenderer', 'feedbacklist', 'artefact/resume/resumeshowhide.js'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
$stylesheets,
array(),
array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
)
array('sidebars' => false)
);
$smarty->assign('INLINEJAVASCRIPT', $javascript);
......
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