| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: node_edit.inc,v 1.5.2.3 2010/01/29 20:18:25 merlinofchaos Exp $ 3 4 /** 5 * @file 6 * 7 * Plugin to provide an argument handler for a Node edit form 8 */ 9 10 /** 11 * Plugins are described by creating a $plugin array which will be used 12 * by the system that includes this file. 13 */ 14 $plugin = array( 15 'title' => t("Node edit form: node ID"), 16 // keyword to use for %substitution 17 'keyword' => 'node', 18 'description' => t('Creates a node edit form context from a node ID argument.'), 19 'context' => 'ctools_node_edit_context', 20 'placeholder form' => array( 21 '#type' => 'textfield', 22 '#description' => t('Enter the node ID of a node for this argument'), 23 ), 24 ); 25 26 /** 27 * Discover if this argument gives us the node we crave. 28 */ 29 function ctools_node_edit_context($arg = NULL, $conf = NULL, $empty = FALSE) { 30 // If unset it wants a generic, unfilled context. 31 if ($empty) { 32 return ctools_context_create_empty('node_edit_form'); 33 } 34 35 // We can accept either a node object or a pure nid. 36 if (is_object($arg)) { 37 return ctools_context_create('node_edit_form', $arg); 38 } 39 40 if (!is_numeric($arg)) { 41 return FALSE; 42 } 43 44 $node = node_load($arg); 45 if (!$node) { 46 return NULL; 47 } 48 49 // This will perform a node_access check, so we don't have to. 50 return ctools_context_create('node_edit_form', $node); 51 } 52
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |