xtemplate_node

Versions
4.6
xtemplate_node($node, $main = 0, $page = 0)

Code

themes/engines/xtemplate/xtemplate.engine, line 38

<?php
function xtemplate_node($node, $main = 0, $page = 0) {
  global $xtemplate;

  $xtemplate->template->assign(array(
        "submitted" => theme_get_setting("toggle_node_info_$node->type") ?
                         t("Submitted by %a on %b.",
                           array("%a" => format_name($node),
                            "%b" => format_date($node->created))) : '',
        "link"      => url("node/$node->nid"),
        "title"     => check_plain($node->title),
        "author"    => format_name($node),
        "date"      => format_date($node->created),
        "sticky"    => ($main && $node->sticky) ? 'sticky' : '',
        "content"   => ($main && $node->teaser) ? $node->teaser : $node->body));

  if ($page == 0) {
    $xtemplate->template->parse("node.title");
  }

  if (theme_get_setting('toggle_node_user_picture') && $picture = theme('user_picture', $node)) {
    $xtemplate->template->assign("picture", $picture);
    $xtemplate->template->parse("node.picture");
  }

  if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {
    $xtemplate->template->assign("taxonomy", theme_links($taxonomy));
    $xtemplate->template->parse("node.taxonomy");
  }

  if ($node->links) {
    $xtemplate->template->assign("links", theme_links($node->links));
    $xtemplate->template->parse("node.links");
  }

  $xtemplate->template->parse("node");
  $output = $xtemplate->template->text("node");
  $xtemplate->template->reset("node");
  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.