function _AdvisingScreen::output_to_browser
Search API
4.x _AdvisingScreen.php | _AdvisingScreen::output_to_browser() |
5.x _AdvisingScreen.php | _AdvisingScreen::output_to_browser() |
This method outputs the screen to the browser by performing an include(path-to-theme-file.php). All necessary information must be placed into certain variables before the include happens.
File
- classes/
_AdvisingScreen.php, line 270
Class
Code
function output_to_browser()
{
// This method will output the screen to the browser.
// outputs the $page_content variable.
$page_content = $this->page_content;
$page_tabs = $this->page_tabs;
$page_has_search = $this->page_has_search;
$page_on_load = $this->page_on_load;
$page_scroll_top = $this->page_scroll_top;
$page_is_popup = $this->page_is_popup;
$page_title = $this->page_title;
$page_body_classes = $this->page_body_classes;
if ($page_title == "") {
// By default, page title is this...
$page_title = $GLOBALS ["fp_system_settings"]["school_initials"] . " FlightPath";
}
$page_hide_report_error = $this->page_hide_report_error;
$print_option = "";
if ($this->bool_print == true) {
$print_option = "print_";
}
if ($this->page_is_mobile == true) {
$print_option = "mobile_";
}
// Add extra JS files.
if (is_array($GLOBALS ["fp_extra_js"]) && count($GLOBALS ["fp_extra_js"]) > 0) {
foreach ($GLOBALS ["fp_extra_js"] as $js_file_name) {
$page_extra_js_files .= "<script type='text/javascript' src='$js_file_name'></script> \n";
}
}
// Load any extra CSS files which addon modules might have added.
if (is_array($GLOBALS ["fp_extra_css"]) && count($GLOBALS ["fp_extra_css"]) > 0) {
foreach ($GLOBALS ["fp_extra_css"] as $css_file_name) {
$page_extra_css_files .= "<link rel='stylesheet' type='text/css' href='$css_file_name'>";
}
}
// Javascript settings...
$page_extra_js_settings .= "var FlightPath = new Object(); \n";
$page_extra_js_settings .= " FlightPath.settings = new Object(); \n";
foreach ($GLOBALS ["fp_extra_js_settings"] as $key => $val) {
$page_extra_js_settings .= "FlightPath.settings.$key = '$val'; \n";
}
// Scrolling somewhere? Add it to the page_on_load...
if (trim($page_scroll_top != "")) {
$page_on_load .= " scrollTo(0, $page_scroll_top);";
}
// Add in our hidden divs which we will sometimes display...
$page_content .= "<div id='updateMsg' class='updateMsg' style='display: none;'>" . t("Updating...") . "</div>
<div id='loadMsg' class='updateMsg' style='display: none;'>" . t("Loading...") . "</div>";
include ($GLOBALS ["fp_system_settings"]["theme"] . "/fp_" . $print_option . "template.php");
}