function system_display_main_page

4.x system.module system_display_main_page()
5.x system.module system_display_main_page()

Display the "main" tab-page for FlightPath. Displays announcements as well as the Tools menu, and the "special administrative tools" menu.

File

modules/system/system.module, line 2781

Code

function system_display_main_page() {
  global $user;
  $rtn = "";

  // If we are not logged in, then we need to re-direct the user to 
  // the login page!
  if ($_SESSION ["fp_logged_in"] != TRUE) {
    $query = "";
    if (isset($_REQUEST ["logout"])) {
      $query = "logout=" . $_REQUEST ["logout"];
    }
    // Since we are not logged in, and are headed to the login page, also clear out any advising variables we might have.
    foreach ($_REQUEST as $key => $val) {
      unset($_REQUEST [$key]);
      unset($_GET [$key]);
      unset($_POST [$key]);
    }

    global $current_student_id;
    $current_student_id = ""; // clear this so the fp_goto doesn't try to add it.

    session_destroy();
    session_commit();
    fp_goto("login", $query);
    return;
  }

  $rtn .= "<table class='fp-semester-table'>";

  fp_add_css(fp_get_module_path("system") . "/css/style.css");


  $left_col_blocks = blocks_render_blocks("system_main", "left_col");
  $right_col_blocks = blocks_render_blocks("system_main", "right_col");

  if (fp_screen_is_mobile()) {
    $rtn .= "<tr><td colspan='2'>$left_col_blocks $right_col_blocks</td></tr>";
  }
  else {
    $rtn .= "<tr><td width='50%' valign='top'  style='padding-right: 10px;'>
              $left_col_blocks
              </td><td width='50%' valign='top' style='padding-left: 10px;'>
                    $right_col_blocks
              </td></tr>";
  }

  $rtn .= "</table>";

  $rtn .= "<form id='mainform' method='POST'>
      <input type='hidden' id='scrollTop'>
      <input type='hidden' id='performAction' name='performAction'>
      <input type='hidden' id='advisingWhatIf' name='advisingWhatIf'>
      <input type='hidden' id='currentStudentID' name='currentStudentID'>
      </form>";

  //$pC .= $screen->get_javascript_code();


  /*
  $screen->page_content = $pC;
  $screen->page_has_search = true;
  if ($_SESSION["fp_user_type"] == "student" || $_SESSION["fp_can_advise"] == false)
  {
    $screen->page_has_search = false;
  }
  $screen->build_system_tabs(0);

 */

  //////////////////////////////////////////////////////////
  // To cut down on how long it takes to load huge groups
  // like Free Electives, we will pre-load some of the course inventory here.
  if (@$_SESSION ["fp_cached_inventory_flag_one"] != true) 
   {
    $load_number = $GLOBALS ["fp_system_settings"]["load_course_inventory_on_login_number"];
    if ($load_number > 1) {
      $fp = new FlightPath();
      $fp->cache_course_inventory(0, $load_number);
      $_SESSION ["fp_cached_inventory_flag_one"] = true;
    }
  }


  // send to the browser
  //$screen->output_to_browser();

  return $rtn;

}