commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / views / modules / book / views_plugin_argument_default_book_root.inc
1 <?php
2 /**
3 * @file
4 * Contains the book root from current node argument default plugin.
5 */
6
7 /**
8 * Default argument plugin to get the current node's book root.
9 */
10 class views_plugin_argument_default_book_root extends views_plugin_argument_default_node {
11 function get_argument() {
12 // Use the argument_default_node plugin to get the nid argument.
13 $nid = parent::get_argument();
14 if (!empty($nid)) {
15 $node = node_load($nid);
16 if (isset($node->book['bid'])) {
17 return $node->book['bid'];
18 }
19 }
20 }
21 }