You are here

function flag_plugin_argument_validate_flaggability::validate_form in Flag 6.2

Same name and namespace in other branches
  1. 6 includes/flag_plugin_argument_validate_flaggability.inc \flag_plugin_argument_validate_flaggability::validate_form()

File

includes/flag_plugin_argument_validate_flaggability.inc, line 76
Contains the flaggability validator handler.

Class

flag_plugin_argument_validate_flaggability
Validates whether an argument is a flaggable/flagged object.

Code

function validate_form(&$form, &$form_state) {

  // We call the Views 3 version and add to it the #dependency settings.
  $this
    ->options_form($form, $form_state);
  $form[$this
    ->_option_name('flag_name')] += array(
    // Add an ID to the surrounding div because radios don't get IDs
    // as a whole group. This is needed for #dependency.
    '#prefix' => '<div><div id="edit-options-' . views_css_safe($this
      ->_option_name('flag_name')) . '">',
    '#suffix' => '</div></div>',
    '#process' => array(
      'expand_radios',
      'views_process_dependency',
    ),
  );
  foreach (array(
    'flag_name',
    'flag_test',
    'flag_id_type',
  ) as $option) {
    $form[$this
      ->_option_name($option)] += array(
      '#dependency' => array(
        'edit-options-validate-type' => array(
          $this->id,
        ),
      ),
      '#process' => array(
        'views_process_dependency',
      ),
    );
  }
}