From 2ec3b3c05e535ffacb1e10a64aa62ad057499d47 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 16 Aug 2010 15:37:31 -0300 Subject: Adding helper classes and repetition finder --- classes/helpers/CinisisDisplayHelper.php | 53 ++++++++++++++++++++++++++++++++ classes/helpers/CinisisHttpHelper.php | 15 +++++++++ 2 files changed, 68 insertions(+) create mode 100644 classes/helpers/CinisisDisplayHelper.php create mode 100644 classes/helpers/CinisisHttpHelper.php (limited to 'classes/helpers') diff --git a/classes/helpers/CinisisDisplayHelper.php b/classes/helpers/CinisisDisplayHelper.php new file mode 100644 index 0000000..16d458e --- /dev/null +++ b/classes/helpers/CinisisDisplayHelper.php @@ -0,0 +1,53 @@ +header(); + $this->title($title); + } + + function title($title) { + echo "

$title

\n"; + } + + function header() { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + + function footer() { + echo ''; + } + + function form($content, $action = 'index.php', $method = 'get') { + echo '
'; + echo $content; + echo ''; + echo '
'; + echo '
'; + } + + function form_input_text($name) { + return ucfirst($name) .': '; + } + + function navbar($entry, $entries, $action = 'index.php') { + // 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'; + } + } +} diff --git a/classes/helpers/CinisisHttpHelper.php b/classes/helpers/CinisisHttpHelper.php new file mode 100644 index 0000000..34ff349 --- /dev/null +++ b/classes/helpers/CinisisHttpHelper.php @@ -0,0 +1,15 @@ +