You are here

function theme_select2widget_options_none in Select2 Field Widget 7.2

Same name and namespace in other branches
  1. 7 select2widget.module \theme_select2widget_options_none()

Returns HTML for the label for the empty value that are not required.

The default theme will display N/A for a radio list and '- None -' for a select.

Parameters

array $variables: An associative array containing:

  • instance: An array representing the widget requesting the options.

Return value

string "None" string for select

1 theme call to theme_select2widget_options_none()
_select2widget_options_get_options in ./select2widget.reference.inc
Collects the options for a field.

File

./select2widget.module, line 256

Code

function theme_select2widget_options_none($variables) {
  $instance = $variables['instance'];
  $option = $variables['option'];
  $output = '';
  switch ($instance['widget']['type']) {
    case 'select2widget':
      $output = $option == 'option_none' ? t('- None -') : t('- Select a value -');
      break;
  }
  return $output;
}