You are here

function chameleon_node in Drupal 5

Same name and namespace in other branches
  1. 4 themes/chameleon/chameleon.theme \chameleon_node()
  2. 6 themes/chameleon/chameleon.theme \chameleon_node()

File

themes/chameleon/chameleon.theme, line 121
A slim, CSS-driven theme which does not depend on a template engine like phptemplate

Code

function chameleon_node($node, $teaser = 0, $page = 0) {
  $output = "<div class=\"node" . (!$node->status ? ' node-unpublished' : '') . "\">\n";
  if (!$page) {
    $output .= " <h2 class=\"title\">" . ($teaser ? l($node->title, "node/{$node->nid}") : check_plain($node->title)) . "</h2>\n";
  }
  $output .= " <div class=\"content\">\n";
  if ($teaser && $node->teaser) {
    $output .= $node->teaser;
  }
  else {
    $output .= $node->body;
  }
  $output .= " </div>\n";
  if (theme_get_setting("toggle_node_info_{$node->type}")) {
    $submitted['node_submitted'] = array(
      'title' => t("By !author at @date", array(
        '!author' => theme('username', $node),
        '@date' => format_date($node->created, 'small'),
      )),
      'html' => TRUE,
    );
  }
  else {
    $submitted['node_submitted'] = array();
  }
  $terms = array();
  if (module_exists('taxonomy')) {
    $terms = taxonomy_link("taxonomy terms", $node);
  }
  $links = array_merge($submitted, $terms);
  if ($node->links) {
    $links = array_merge($links, $node->links);
  }
  if (count($links)) {
    $output .= '<div class="links">' . theme('links', $links, array(
      'class' => 'links inline',
    )) . "</div>\n";
  }
  $output .= "</div>\n";
  return $output;
}