You are here

function _find_view_arguments in View Alias 6.2

Same name and namespace in other branches
  1. 7 view_alias.module \_find_view_arguments()

helper to dig out the view arguments.

1 call to _find_view_arguments()
_get_aliasable_displays in ./view_alias.module
find the views that can be aliased. that means have a path url and use a term id as an argument build and array of objects, keyed with the view name, having the view path, and the vocab id for the terms used array( 0 => object…

File

./view_alias.module, line 243
Hook implementations for view alias module integration.

Code

function _find_view_arguments($display) {

  // No arguments?  Return FALSE.
  if (empty($display->display_options['arguments'])) {
    return FALSE;
  }

  // Scan the display for the first term arg.
  // (No multiple argument support, yet)
  $view_args = FALSE;
  foreach ($display->display_options['arguments'] as $arg_name => $argument) {

    // If we don't support all arguments, we can't create an alias.
    if ($argument['validate_type'] != 'taxonomy_term') {
      return FALSE;
    }
    $active_vocabularies = array_filter($argument['validate_argument_vocabulary']);
    $view_args = implode(',', $active_vocabularies);
  }
  return $view_args ? $view_args : FALSE;
}