diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -1,8 +1,8 @@ '; - if(isset($session['saved']) && count($session['saved']) > 0){ - echo '

Saved Schedules:

'; - foreach($session['saved'] as $key => $schedule){ - $sch = unserialize($schedule); - echo "#" . ($key + 1) . " - " . $sch->getName() - . " - view" .' edit ' - . "delete" - . "

\n"; - } - echo '
'; - } - echo '

'; + public function showSavedScheds($session) + { + echo '

'; + if (isset($session['saved']) && count($session['saved']) > 0) + { + echo '

Saved Schedules:

'; + foreach($session['saved'] as $key => $name) + { + echo '#' . $key . ":\n " + . htmlentities($name) + . ' edit' + . ' delete' + . "

\n"; + } + echo '
'; + } + echo '

'; + } + + /** + * \brief + * Display a 404 page and halt the PHP interpreter. + * + * This function does not return. It handles the creation of a Page + * class with 404-ish stuff and then calls exit() after flushing the + * page out to the user. + * + * \param $message + * A message consisting of valid XHTML to display to the user in + * the 404 page. + */ + public static function show_404($message = 'I couldn\'t find what you were looking for :-/.') + { + $page_404 = new Page('404: Content Not Found'); + + echo "

404: Content Not Found

\n" + . "

\n" + . ' ' . $message . "\n" + . "

\n"; + + $page_404->foot(); + + exit(); + } } - -}