system_display_main_page

5.x system.module system_display_main_page()
4.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 1676

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) {
    fp_goto("login");
    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;

}