Commit bca5c8f2 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add collection menu to views in html export (bug #617125)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 7a43ff77
......@@ -319,6 +319,22 @@ class PluginExportHtml extends PluginExport {
}
}
private function collection_menu($collectionid) {
static $menus = array();
if (!isset($menus[$collectionid])) {
$menus[$collectionid] = array();
foreach ($this->collectionview[$collectionid] as $viewid) {
$title = $this->views[$viewid]->get('title');
$menus[$collectionid][] = array(
'id' => $viewid,
'url' => self::text_to_path($title),
'text' => $title,
);
}
}
return $menus[$collectionid];
}
/**
* Dumps all views into the HTML export
*/
......@@ -349,6 +365,13 @@ class PluginExportHtml extends PluginExport {
}
}
// Collection menu data
if (isset($this->viewcollection[$viewid])) {
$smarty->assign_by_ref('collectionname', $this->collections[$this->viewcollection[$viewid]]->get('name'));
$smarty->assign_by_ref('collectionmenu', $this->collection_menu($this->viewcollection[$viewid]));
$smarty->assign('viewid', $viewid);
}
$outputfilter = new HtmlExportOutputFilter($rootpath, $this);
$smarty->assign('view', $outputfilter->filter($view->build_columns()));
$content = $smarty->fetch('export:html:view.tpl');
......
......@@ -14,7 +14,7 @@
</div>
<h1><a href="{$rootpath}index.html">{$page_heading}</a></h1>
<div id="content">
{if !$nobreadcrumbs}<div id="breadcrumbs">
{if !$nobreadcrumbs}<div id="breadcrumbs" class="breadcrumbs">
<ul>
<li>{str tag=youarehere section=export}: <a href="{$rootpath}index.html">Home</a></li>
{foreach from=$breadcrumbs item=crumb}
......
......@@ -79,11 +79,11 @@ h2, h3, h4, h5, h6 {
}
/* Breadcrumbs */
#breadcrumbs ul {
.breadcrumbs ul {
margin: .5em 0 .1em;
padding: 0;
}
#breadcrumbs li {
.breadcrumbs li {
list-style-type: none;
margin: 0;
padding: 0;
......@@ -92,9 +92,19 @@ h2, h3, h4, h5, h6 {
font-size: smaller;
font-family: Arial, sans-serif;
}
#breadcrumbs a {
.breadcrumbs a {
color: #808080;
}
.breadcrumbs li.selected a {
color: #303030;
}
.breadcrumbs.collection {
margin-top: .5em;
}
.breadcrumbs li.collectionname {
color: #303030;
font-weight: bold;
}
#breadcrumbs-footer {
clear: both;
}
......
{include file="export:html:header.tpl"}
{if $collectionmenu}
<div class="breadcrumbs collection">
<ul>
<li class="collectionname">{$collectionname}</li>
{foreach from=$collectionmenu item=item}
| <li{if $item.id == $viewid} class="selected"{/if}><a href="{$rootpath}views/{$item.url}">{$item.text}</a></li>
{/foreach}
</ul>
</div>
<div class="cb"></div>
{/if}
<p id="view-description">{$viewdescription|clean_html|safe}</p>
{$view|safe}
......
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