You are here

views_plugin_argument_default_node.inc in Views (for Drupal 7) 6.2

Contains the node from URL argument default plugin.

File

modules/node/views_plugin_argument_default_node.inc
View source
<?php

/**
 * @file
 * Contains the node from URL argument default plugin.
 */

/**
 * Default argument plugin to extract a node via menu_get_object
 */
class views_plugin_argument_default_node extends views_plugin_argument_default {
  function argument_form(&$form, &$form_state) {
  }
  function get_argument() {
    foreach (range(1, 3) as $i) {
      $node = menu_get_object('node', $i);
      if (!empty($node)) {
        return $node->nid;
      }
    }
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      return arg(1);
    }
  }

}

Classes

Namesort descending Description
views_plugin_argument_default_node Default argument plugin to extract a node via menu_get_object