From 044787875ba643fce951aeaf7256607c010ca65e Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 17 Aug 2010 15:34:52 -0300 Subject: Showing links at test scripts --- classes/helpers/CinisisDisplayHelper.php | 44 +++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'classes/helpers') diff --git a/classes/helpers/CinisisDisplayHelper.php b/classes/helpers/CinisisDisplayHelper.php index 90e0069..e5cbafe 100644 --- a/classes/helpers/CinisisDisplayHelper.php +++ b/classes/helpers/CinisisDisplayHelper.php @@ -21,7 +21,7 @@ class CinisisDisplayHelper { * @param $title * Page title; */ - function title($title) { + static function title($title) { echo "

$title

\n"; } @@ -31,7 +31,7 @@ class CinisisDisplayHelper { * @param $title * Page title; */ - function header($title) { + static function header($title) { echo ''; echo ''; echo ''; @@ -44,7 +44,7 @@ class CinisisDisplayHelper { /** * Draws the page footer. */ - function footer() { + static function footer() { echo ''; } @@ -60,7 +60,7 @@ class CinisisDisplayHelper { * @param $method * Form method. */ - function form($content, $action = 'index.php', $method = 'get') { + static function form($content, $action = 'index.php', $method = 'get') { echo '
'; echo $content; echo ''; @@ -80,7 +80,7 @@ class CinisisDisplayHelper { * @return * Rendered text input. */ - function form_input_text($name, $default = null) { + static function form_input_text($name, $default = null) { if ($default) { $default = 'value="'. $default .'"'; } @@ -103,7 +103,7 @@ class CinisisDisplayHelper { * @param $extra * Extra parameters. */ - function navbar($entry, $entries, $action = 'index.php', $extra = NULL) { + static function navbar($entry, $entries, $action = 'index.php', $extra = NULL) { // First / prev links. if ($entry != 1) { $prev = $entry - 1; @@ -118,4 +118,36 @@ class CinisisDisplayHelper { 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); + } } -- cgit v1.2.3