|
|
Drupal example source code file (views_plugin_argument_default_node.inc)
The views_plugin_argument_default_node.inc Drupal example source code<?php // $Id: views_plugin_argument_default_node.inc,v 1.1 2008/09/03 19:21:29 merlinofchaos Exp $ /** * @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); } } } Other Drupal examples (source code examples)Here is a short list of links related to this Drupal views_plugin_argument_default_node.inc source code file: |
"Drupal" is a registered trademark of Dries Buytaert.
my drupal tutorials and examples
Copyright
1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.
Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.