You are here

function faqpanels_faq_term in Panels Extras 7

Same name and namespace in other branches
  1. 6 faqpanels/plugins/tasks/faq_term.inc \faqpanels_faq_term()

Entry point for our overridden cck email generated contact form page.

This function asks its assigned handlers who, if anyone, would like to run with it. If no one does, it passes through to CCK email field, which is email_mail_page().

1 string reference to 'faqpanels_faq_term'
faqpanels_faq_term_menu_alter in faqpanels/plugins/tasks/faq_term.inc
Callback defined by faqpanels_faq_term_page_manager_tasks().

File

faqpanels/plugins/tasks/faq_term.inc, line 119
Provides additional page manager tasks FAQ page for panels use

Code

function faqpanels_faq_term($tid = 0, $faq_display = '') {

  // Load my task plugin
  $task = page_manager_get_task('faq_term');
  ctools_include('context');
  ctools_include('context-task-handler');

  // @todo add ability to accept the node and field name context; well maybe just the node context
  // is it worth the performance hit to include node as a context? if so switch

  //$contexts = faqpanels_faq_term_get_contexts($task, '', array($nid));
  $contexts = faqpanels_faq_term_get_contexts($task, '', array());
  $output = ctools_context_handler_render($task, '', $contexts, array(
    'tid' => $tid,
    'faq_display' => $faq_display,
  ));
  if ($output !== FALSE) {
    return $output;
  }

  // fallback to the default email contact form page handler
  // assume the cck email module is on.
  $function = 'faq_page';
  foreach (module_implements('page_manager_override') as $module) {
    $call = $module . '_page_manager_override';
    if (($rc = $call('faq_term')) && function_exists($rc)) {
      $function = $rc;
      break;
    }
  }

  // Otherwise, fall back.
  return $function($tid, $faq_display);
}