book_node_visitor_html_pre

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/book/book.module, строка 782

Версии
5
book_node_visitor_html_pre($node, $depth, $nid)

Generates printer-friendly HTML for a node. This function is a 'pre-node' visitor function for book_recurse().

Параметры

$node

  • the node to generate output for.
$depth
  • the depth of the given node in the hierarchy. This
is used only for generating output.

$nid

  • the node id (nid) of the given node. This
is used only for generating output.

Возвращаемое значение

  • the HTML generated for the given node.

▾ 1 функция вызывает book_node_visitor_html_pre()

book_recurse in modules/book/book.module
Traverses the book tree. Applies the $visit_pre() callback to each node, is called recursively for each child of the node (in weight, title order). Finally appends the output of the $visit_post() callback to the output before returning the generated...

Код

<?php
function book_node_visitor_html_pre($node, $depth, $nid) {
  // Remove the delimiter (if any) that separates the teaser from the body.
  $node->body = str_replace('<!--break-->', '', $node->body);

  // The 'view' hook can be implemented to overwrite the default function
  // to display nodes.
  if (node_hook($node, 'view')) {
    $node = node_invoke($node, 'view', FALSE, FALSE);
  }
  else {
    $node = node_prepare($node, FALSE);
  }

  // Allow modules to make their own additions to the node.
  node_invoke_nodeapi($node, 'print');

  $output .= "<div id=\"node-". $node->nid ."\" class=\"section-$depth\">\n";
  $output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n";
  $output .= drupal_render($node->content);

  return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему