Commit 58ba3b6e authored by Dries's avatar Dries
Browse files

- Rollback of previous patch. Houston, it has a typo.

parent 6d1774c7
......@@ -67,7 +67,7 @@ function blog_form($node, $form_state) {
* Implements hook_view().
*/
function blog_view($node, $build_mode) {
if (node_is_page($node)) {
if ((bool)menu_get_object()) {
// Breadcrumb navigation.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => format_username($node))), 'blog/' . $node->uid)));
}
......
......@@ -577,7 +577,8 @@ function comment_node_view($node, $build_mode) {
// page. We compare $node and $page_node to ensure that comments are not
// appended to other nodes shown on the page, for example a node_reference
// displayed in 'full' build mode within another node.
if ($node->comment && node_is_page($node) && empty($node->in_preview) && user_access('access comments')) {
$page_node = menu_get_object();
if ($node->comment && isset($page_node->nid) && $page_node->nid == $node->nid && empty($node->in_preview) && user_access('access comments')) {
$node->content['comments'] = comment_node_page_additions($node);
}
}
......
......@@ -239,7 +239,7 @@ function forum_node_view($node, $build_mode) {
$vid = variable_get('forum_nav_vocabulary', 0);
$vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_node_check_node_type($node)) {
if (node_is_page($node)) {
if ((bool)menu_get_object()) {
// Breadcrumb navigation
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb[] = l($vocabulary->name, 'forum');
......
......@@ -999,7 +999,7 @@ function hook_validate($node, &$form) {
* For a detailed usage example, see node_example.module.
*/
function hook_view($node, $build_mode = 'full') {
if (node_is_page($node)) {
if ((bool)menu_get_object()) {
$breadcrumb = array();
$breadcrumb[] = array('path' => 'example', 'title' => t('example'));
$breadcrumb[] = array('path' => 'example/' . $node->field1,
......
......@@ -1325,17 +1325,6 @@ function node_show($node, $message = FALSE) {
return node_build_multiple(array($node->nid => $node), 'full');
}
/**
* Returns whether the current page is the full page view of the passed in node.
*
* @param $node
* A node object.
*/
function node_is_page($node) {
$page_node = menu_get_object();
return (empty($page_node) ? $page_node->nid == $node->nid : FALSE);
}
/**
* Process variables for node.tpl.php
*
......@@ -1361,7 +1350,7 @@ function template_preprocess_node(&$variables) {
$variables['name'] = theme('username', array('account' => $node));
$variables['node_url'] = url('node/' . $node->nid);
$variables['node_title'] = check_plain($node->title[LANGUAGE_NONE][0]['value']);
$variables['page'] = node_is_page($node);
$variables['page'] = (bool)menu_get_object();
if (!empty($node->in_preview)) {
unset($node->content['links']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment