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

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

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