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

$title

\n"; } /** * Draws the page header. * * @param $title * Page title; */ static function header($title) { echo ''; echo ''; echo ''; echo ''; echo ''. $title .''; echo ''; echo ''; } /** * Draws the page footer. */ static function footer() { echo ''; } /** * Draws a form. * * @param $content * Form inner content. * * @param $action * Form action. * * @param $method * Form method. */ static 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. */ static 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. */ static 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'; } } /** * Format a link. * * @param $action * Link action. * * @param $args * Action arguments. * * @param $title * Link title. * * @return * Formatted link. */ static function link($action, $args, $title) { return ''. $title .''; } /** * Format an entry link. * * @param $entry * Entry number. * * @return * Formatted link. */ static function entry_link($entry) { return self::link('index.php', '?entry='. $entry, $entry); } /** * Draws tags for opening a table. */ static function open_table() { echo ''; } /** * Draws tags for closing a table. */ static function close_table() { echo '
'; } /** * Draws a h2 element. * * @param $text * Inner text. */ static function h2($text) { echo "

$text

"; } /** * Draws a h3 element. * * @param $text * Inner text. */ static function h3($text) { echo "

$text

"; } /** * Draws a line break element. */ static function br($text) { echo "
"; } /** * Draws a pre format block element. * * @param $text * Inner text. */ static function pre($text) { echo "
$text
"; } }