Commit c697f516 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Allow skins to show on profile page (Bug #1419951)"

parents 56b9fc14 20fd1902
......@@ -269,6 +269,18 @@ if ($userid != $USER->get('id') && $USER->is_admin_for_user($user) && is_null($U
} else {
$loginas = null;
}
// Set up skin, if the page has one
$viewskin = $view->get('skin');
$owner = $view->get('owner');
$issiteview = $view->get('institution') == 'mahara';
if ($viewskin && get_config('skins') && can_use_skins($owner, false, $issiteview) && (!isset($THEME->skins) || $THEME->skins !== false)) {
$skin = array('skinid' => $viewskin, 'viewid' => $view->get('id'));
$skindata = unserialize(get_field('skin', 'viewskin', 'id', $viewskin));
}
else {
$skin = false;
}
$smarty = smarty(
$javascript,
$stylesheets,
......@@ -276,6 +288,7 @@ $smarty = smarty(
array(
'stylesheets' => array('style/views.css'),
'sidebars' => false,
'skin' => $skin
)
);
$smarty->assign('restrictedview', $restrictedview);
......@@ -322,6 +335,15 @@ if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
$smarty->assign('microheadertitle', $view->display_title(true, false));
$smarty->assign('maharalogofilename', 'images/site-logo-small.png');
// Support for normal, light, or dark small Mahara logo - to use with skins
if ($skin) {
if ($skindata['header_logo_image'] == 'light') {
$smarty->assign('maharalogofilename', 'images/site-logo-small-light.png');
}
else if ($skindata['header_logo_image'] == 'dark') {
$smarty->assign('maharalogofilename', 'images/site-logo-small-dark.png');
}
}
if ($loggedinid && $loggedinid == $userid) {
$microheaderlinks = array(
array(
......@@ -337,6 +359,13 @@ else {
$smarty->assign('ownprofile', true);
}
$smarty->assign('pageheadinghtml', $view->display_title(false));
if ($skin) {
if ($skindata['header_logo_image'] == 'light' || $skindata['header_logo_image'] == 'dark') {
// override the default $smarty->assign('sitelogo') that happens
// in the initial call to smarty()
$smarty->assign('sitelogo', $THEME->header_logo($skindata['header_logo_image']));
}
}
}
if (!$restrictedview) {
......
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