headCode['jQuery'] = ''; $this->headCode['schedInput'] = ''; $this->headCode['outputPrintStyle'] = ''; $this->headCode['outputStyle'] = ''; $this->headCode['gliderHeadcode'] = ''; $this->headCode['uiTabsKeyboard'] = ''; $this->pagetitle = $ntitle; $this->scripts = $nscripts; /* compliant browsers which care, such as gecko, explicitly request xhtml: */ if(!empty($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE || !strlen($_SERVER['HTTP_ACCEPT']) /* then the browser doesn't care :-) */) { $this->xhtml = TRUE; header('Content-type: application/xhtml+xml'); } if (count($ga_trackers)) { $ga_www = 'http://www.'; if ($_SERVER['SERVER_PORT'] != 80) $ga_www = 'https://ssl.'; $this->trackingcode = '\n"; } self::session_start(); /* everything that needs sessions started to work: */ $this->school = school_load_guess(); if($immediate && $ntitle != "NOHEAD") $this->head(); } /** * \brief * Adds some headcode to this page. * * \param $key * The key to register this headcode under. * \param $code * The actual code, such as a '; } private function add_trailing_slash($path){ if($path[strlen($path)-1] != '/') { return $path . "/"; } else { return $path; } } /** * \brief * Generate a URL to a given schedule. */ public function gen_share_url($id) { global $clean_urls, $short_url_base; if ($clean_urls && isset($short_url_base)) return $this->add_trailing_slash($short_url_base) . $id; elseif ($clean_urls) return 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $id; else return 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/process.php?s=' . $id; } }