You are here

function theme_select_or_other_none in Select (or other) 7.2

Same name and namespace in other branches
  1. 6.2 select_or_other.module \theme_select_or_other_none()
  2. 6 select_or_other.module \theme_select_or_other_none()

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

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

Parameters

$variables: An associative array containing:

  • instance: An array representing the widget requesting the options.
  • option: An array representing the widget requesting the options.
1 theme call to theme_select_or_other_none()
select_or_other_field_widget_form_prepare_options in ./select_or_other.field_widget.inc
Prepare options for the widget list.

File

./select_or_other.module, line 250
The Select (or other) module.

Code

function theme_select_or_other_none($variables) {
  $instance = $variables['instance'];
  $output = '';
  switch ($instance['widget']['type']) {
    case 'select_or_other_buttons':
      $output = t('N/A');
      break;
    case 'select_or_other':
    case 'select_or_other_sort':
      if (!empty($variables['option']) && $variables['option'] == 'option_none') {
        $output = t('- None -');
      }
      else {
        $output = t('- Select a value -');
      }
      break;
  }
  return $output;
}