diff options
Diffstat (limited to 'views/default/navigation')
-rw-r--r-- | views/default/navigation/site_nav.php | 76 | ||||
-rw-r--r-- | views/default/navigation/topbar_tools.php | 5 |
2 files changed, 17 insertions, 64 deletions
diff --git a/views/default/navigation/site_nav.php b/views/default/navigation/site_nav.php index 8431188d8..965eb7e63 100644 --- a/views/default/navigation/site_nav.php +++ b/views/default/navigation/site_nav.php @@ -2,67 +2,21 @@ /** * Main site-wide navigation **/ - -echo "<div id='elgg_main_nav' class='clearfloat'>"; -echo "<ul class='navigation'>"; -if(is_plugin_enabled('riverdashboard')){ - if(get_context() == 'riverdashboard') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/riverdashboard/\" title='Activity'><span>Activity</span></a></li>"; -} -if(is_plugin_enabled('thewire') && isloggedin()){ - if(get_context() == 'thewire') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/thewire/everyone.php\" title='The Wire'><span>" . elgg_echo('thewire:title') . "</span></a></li>"; -} -if(is_plugin_enabled('conversations') && isloggedin()){ - if(get_context() == 'conversations') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/conversations/all.php\" title='Conversations'><span>" . elgg_echo('conversations') . "</span></a></li>"; -} -if(is_plugin_enabled('blog')){ - if(get_context() == 'blog') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/blog/all.php\" title='Blogs'><span>Blogs</span></a></li>"; -} -if(is_plugin_enabled('pages')){ - if(get_context() == 'pages') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/pages/all.php\" title='Pages'><span>Pages</span></a></li>"; -} -if(is_plugin_enabled('file')){ - if(get_context() == 'file') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}pg/file/world/world/\" title='Files'><span>Files</span></a></li>"; -} -if(is_plugin_enabled('bookmarks')){ - if(get_context() == 'bookmarks') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}mod/bookmarks/all.php\" title='Bookmarks'><span>Bookmarks</span></a></li>"; -} -if(is_plugin_enabled('groups')){ - if(get_context() == 'groups') - $selected = 'class="selected"'; - else - $selected = ""; - echo "<li {$selected}><a href=\"{$vars['url']}pg/groups/world/\" title='Groups'><span>". elgg_echo('groups') . "</span></a></li>"; +$featured = $vars['config']->menu_items['featured_urls']; +$current_context = get_context(); + +echo '<div id="elgg_main_nav" class="clearfloat"> + <ul class="navigation">'; + +foreach ($featured as $info) { + $selected = ($info->value->context == $current_context) ? 'class="selected"' : ''; + $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8'); + $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8'); + + echo "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>"; } -echo "</ul>"; -echo "</div>"; -?>
\ No newline at end of file +echo ' + </ul> +</div>';
\ No newline at end of file diff --git a/views/default/navigation/topbar_tools.php b/views/default/navigation/topbar_tools.php index 0e0eec097..2e48a4a85 100644 --- a/views/default/navigation/topbar_tools.php +++ b/views/default/navigation/topbar_tools.php @@ -9,8 +9,7 @@ * @link http://elgg.org/ * */ - -$menu = get_register('menu'); +$menu = $vars['config']->menu_items['toolbar']; if (is_array($menu) && sizeof($menu) > 0) { $alphamenu = array(); @@ -26,7 +25,7 @@ if (is_array($menu) && sizeof($menu) > 0) { <ul> <?php foreach($alphamenu as $item) { - echo "<li><a href=\"{$item->value}\">" . $item->name . "</a></li>"; + echo "<li><a href=\"{$item->value->url}\">" . $item->name . "</a></li>"; } ?> </ul> |