pastebin

Paste Search Dynamic
Recent pastes
node add
  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. ?>
Parsed in 0.013 seconds