Commit 089871a4 authored by Nigel McNie's avatar Nigel McNie
Browse files

Have the page heading change depending on what page you're looking at.

I haven't changed the <title> though I probably should at some point.
(cherry picked from commit 930d9a555d4b5d62d8a98757c3cc541dcebd26bf)
parent 3b2bc96f
......@@ -43,11 +43,12 @@ class HtmlExportBlog extends HtmlExportArtefactPlugin {
// Render the first page of the blog (the only one if there's
// not many posts)
$smarty = $this->exporter->get_smarty('../../../', 'blog');
$smarty->assign('page_heading', $artefact->get('title'));
$smarty->assign('breadcrumbs', array(
array('text' => get_string('blogs', 'artefact.blog')),
array('text' => $artefact->get('title'), 'path' => 'index.html'),
));
$rendered = $artefact->render_self(array());
$rendered = $artefact->render_self(array('hidetitle' => true));
$outputfilter = new HtmlExportOutputFilter('../../../');
$smarty->assign('rendered_blog', $outputfilter->filter($rendered['html']));
$content = $smarty->fetch('export:html/blog:index.tpl');
......
......@@ -165,6 +165,7 @@ class HtmlExportFile extends HtmlExportArtefactPlugin {
*/
private function create_index_for_directory($filesystemdirectory, $level, ArtefactTypeFolder $artefact=null) {
$smarty = $this->exporter->get_smarty(str_repeat('../', $level + 2), 'file');
$smarty->assign('page_heading', get_string('Files', 'artefact.file'));
$smarty->assign('breadcrumbs', array(array('text' => 'Files', 'path' => 'index.html')));
if ($artefact) {
......
......@@ -38,6 +38,7 @@ class HtmlExportInternal extends HtmlExportArtefactPlugin {
}
$smarty = $this->exporter->get_smarty('../../', 'internal');
$smarty->assign('page_heading', get_string('profilepage', 'artefact.internal'));
// Profile page
$profileviewid = $this->exporter->get('user')->get_profile_view()->get('id');
......@@ -58,6 +59,7 @@ class HtmlExportInternal extends HtmlExportArtefactPlugin {
}
// Generic profile information
$smarty->assign('page_heading', get_string('profileinformation', 'artefact.internal'));
$smarty->assign('breadcrumbs', array(array('text' => 'Profile information', 'path' => 'index.html')));
// Organise profile information by sections, ordered how it's ordered
......
......@@ -115,6 +115,8 @@ $string['Preview'] = 'Preview';
$string['Size'] = 'Size';
$string['Type'] = 'Type';
$string['profileinformation'] = 'Profile Information';
$string['profilepage'] = 'Profile Page';
$string['viewprofilepage'] = 'View profile page';
$string['viewallprofileinformation'] = 'View all profile information';
......
......@@ -38,6 +38,7 @@ class HtmlExportResume extends HtmlExportArtefactPlugin {
return;
}
$smarty = $this->exporter->get_smarty('../../', 'resume');
$smarty->assign('page_heading', get_string('resumeofuser', 'artefact.resume', full_name($this->exporter->get('user'))));
$smarty->assign('breadcrumbs', array(
array('text' => get_string('resume', 'artefact.resume'), 'path' => 'index.html'),
));
......
......@@ -82,5 +82,6 @@ $string['current'] = 'Current';
$string['moveup'] = 'Move Up';
$string['movedown'] = 'Move Down';
$string['viewyourresume'] = 'View your Resumé';
$string['resumeofuser'] = 'Resumé of %s';
?>
......@@ -245,6 +245,7 @@ class PluginExportHtml extends PluginExport {
private function build_index_page($summaries) {
$smarty = $this->get_smarty();
$smarty->assign('page_heading', full_name($this->get('user')));
$smarty->assign('summaries', $summaries);
$content = $smarty->fetch('export:html:index.tpl');
if (!file_put_contents($this->exportdir . '/' . $this->rootdir . '/index.html', $content)) {
......@@ -258,12 +259,11 @@ class PluginExportHtml extends PluginExport {
private function dump_view_export_data() {
$smarty = $this->get_smarty('../../');
foreach ($this->views as $viewid => $view) {
$smarty->assign('page_heading', $view->get('title'));
$smarty->assign('breadcrumbs', array(
array('text' => get_string('Views', 'view')),
array('text' => $view->get('title'), 'path' => 'index.html'),
));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('ownername', $view->formatted_owner());
$smarty->assign('viewdescription', $view->get('description'));
$directory = $this->exportdir . '/' . $this->rootdir . '/views/' . self::text_to_path($view->get('title'));
......
......@@ -12,11 +12,11 @@
<div id="mahara-logo">
<a href="http://mahara.org/"><img src="{$maharalogo}" alt="Mahara export"></a>
</div>
<h1><a href="{$rootpath}index.html">{$user|full_name|escape}</a></h1>
<h1><a href="{$rootpath}index.html">{$page_heading|escape}</a></h1>
<div id="content">
<div id="breadcrumbs">
<ul>
<li><a href="{$rootpath}index.html">Home</a></li>
<li>{str tag=youarehere section=export}: <a href="{$rootpath}index.html">Home</a></li>
{foreach from=$breadcrumbs item=crumb}
<li>&raquo; {if $crumb.path}<a href="{$crumb.path|escape}">{$crumb.text|escape}</a>{else}{$crumb.text|escape}{/if}</li>
{/foreach}
......
{include file="export:html:header.tpl"}
<h2 id="view-title">{$viewtitle|escape}{if $ownername} {str tag=by section=view} {$ownername|escape}{/if}</h2>
<p id="view-description">{$viewdescription}</p>
{$view}
......
......@@ -42,6 +42,7 @@ $string['unabletoexportportfoliousingoptions'] = 'Unable to export a portfolio u
$string['unabletogenerateexport'] = 'Unable to generate export';
$string['viewstoexport'] = 'Views to export';
$string['whatdoyouwanttoexport'] = 'What do you want to export?';
$string['youarehere'] = 'You are here';
$string['zipnotinstalled'] = 'Your system does not have the zip command. Please install zip to enable this feature';
?>
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