views_plugin_argument_default_url_path.inc in Views URL Path Arguments 7
Contains the 'url path alias' default argument plugin.
File
views_plugin_argument_default_url_path.incView source
<?php
/**
* @file
* Contains the 'url path alias' default argument plugin.
*/
/**
* Default argument plugin to convert a nid to its url path
*/
class views_plugin_argument_default_url_path extends views_plugin_argument_default {
/**
* Returns the default argument.
*/
function get_argument() {
// By default provide a views default argument of 'all'.
// If this value is received, the filter will be ignored; i.e, "all values".
$return = 'all';
// Grab the last value from the url.
$arg = arg();
$arg = array_pop($arg);
$arg = check_plain($arg);
// Is it already the nid?
if (ctype_digit($arg)) {
$return = $arg;
}
elseif ($nid = drupal_lookup_path('source', $arg)) {
$return = $nid;
}
return $return;
}
}
Classes
Name | Description |
---|---|
views_plugin_argument_default_url_path | Default argument plugin to convert a nid to its url path |