function _AdvisingScreen::draw_menu_items

4.x _AdvisingScreen.php _AdvisingScreen::draw_menu_items($menu_array)
5.x _AdvisingScreen.php _AdvisingScreen::draw_menu_items($menu_array)

Uses the draw_menu_item method to draw the HTML for all the supplied menu items, assuming the user has permission to view them.

Returns the HTML or "" if no menus could be drawn.

Parameters

unknown_type $menu_array:

File

classes/_AdvisingScreen.php, line 226

Class

_AdvisingScreen

Code

function draw_menu_items($menu_array) {

  $rtn = "";

  if (count($menu_array) == 0) {
    return "";
  }


  foreach ($menu_array as $item) {
    $url = $item ["url"];
    $target = $item ["target"];
    $icon = $item ["icon"];
    if ($icon) {
      $icon_img = "<img src='$icon' border='0'>";
    }
    else {
      $icon_img = "<span class='fp-menu-item-no-icon'></span>";
    }

    $title = $item ["title"];
    $description = $item ["description"];

    // Make sure they have permission!
    if ($item ["permission"] != "") {
      if (!user_has_permission($item ["permission"])) {
        // User did NOT have permission to view this link.
        continue;
      }
    }

    $rtn .= $this->draw_menu_item($url, $target, $icon_img, $title, $description);

  }

  return $rtn;

}