From 8f4162ac5c5a2dc8c0ca17b5ba21bf84e53b88d0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 20 Aug 2014 22:27:03 -0700 Subject: [PATCH] Added option for default starting slide in carousel. --- e107_handlers/form_handler.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index df0f8564c..74620dca4 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -239,9 +239,9 @@ class e_form /** * Render Bootstrap Carousel - * @param $name : A unique name - * @param $array - * @param $options : placeholder for any future options. (currently not in use) + * @param string $name : A unique name + * @param array $array + * @param array $options : default, interval, pause, wrap * @example * $array = array( * 'slide1' => array('caption' => 'Slide 1', 'text' => 'first slide content' ), @@ -254,6 +254,8 @@ class e_form $interval = null; $wrap = null; $pause = null; + + $act = varset($options['default'], 0); if(isset($options['wrap'])) { @@ -281,7 +283,7 @@ class e_form $c = 0; foreach($array as $key=>$tab) { - $active = ($c == 0) ? ' class="active"' : ''; + $active = ($c == $act) ? ' class="active"' : ''; $text .= '
  • '; $c++; } @@ -296,7 +298,7 @@ class e_form $c=0; foreach($array as $key=>$tab) { - $active = ($c == 0) ? ' active' : ''; + $active = ($c == $act) ? ' active' : ''; $text .= '
    '; $text .= $tab['text'];