You are here

function flag_views_arguments in Flag 5

Give an argument handler to limit nodes to those flagged by a uid.

File

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

Code

function flag_views_arguments() {
  $flags = flag_get_flags();
  foreach ($flags as $flag) {
    $argument = array(
      'name' => t("Flags '@s' for UID", array(
        '@s' => $flag
          ->get_title(),
      )),
      'handler' => "flag_arg_uid",
      'help' => t("This argument allows users to filter a view to nodes flagged with the '%s' flag for the specified user.", array(
        "%s" => $flag
          ->get_title(),
      )),
      'table' => "flag_content_" . $flag->name,
    );
    $arguments["flag_content_" . $flag->name] = $argument;
  }
  return $arguments;
}