header($title); $this->title($title); } /** * Draws a page title. * * @param $title * Page title; */ function title($title) { echo "

$title

\n"; } /** * Draws the page header. * * @param $title * Page title; */ function header($title) { echo ''; echo ''; echo ''; echo ''; echo ''. $title .''; echo ''; echo ''; } /** * Draws the page footer. */ function footer() { echo ''; } /** * Draws a form. * * @param $content * Form inner content. * * @param $action * Form action. * * @param $method * Form method. */ function form($content, $action = 'index.php', $method = 'get') { echo '
'; echo $content; echo ''; echo '
'; echo '
'; } /** * Draws a form text input. * * @param $name * Input name. * * @param $default * Default value. * * @return * Rendered text input. */ function form_input_text($name, $default = null) { if ($default) { $default = 'value="'. $default .'"'; } return ucfirst($name) .': '; } /** * Draws a navigation bar. * * @param $entry * Current entry. * * @param $entries * Total number of entries. * * @param $action * Page action. * * @param $extra * Extra parameters. */ function navbar($entry, $entries, $action = 'index.php', $extra = NULL) { // First / prev links. if ($entry != 1) { $prev = $entry - 1; echo 'first '; echo '< prev '; } // Next / last links. if ($entry < $entries) { $next = $entry + 1; echo 'next > '; echo 'last'; } } }