public static function getStyleSelect($element_name, $selected = '')
{
$styles = $GLOBALS['injector']->getInstance('Ansel_Styles');
// Build the available styles, but don't show hidden styles
foreach ($styles as $key => $style) {
if (empty($style['hide'])) {
$options[$key] = $style['title'];
}
}
// Nothing explicitly selected, use the global pref
if ($selected == '') {
$selected = $GLOBALS['prefs']->getValue('default_gallerystyle');
}
$html = '<select id="' . $element_name . '" name="' . $element_name . '">';
foreach ($options as $key => $option) {
$html .= ' <option value="' . $key . '"' . ($selected == $key ? 'selected="selected"' : '') . '>' . $option . '</option>';
}
return $html .= '</select>';
}