public static function dropdown($data, $options = NULL, $selected = NULL, $extra = '') { $selected = self::get_value($data, $selected); if (!empty($data['multiple']) and substr($data['name'], -2) != '[]') { $data['name'] = $data['name'] . '[]'; } return parent::dropdown($data, $options, $selected, $extra); }
/** * Creates an HTML form select tag, or "dropdown menu". * * @param string|array input name or an array of HTML attributes * @param array select options, when using a name * @param string option key that should be selected by default * @param string a string to be attached to the end of the attributes * @return string */ public static function dropdown($data, $options = NULL, $selected = NULL, $extra = '') { // Add the Bluebox defaults (such as css classes) list($data, $options, $selected, $extra) = self::_addDefaults(__FUNCTION__, $data, $options, $selected, $extra); if (!empty($data['translate'])) { foreach ($options as $key => $value) { $options[$key] = self::_i18n($value); } } if (isset($data['translate'])) { unset($data['translate']); } // Call the parent $result = parent::dropdown($data, $options, $selected, $extra); return $result; }