From dade84103520ab531c48474420feb73c286d5714 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 23 Jun 2014 18:26:37 -0700 Subject: [PATCH] Bootstrap Tabs method added to form handler. --- e107_handlers/form_handler.php | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 1820e404c..295448743 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -176,6 +176,55 @@ class e_form $options['size'] = 7; return $this->text($name, $value, $maxlength, $options); } + + /** + * Render Bootstrap Tabs + * @param $array + * @param $options + * @example + * $array = array( + * 'home' => array('caption' => 'Home', 'text' => 'some tab content' ), + * 'other' => array('caption' => 'Other', 'text' => 'second tab content' ) + * ); + */ + function tabs($array,$options = array()) + { + + $text =' + + '; + + $text .= ' + +
'; + + $c=0; + foreach($array as $key=>$tab) + { + $active = ($c == 0) ? ' active' : ''; + $text .= '
'.$tab['text'].'
'; + $c++; + } + + $text .= ' +
'; + + return $text; + + } + + + /** * Text-Field Form Element