function fp_build_sub_tab_array

6.x theme.inc fp_build_sub_tab_array($page)
4.x theme.inc fp_build_sub_tab_array($page)
5.x theme.inc fp_build_sub_tab_array($page)

Create a "sub-tab" array, which looks like a standard tab_array, but it contains only this page's sub-tab siblings.

1 call to fp_build_sub_tab_array()
fp_display_page in includes/theme.inc
Output the contents of the $page variable to the screen. $page is an array containing details about the page, as well as its original menu item (router_item) definition.

File

includes/theme.inc, line 1696

Code

function fp_build_sub_tab_array($page) {
  global $current_student_id;

  $tab_array = array();

  $tab_family = $page ["router_item"]["tab_family"];
  $active_tab_path = $page ["path"];

  $items = menu_get_items_in_tab_family($tab_family);

  foreach ($items as $item) {

    // Does the user have access to this subtab?
    if (!menu_check_user_access($item)) {
      continue;
    }

    $title = $item ["title"];
    $path = $item ["path"];
    $active = FALSE;
    $on_click = @$page ["page_settings"]["tab_on_click"];
    if ($on_click == "") {
      // Just a simple link to the path
      // Add the current_student_id to the query!
      $query = "current_student_id=$current_student_id";

      $turl = fp_url($path, $query, TRUE);

      $on_click = "window.location=\"" . $turl . "\"";
    }

    if ($path == $active_tab_path) {
      // This is the current page we are on.
      $active = TRUE;
      $title = $page ["title"];
      $on_click = "";
    }

    $tab_array [] = array(
      "title" => $item ["title"],
      "active" => $active,
      "on_click" => $on_click,
    );

  }

  return $tab_array;
}