You are here

function flag_plugin_argument_validate_flaggability::_option_name 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::_option_name()
  2. 7.2 includes/flag_plugin_argument_validate_flaggability.inc \flag_plugin_argument_validate_flaggability::_option_name()

Returns an option's name.

Purpose: insulate us from the difference between Views 3 and Views 2.

2 calls to flag_plugin_argument_validate_flaggability::_option_name()
flag_plugin_argument_validate_flaggability::validate_form in includes/flag_plugin_argument_validate_flaggability.inc
flag_plugin_argument_validate_flaggability::_get_option in includes/flag_plugin_argument_validate_flaggability.inc
Returns an option's value.

File

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

Class

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

Code

function _option_name($option) {
  if (_flag_is_views3()) {
    return $option;
  }
  else {

    // Views 2.
    //
    // We must embed the flag type in the option name or else validators of
    // different types will clash with each other. It's a trait of Views that all
    // validators on the system get their settings lumped onto the argument.
    // Examine the view's 'Export' output to understand.
    return 'validate_argument_' . $this->flag_type . '_' . $option;
  }
}