Commit 4dcd3021 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Replace lost activity preferences (bug #617112)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 665a8161
......@@ -380,8 +380,10 @@ EOF;
$smarty->assign('LOGGEDIN', $USER->is_logged_in());
if ($USER->is_logged_in()) {
global $SELECTEDSUBNAV; // It's evil, but rightnav & mainnav stuff are now in different templates.
$smarty->assign('MAINNAV', main_nav());
$smarty->assign('RIGHTNAV', right_nav());
$smarty->assign('SELECTEDSUBNAV', $SELECTEDSUBNAV);
}
else {
$smarty->assign('sitedefaultlang', get_string('sitedefault', 'admin') . ' (' .
......@@ -2110,13 +2112,13 @@ function footer_menu($all=false) {
* Used by main_nav()
*/
function find_menu_children(&$menu, $path) {
global $SELECTEDSUBNAV;
$result = array();
if (!$menu) {
return array();
}
foreach ($menu as $key => $item) {
$len = strlen($item['path']);
$item['selected'] = defined('MENUITEM')
&& ($item['path'] == MENUITEM
|| ($item['path'] . '/' == substr(MENUITEM, 0, strlen($item['path'])+1)));
......@@ -2131,6 +2133,9 @@ function find_menu_children(&$menu, $path) {
if ($menu) {
foreach ($result as &$item) {
$item['submenu'] = find_menu_children($menu, $item['path']);
if ($item['selected']) {
$SELECTEDSUBNAV = $item['submenu'];
}
}
}
......
......@@ -4,7 +4,7 @@
<div id="main-nav">
<ul>{strip}
{foreach from=$MAINNAV item=item}
<li{if $item.selected}{assign var=MAINNAVSELECTED value=$item} class="selected"{/if}><a href="{$WWWROOT}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a></li>
<li{if $item.selected} class="selected"{/if}><a href="{$WWWROOT}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a></li>
{/foreach}
{if $ADMIN || $INSTITUTIONALADMIN}
<li><a href="{$WWWROOT}" accesskey="h">{str tag="returntosite"}</a></li>
......@@ -18,9 +18,9 @@
</div>
<div id="sub-nav">
{if $MAINNAVSELECTED.submenu}
{if $SELECTEDSUBNAV}
<ul>{strip}
{foreach from=$MAINNAVSELECTED.submenu item=item}
{foreach from=$SELECTEDSUBNAV item=item}
<li{if $item.selected} class="selected"{/if}><a href="{if get_config('httpswwwroot') && $item.url=='account/'}{$HTTPSWWWROOT}{else}{$WWWROOT}{/if}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a></li>
{/foreach}
{/strip}</ul>
......
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