Customizing the Top Bar

I'm trying to change the code for the top bar of my site so that only certain active plugins appear and other active plugins remain hidden. How can i accomplish this. at present my code is;  

<?php

 /**
  * Elgg standard tools drop down
  * This will be populated depending on the plugins active - only plugin navigation will appear here
  *
  * @package Elgg
  * @subpackage Core
  * @author Curverider Ltd
  * @link http://elgg.org/
  *
  */
 
  $menu = get_register('menu');
  
  //var_export($menu);

  if (is_array($menu) && sizeof($menu) > 0) {
   $alphamenu = array();
   foreach($menu as $item) {
    $alphamenu[$item->name] = $item;
   }
   ksort($alphamenu);
  
?>

<ul id="nav">
      <?php
   foreach($alphamenu as $item) {
       echo "<li><h1><a href=\"{$item->value}\">" . $item->name . "</a></h1></li>";
   }
     ?>

  • Go to the plugin's start file that you don't want to appear and comment out the add_menu call.

  • Or, create a custom dropdown menu. Replace the tools code with this one on /views/default/navigation/topbar_tools.php/

    <li class="drop"><a href="#" class="menuitemtools"><?php echo(elgg_echo('Tools')); ?></a>
          <ul>
          <li><a href="#"><?php echo(elgg_echo('LInk1')); ?></a></li>
         <li><a href="#"><?php echo(elgg_echo('LInk2')); ?></a></li>

          <li><a href="#"><?php echo(elgg_echo('LInk31')); ?></a></li>
          </ul>
       </li>