You are here

function flag_views_flag_config_form in Flag 7.2

Same name and namespace in other branches
  1. 6.2 includes/flag.views.inc \flag_views_flag_config_form()
  2. 6 includes/flag.views.inc \flag_views_flag_config_form()
  3. 7.3 includes/views/flag.views.inc \flag_views_flag_config_form()

A helper function that creates a radio list of available flags.

This function is used to select the desired flag when setting up flag relationships and fields.

3 calls to flag_views_flag_config_form()
flag_handler_relationship_content::options_form in includes/flag_handler_relationships.inc
Provide the label widget that all fields should have.
flag_handler_relationship_counts::options_form in includes/flag_handler_relationships.inc
Provide the label widget that all fields should have.
flag_handler_relationship_user_content::options_form in includes/flag_handler_relationships.inc
Provide the label widget that all fields should have.

File

includes/flag.views.inc, line 226
Provides support for the Views module.

Code

function flag_views_flag_config_form($form_type, $content_type, $current_flag) {
  $flags = flag_get_flags($content_type);
  $options = array();
  foreach ($flags as $flag) {
    $options[$flag->name] = $flag
      ->get_title();
  }
  $form = array(
    '#type' => $form_type,
    '#title' => t('Flag'),
    '#options' => $options,
    '#default_value' => $current_flag,
    '#required' => TRUE,
  );
  return $form;
}