Commit 75434fad authored by Richard Mansfield's avatar Richard Mansfield
Browse files

More useful nav on view microheader; fix display of profile view title


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 4e0132ac
......@@ -535,17 +535,26 @@ div.rbuttons .small-logo {
/**************************** Top of page elements ****************************/
.viewheader {
padding: .5em;
padding: 0 .5em 0;
margin: 0 .25em 1px;
}
.viewheader .small-logo img {
margin: .5em;
vertical-align: top;
padding: 0;
}
.viewheader .lbuttons {
padding: .5em;
font-size: .9em;
margin-left: .5em;
.viewheader .nav {
float: right;
padding: 0 .5em .25em;
font-size: .9em;
}
.viewheader .links {
float: left;
padding: 0 .5em .25em;
font-size: .9em;
}
.viewheader .title {
border-top: 1px dotted #ddd;
padding: .5em 0 .25em;
}
.sitemessage {
background-color: #f99;
......
......@@ -43,4 +43,4 @@
</div>
</div>
</div>
{include file="footer.tpl"}
{include file="microfooter.tpl"}
{include file="viewmicroheader.tpl"}
{if $viewtype != 'profile'}
<h1>{if !$new}<a href="{$WWWROOT}view/view.php?id={$viewid}">{/if}{$viewtitle|escape}{if !$new}</a>{/if}</h1>
{/if}
<p id="view-description">{$viewdescription}</p>
......
......@@ -7,12 +7,21 @@
<div id="containerX">
<div id="loading-box"></div>
<div id="top-wrapper">
<div class="viewheader rel">
<div class="rbuttons">
<div class="viewheader">
<div class="nav">
{if $LOGGEDIN}
<a href="{$WWWROOT}user/view.php">{$userdisplayname|escape}</a>&nbsp;
{foreach from=$MAINNAV item=item}
{if $item.path}
<a href="{if get_config('httpswwwroot') && $item.url=='account/'}{$HTTPSWWWROOT}{else}{$WWWROOT}{/if}{$item.url|escape}">{$item.title|escape}</a>&nbsp;
{/if}
{/foreach}
{if $mnethost}<a href="{$mnethost.url}">{str tag=backto arg1=$mnethost.name}</a>&nbsp;{/if}
{/if}
<a class="small-logo" href="{$WWWROOT}"><img src="{theme_url filename='images/site-logo-small.png'}" alt="{$sitename|escape}"></a>
{if $mnethost}&nbsp;&nbsp;<a href="{$mnethost.url}">{str tag=backto arg1=$mnethost.name}</a>{/if}
</div>
<div class="lbuttons">
{if $LOGGEDIN}
<div class="links">
{if $backurl}<a class="btn-reply" href="{$backurl}">{str tag=back}</a>&nbsp;{/if}
{if $edit_profile || $viewtype == 'profile'}
<a href="{$WWWROOT}user/view.php">{str tag=viewmyprofilepage}</a>&nbsp;
......@@ -26,8 +35,9 @@
<a class="btn-edit" href="{$WWWROOT}view/blocks.php?id={$viewid}&amp;new={$new}">{str tag=edit}</a>
{/if}
</div>
<div class="center">
{if !$new}<a href="{$WWWROOT}view/view.php?id={$viewid}">{/if}{$viewtitle|escape}{if !$new}</a>{/if}{if $ownername} {str tag=by section=view} <a href="{$WWWROOT}{$ownerlink}">{$ownername|escape}</a>{/if}</div>
{/if}
<div class="center cb title">
<strong>{$viewtitle|escape}</strong>{if $ownername && $viewtype != 'profile'} {str tag=by section=view} <a href="{$WWWROOT}{$ownerlink}">{$ownername|escape}</a>{/if}</div>
</div>
</div>
<div id="main-wrapper">
......
......@@ -306,6 +306,7 @@ $smarty->assign('institutions', get_institution_string_for_user($userid));
$smarty->assign('canmessage', can_send_message($loggedinid, $userid));
$smarty->assign('NAME',$name);
$smarty->assign('USERID', $userid);
$smarty->assign('userdisplayname', display_name($USER, null, true));
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', get_string('usersprofile', 'mahara', display_name($user, null, true)));
if ($loggedinid && $loggedinid == $userid) {
......
......@@ -79,7 +79,12 @@ if (param_variable('make_private_submit', null)) {
$group = $view->get('group');
$title = $view->get('title');
if ($view->get('type') == 'profile') {
$title = get_string('usersprofile', 'mahara', display_name($view->get('owner'), null, true));
}
else {
$title = $view->get('title');
}
define('TITLE', $title);
$submittedgroup = (int)$view->get('submittedgroup');
......@@ -168,7 +173,8 @@ EOF;
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('new', $new);
$smarty->assign('viewid', $viewid);
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('viewtitle', $title);
$smarty->assign('viewtype', $view->get('type'));
$smarty->assign('feedback', $feedback);
$owner = $view->get('owner');
......@@ -183,10 +189,13 @@ else if ($group) {
if ($can_edit) {
$smarty->assign('can_edit', 1);
}
if ($USER->is_logged_in() && !empty($_SERVER['HTTP_REFERER'])) {
$page = get_config('wwwroot') . 'view/view.php?id=' . $viewid . ($new ? '&new=1' : '');
if ($_SERVER['HTTP_REFERER'] != $page) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
if ($USER->is_logged_in()) {
$smarty->assign('userdisplayname', display_name($USER, null, true));
if (!empty($_SERVER['HTTP_REFERER'])) {
$page = get_config('wwwroot') . 'view/view.php?id=' . $viewid . ($new ? '&new=1' : '');
if ($_SERVER['HTTP_REFERER'] != $page) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
}
}
......
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