chameleon_node

Versions
4.6
chameleon_node($node, $main = 0, $page = 0)
4.7 – 6
chameleon_node($node, $teaser = 0, $page = 0)

Code

themes/chameleon/chameleon.theme, line 114

<?php
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";

  $submitted = theme_get_setting("toggle_node_info_$node->type") ? array(t("By %author at %date", array('%author' => theme('username', $node), '%date' => format_date($node->created, 'small')))) : array();

  $terms = array();
  if (module_exist('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) ."</div>\n";
  }

  $output .= "</div>\n";

  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.