You are here

function panels_content_term_description in Panels 6.2

Same name and namespace in other branches
  1. 5.2 content_types/term_description.inc \panels_content_term_description()
1 string reference to 'panels_content_term_description'
panels_term_description_panels_content_types in content_types/term_description.inc
Callback function to supply a list of content types.

File

content_types/term_description.inc, line 20

Code

function panels_content_term_description($subtype, $conf, $panel_args, $context) {
  $term = isset($context->data) ? drupal_clone($context->data) : NULL;
  $block = new stdClass();
  $block->module = 'node_type';
  $block->subject = $term->name;
  if ($term) {
    $block->content = _filter_autop(filter_xss_admin($term->description));
    $block->delta = $term->tid;
    if (user_access('administer taxonomy')) {
      $block->admin_links['update'] = array(
        'title' => t('Edit term'),
        'alt' => t("Edit this term"),
        'href' => "admin/content/taxonomy/edit/term/{$term->tid}",
        'query' => drupal_get_destination(),
      );
    }
  }
  else {
    $block->content = t('Term description goes here.');
    $block->delta = 'unknown';
  }
  return $block;
}