* Name: color_options
* Input:
* - name (optional) - string default "color"
* - selected (optional) - string default not set
* @author andsky
* @param array
* @param Smarty
* @return string
*/
function smarty_function_color_options($params, &$smarty)
{
$name = empty( $params['name'] ) ? 'color' : $params['name'];
$colors=array(
"skyblue",
"royalblue",
"blue",
"darkblue",
"orange",
"orangered",
"crimson",
"red",
"firebrick",
"darkred",
"green",
"limegreen",
"seagreen",
"teal",
"deeppink",
"tomato",
"coral",
"purple",
"indigo",
"burlywood",
"sandybrown",
"sienna",
"chocolate",
"silver"
);
$_html_result = ''."\n";
foreach ($colors as $c){
$sel = '';
if ( isset($params['selected']) && $params['selected'] == $c )
{
$sel = ' selected="selected"';
}
$_html_result .= "\n";
}
$_html_result = '' . "\n" . $_html_result . '' . "\n";
return $_html_result;
}
?>