trigger_error("sugar_button_slider: missing required param (module)"); } else if(empty($params['buttons'])) { $smarty->trigger_error("sugar_button_slider: missing required param (buttons)"); } else if(empty($params['view'])) { $smarty->trigger_error("sugar_button_slider: missing required param (view)"); } $module = $params['module']; $view = $params['view']; $buttons = $params['buttons']; $str = ''; if(is_array($buttons)) { if(count($buttons) <= 2){ foreach($buttons as $val => $button){ $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty); } }else{ $str = '
'; $str .= ''; $str .=''; $str .=''; $str .='
'; $str .='
'; for($i = 0; $i < 2; $i++){ $button = $buttons[$i]; $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty); $str .= ' '; } $str .= '
'; for($i = 2; $i < count($buttons); $i++){ $button = $buttons[$i]; $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty); $str .= ' '; } $str .='
'; } } return $str; } ?>