diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -152,6 +152,7 @@ class page /* everything that needs sessions started to work: */ $this->school = school_load_guess(); + $this->semester = school_semester_guess($this->school); if($immediate && $ntitle != "NOHEAD") @@ -229,7 +230,11 @@ class page '

'. PHP_EOL . ' '.$this->pagetitle.''. PHP_EOL . - ' '. PHP_EOL . + ' '. PHP_EOL . '
'. PHP_EOL . ' '. PHP_EOL . ' '. PHP_EOL . @@ -319,6 +324,52 @@ class page /** * \brief + * Display a list of semesters the user might be interested in. + * \param $linkto + * The link to which a &semester= or ?semester= query string + * should be appended. + */ + public function showSemesters($linkto = 'input.php') + { + if (strpos($linkto, '?')) + $linkto .= '&'; + else + $linkto .= '?'; + /* + * We can pre-htmlentities() $linkto because we're only appending + * a safe string. + */ + $linkto = htmlentities($linkto . 'semester='); + + $time = time(); + + echo "\n"; + echo "