comparison sites/all/modules/ctools/plugins/arguments/node_add.inc @ 0:ff03f76ab3fe

initial version
author danieleb <danielebarchiesi@me.com>
date Wed, 21 Aug 2013 18:51:11 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ff03f76ab3fe
1 <?php
2
3 /**
4 * @file
5 *
6 * Plugin to provide an argument handler for a Node add form
7 */
8
9 /**
10 * Plugins are described by creating a $plugin array which will be used
11 * by the system that includes this file.
12 */
13 $plugin = array(
14 'title' => t("Node add form: node type"),
15 // keyword to use for %substitution
16 'keyword' => 'node_type',
17 'description' => t('Creates a node add form context from a node type argument.'),
18 'context' => 'ctools_node_add_context',
19 );
20
21 /**
22 * Discover if this argument gives us the node we crave.
23 */
24 function ctools_node_add_context($arg = NULL, $conf = NULL, $empty = FALSE) {
25 // If unset it wants a generic, unfilled context.
26 if (!isset($arg)) {
27 return ctools_context_create_empty('node_add_form');
28 }
29
30 return ctools_context_create('node_add_form', $arg);
31 }
32