You are here

function hook_visual_select_file_formatter_options_alter in Visual select file 7

Implements hook_visual_select_file_formatter_options_alter().

$options contains #options-like options for a select element. $context contains:

  • 'form' -- the full form array of views_exposed_form().
  • 'form_state' -- the full form_state array of views_exposed_form().
  • 'view' -- the full View object for the current View.
  • 'field' -- the 'vsf_field' string from $_GET, with format 'entity_type.bundle.field_name'.
  • 'default_formatter' (by ref) -- the default selected formatter, defaults to empty (- Choose -).
1 function implements hook_visual_select_file_formatter_options_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

vsf_manualcrop_visual_select_file_formatter_options_alter in submodules/vsf_manualcrop/vsf_manualcrop.module
Implements hook_visual_select_file_formatter_options_alter().
1 invocation of hook_visual_select_file_formatter_options_alter()
vsf_wysiwyg_form_views_exposed_form_alter in submodules/vsf_wysiwyg/vsf_wysiwyg.module
Implements hook_form_FORM_ID_alter() for views_exposed_form().

File

./visual_select_file.api.php, line 14

Code

function hook_visual_select_file_formatter_options_alter(&$options, &$context) {

  // No huge allowed!
  unset($options['huge'], $options['huge_2']);

  // Move 'pagewide' to the very top and select it.
  $options = array(
    'pagewide' => 'pagewide',
  ) + $options;
  $context['default_formatter'] = 'pagewide';
}