1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Plugin to provide an argument handler for a Node add form.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Plugins are described by creating a $plugin array which will be used
|
10
|
* by the system that includes this file.
|
11
|
*/
|
12
|
$plugin = array(
|
13
|
'title' => t("Node add form: node type"),
|
14
|
// Keyword to use for %substitution.
|
15
|
'keyword' => 'node_type',
|
16
|
'description' => t('Creates a node add form context from a node type argument.'),
|
17
|
'context' => 'ctools_node_add_context',
|
18
|
);
|
19
|
|
20
|
/**
|
21
|
* Discover if this argument gives us the node we crave.
|
22
|
*/
|
23
|
function ctools_node_add_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
24
|
// If unset it wants a generic, unfilled context.
|
25
|
if (!isset($arg)) {
|
26
|
return ctools_context_create_empty('node_add_form');
|
27
|
}
|
28
|
|
29
|
return ctools_context_create('node_add_form', $arg);
|
30
|
}
|