Commit 3862fa16 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic

Bug 1746346: add skin to profile&dashboard pages

fixed for Dashboard page to show the skin

behatnotneeded

Change-Id: I8720025e854d60c03980f5857786ce8171fe7db1
parent f3d614cb
......@@ -38,6 +38,15 @@ if ($USER->is_logged_in()) {
$stylesheets = array();
$stylesheets = array_merge($stylesheets, $view->get_all_blocktype_css());
// Set up skin, if the page has one
$viewskin = $view->get('skin');
if ($viewskin && get_config('skins') && can_use_skins($view->get('owner'), false, false) && (!isset($THEME->skins) || $THEME->skins !== false)) {
$skin = array('skinid' => $viewskin, 'viewid' => $view->get('id'));
}
else {
$skin = false;
}
// include slimbox2 js and css files, if it is enabled...
if (get_config_plugin('blocktype', 'gallery', 'useslimbox2')) {
$langdir = (get_string('thisdirection', 'langconfig') == 'rtl' ? '-rtl' : '');
......@@ -53,6 +62,7 @@ if ($USER->is_logged_in()) {
array(),
array(
'stylesheets' => array('style/views.css'),
'skin' => $skin,
)
);
......
......@@ -3,7 +3,7 @@
href="{$WWWROOT}view/editlayout.php?id={$viewid}"
title="{if $edittitle}{str tag=settings section=view}{else}{str tag=editlayout section=view}{/if}">
<span class="icon icon-lg icon-cogs"></span>
<span class="btn-title">{if $edittitle}{str tag=settings section=view}{else}{str tag=editlayout section=view}{/if}</span>
<span class="btn-title">{if ($edittitle || $canuseskins) }{str tag=settings section=view}{else}{str tag=editlayout section=view}{/if}</span>
</a>
<a class="btn btn-default editviews editcontent {if $selected == 'content'}active{/if}" href="{$WWWROOT}view/blocks.php?id={$viewid}" title="{str tag=editcontent1 section=view}">
<span class="icon icon-lg icon-pencil" aria-hidden="true" role="presentation"></span>
......
......@@ -123,6 +123,11 @@ foreach (array_reverse($THEME->get_url('style/style.css', true, 'artefact/file')
$stylesheets[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number($sheet) . '">';
}
$issiteview = $view->get('institution') == 'mahara';
$issitetemplate = ($view->get('template') == View::SITE_TEMPLATE ? true : false);
$canedittitle = $view->can_edit_title();
$canuseskins = !$issitetemplate && can_use_skins(null, false, $issiteview);
$stylesheets = array_merge($stylesheets, $view->get_all_blocktype_css());
// Tell the user to change the view theme if the current one is no
// longer available to them.
......@@ -240,7 +245,8 @@ foreach (array_keys($_POST + $_GET) as $key) {
$viewid = $view->get('id');
$displaylink = $view->get_url();
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('edittitle', $canedittitle);
$smarty->assign('canuseskins', $canuseskins);
$smarty->assign('displaylink', $displaylink);
$smarty->assign('formurl', get_config('wwwroot') . 'view/blocks.php');
$smarty->assign('category', $category);
......
......@@ -63,7 +63,10 @@ if (!$USER->can_edit_view($view)) {
throw new AccessDeniedException();
}
$caneditonlylayout = !$view->can_edit_title();
$issiteview = $view->get('institution') == 'mahara';
$issitetemplate = ($view->get('template') == View::SITE_TEMPLATE ? true : false);
$canedittitle = $view->can_edit_title();
$canuseskins = !$issitetemplate && can_use_skins(null, false, $issiteview);
// If the view has been submitted, disallow editing
if ($view->is_submitted()) {
......@@ -112,20 +115,18 @@ $smarty->assign('form', $form);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtype', $view->get('type'));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('edittitle', $canedittitle);
$smarty->assign('canuseskins', $canuseskins);
$smarty->assign('displaylink', $view->get_url());
$smarty->assign('issiteview', $view->get('institution') == 'mahara');
$smarty->assign('issitetemplate', ($view->get('template') == View::SITE_TEMPLATE ? true : false));
$smarty->assign('issiteview', $issiteview);
$smarty->assign('issitetemplate', $issitetemplate);
$smarty->assign('PAGEHEADING', $state);
$smarty->display('view/editlayout.tpl');
function create_settings_pieform(){
global $view, $pieformname, $caneditonlylayout;
global $view, $pieformname, $issiteview, $issitetemplate,
$canedittitle, $canuseskins;
$inlinejavascript = '';
$issiteview = $view->get('institution') == 'mahara';
$issitetemplate = ($view->get('template') == View::SITE_TEMPLATE ? true : false);
$canedittitle = !$caneditonlylayout;
$canuseskins = !$issitetemplate && can_use_skins(null, false, $issiteview) && !$caneditonlylayout;
//get elements for each section of the form
if ($canedittitle) {
......@@ -523,10 +524,7 @@ JAVASCRIPT;
}
function settings_validate(Pieform $form, $values) {
global $view, $caneditonlylayout;
$issiteview = $view->get('institution') == 'mahara';
$issitetemplate = ($view->get('template') == View::SITE_TEMPLATE ? true : false);
$canuseskins = !$issitetemplate && can_use_skins(null, false, $issiteview) && !$caneditonlylayout;
global $view, $issiteview, $issitetemplate, $canuseskins;
$layoutrows = $view->get_layoutrows();
if (!isset($layoutrows[$values['currentlayoutselect']]) ) {
......@@ -554,11 +552,7 @@ function settings_validate(Pieform $form, $values) {
}
function settings_submit(Pieform $form, $values) {
global $view, $SESSION, $caneditonlylayout;
$issiteview = $view->get('institution') == 'mahara';
$issitetemplate = ($view->get('template') == View::SITE_TEMPLATE ? true : false);
$canedittitle = !$caneditonlylayout;
$canuseskins = !$issitetemplate && can_use_skins(null, false, $issiteview) && !$caneditonlylayout;
global $view, $SESSION, $issiteview, $issitetemplate, $canedittitle, $canuseskins;
if ($canedittitle) {
set_view_title_and_description($form, $values);
......
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