5 Modification information for LGPL compliance
7 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
11 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
13 r53865 - 2010-01-19 21:51:54 -0800 (Tue, 19 Jan 2010) - lam - updated styles for button slider
15 r53792 - 2010-01-18 13:37:35 -0800 (Mon, 18 Jan 2010) - roger - adding code to support slider buttons.
22 * smarty_function_sugar_button
23 * This is the constructor for the Smarty plugin.
25 * @param $params The runtime Smarty key/value arguments
26 * @param $smarty The reference to the Smarty object used in this invocation
28 function smarty_function_sugar_button_slider($params, &$smarty)
30 if(empty($params['module'])) {
31 $smarty->trigger_error("sugar_button_slider: missing required param (module)");
32 } else if(empty($params['buttons'])) {
33 $smarty->trigger_error("sugar_button_slider: missing required param (buttons)");
34 } else if(empty($params['view'])) {
35 $smarty->trigger_error("sugar_button_slider: missing required param (view)");
37 $module = $params['module'];
38 $view = $params['view'];
39 $buttons = $params['buttons'];
41 if(is_array($buttons)) {
42 if(count($buttons) <= 2){
43 foreach($buttons as $val => $button){
44 $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty);
47 $str = '<div id="buttonSlide" class="yui-module">';
48 $str .= '<table border="0">';
50 $str .='<div class="yui-hd">';
51 for($i = 0; $i < 2; $i++){
52 $button = $buttons[$i];
53 $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty);
56 $str .= '</div></td>';
57 $str .='<td align="right"> <div class="yui-bd">';
58 for($i = 2; $i < count($buttons); $i++){
59 $button = $buttons[$i];
60 $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty);
64 $str .='</tr></table>';