Commit 51a0dd57 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Fix artefact title display (bug: 1465107)"

parents 4a1a5558 94130a88
......@@ -38,6 +38,7 @@ if (!$artefact->in_view_list()) {
// Build the path to the artefact through its parents.
$artefactpath = array();
// Reverse the order of ancestors so we can get $baseobject by working backwards through the ancestors
$ancestors = array_reverse($artefact->get_item_ancestors());
$artefactok = false;
......@@ -61,6 +62,8 @@ if (!empty($ancestors)) {
}
}
}
// Reverse the order back again so $artefactpath can display the paths from highest ancestor first
$artefactpath = array_reverse($artefactpath);
if ($artefactok == false) {
throw new AccessDeniedException(get_string('artefactnotinview', 'error', $artefactid, $viewid));
......@@ -195,6 +198,7 @@ $smarty = smarty(
)
);
$smarty->assign('artefacttitle', $title);
$smarty->assign('artefact', $content);
$smarty->assign('artefactpath', $artefactpath);
$smarty->assign('INLINEJAVASCRIPT', $inlinejavascript);
......
......@@ -9,27 +9,20 @@
</div>
{/if}
<h1 class="page-header ptl">
{foreach from=$artefactpath item=a name='path'}
{if $a.url}
{if $.foreach.path.total == 1}
{$a.title}
{elseif $.foreach.path.last}
<br />
<span class="subsection-heading">
<h1 class="page-header">
{if count($artefactpath) == 0}
{$artefacttitle}
{else}
{foreach from=$artefactpath item=a name='path'}
<span class="lead text-small">
<a href="{$a.url}">
{$a.title}
</span>
{else}
<span class="lead text-small ptl">
<a href="{$a.url}">
{$a.title}
</a> /
</span>
{/if}
{else}
{$a.title}
{/if}
{/foreach}
</a> /
</span>
{/foreach}
<br>
<span class="subsection-heading">{$artefacttitle}</span>
{/if}
<span class="metadata">
| {$view->display_title()|safe}
{if $hasfeed}
......
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