--- signup.module 2010-01-14 15:13:05.000000000 -0600 +++ signup.module.fixed 2010-01-14 15:05:01.000000000 -0600 @@ -1624,19 +1624,22 @@ function _signup_get_cancel_link($sid) { } /** - * Implementation of hook_panels_include_directory(). + * Implementation of hook_ctools_plugin_directory(). * - * @param $plugin_type + * @param $module + * The ctools module requesting the location of the plugin include directory. + * @param $plugin * The plugin type for which the Panels engine is currently requesting the * location of an include directory. * + * * @return * The location of the include directory for plugin type being requested, * relative to the base directory of the module implementing this hook. */ -function signup_panels_include_directory($plugin_type) { - if ($plugin_type == 'content_types') { - return 'panels/'. $plugin_type; +function signup_ctools_plugin_directory($module, $plugin_type) { + if ($module == 'ctools' && $plugin_type == 'content_types') { + return 'panels/'. $plugin; // TODO : rename panels directory to plugins } } --- panels/content_types/signup_form.inc 2010-01-13 23:17:27.000000000 -0600 +++ panels/content_types/signup_form.inc.fixed 2010-01-14 15:04:17.000000000 -0600 @@ -3,34 +3,19 @@ /** - * Supply a list of panels content types. + * Return an instance of the signup_form content type. */ -function signup_signup_form_panels_content_types() { - $items['signup_form'] = array( +function signup_signup_form_ctools_content_types() { + return array( 'title' => t('Signup form'), - 'content_types' => 'signup_panels_content_types_signup_form', + 'content_types' => 'signup_form', 'single' => TRUE, - 'render callback' => 'signup_panels_content_signup_form', - 'add callback' => 'signup_panels_edit_signup_form', - 'edit callback' => 'signup_panels_edit_signup_form', - 'title callback' => 'signup_panels_title_signup_form', - ); - return $items; -} - -/** - * Return all content types available. - */ -function signup_panels_content_types_signup_form() { - return array( - 'signup_form' => array( - 'title' => t('Signup form'), - 'icon' => 'icon_node.png', // TODO: choose different icon - 'path' => panels_get_path('content_types/node'), // TODO: adjust path - 'description' => t('Signup form.'), - 'required context' => new panels_required_context(t('Node'), 'node'), - 'category' => array(t('Contributed modules'), 0), - ), + 'render callback' => 'signup_signup_form_content_type_render', + 'icon' => 'icon_node.png', // TODO: choose different icon + 'description' => t('Signup form'), + 'required context' => new ctools_context_required(t('Node'), 'node'), + 'edit form' => 'signup_signup_form_content_type_edit_form', + 'category' => t('Contributed modules'), ); } @@ -39,16 +24,18 @@ function signup_panels_content_types_sig * * Outputs the signup form based on a given nid, as provided by the $context. */ -function signup_panels_content_signup_form($subtype, $conf, $panel_args, &$context) { +function signup_signup_form_content_type_render($subtype, $conf, $panel_args, &$context) { $node = isset($context->data) ? drupal_clone($context->data) : NULL; $block = new stdClass(); $block->module = 'signup'; $block->subject = ''; - if (empty($node)) { + + // Check to see if we need to display the form; otherwise, return empty + if (empty($node) || !_signup_needs_output($node)) { $block->delta = 0; $block->content = ''; } - else { + else { $block->delta = $node->nid; module_load_include('inc', 'signup', 'includes/node_output'); $block->content = _signup_node_output($node); @@ -59,7 +46,7 @@ function signup_panels_content_signup_fo /** * Return an edit form for the signup form content type. */ -function signup_panels_edit_signup_form($id, $parents, $conf = array()) { +function signup_signup_form_content_type_edit_form($id, $parents, $conf = array()) { $form['id'] = array( '#type' => 'value', '#value' => $id, @@ -67,11 +54,4 @@ function signup_panels_edit_signup_form( return $form; } -/** - * Return the administrative title for a signup form pane. - */ -function signup_panels_title_signup_form($subtype, $conf, $context) { - $choices = signup_panels_content_types_signup_form(); - return t('"@s" @type', array('@s' => $context->identifier, '@type' => drupal_strtolower($choices[$conf['id']]['title']))); -}