t('Node links'), 'single' => TRUE, // only provides a single content type 'content_types' => 'panels_admin_content_types_node_links', 'render callback' => 'panels_content_node_links', // 'add callback' => 'panels_admin_edit_node_links', // 'edit callback' => 'panels_admin_edit_node_links', 'title callback' => 'panels_admin_title_node_links', ); return $items; } /** * Fetch the node's links */ function panels_admin_node_links($node, $conf) { $node->links = module_invoke_all('link', 'node', $node, $teaser); foreach (module_implements('link_alter') AS $module) { $function = $module .'_link_alter'; $function($node, $node->links); } } /** * Output function for the 'node' content type. Outputs a node * based on the module and delta supplied in the configuration. */ function panels_content_node_links($conf, $panel_args, $context) { $node = isset($context->data) ? drupal_clone($context->data) : NULL; $block->module = 'node'; $block->subject = t('Node links'); if ($node) { $block->content = panels_admin_node_links($node, $conf); $block->delta = $node->nid; } else { $block->content = t('Node links go here.'); $block->delta = 'unknown'; } return $block; } /** * Return all content types available. */ function panels_admin_content_types_node_links() { return array( 'node_type' => array( 'title' => t('Node links'), 'icon' => 'icon_node.png', 'path' => panels_get_path('content_types/node'), 'description' => t('The links rendered on a node.'), 'required context' => new panels_required_context(t('Node'), 'node'), 'category' => array(t('Node context'), -9), ), ); } function panels_admin_title_node_links($conf, $context) { return t('"@s" links', array('@s' => $context->identifier)); }