diff options
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index a55fd039a..b0ed0c736 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1173,7 +1173,7 @@ function node_revision_delete($revision_id) { * @return * An array as expected by drupal_render(). */ -function node_build($node, $build_mode = 'full') { +function node_view($node, $build_mode = 'full') { // Populate $node->content with a render() array. node_build_content($node, $build_mode); @@ -1191,7 +1191,7 @@ function node_build($node, $build_mode = 'full') { $build['#contextual_links']['node'] = array('node', array($node->nid)); // Allow modules to modify the structured node. - drupal_alter('node_build', $build); + drupal_alter('node_view', $build); return $build; } @@ -1232,7 +1232,7 @@ function node_build_content($node, $build_mode = 'full') { } // Build fields content. - // @todo field_attach_prepare_view() is only invoked by node_build_multiple(), + // @todo field_attach_prepare_view() is only invoked by node_view_multiple(), // all other entities invoke it _here_. //field_attach_prepare_view('node', array($node->nid => $node), $build_mode); $node->content += field_attach_view('node', $node, $build_mode); @@ -1321,8 +1321,8 @@ function node_show($node, $message = FALSE) { // Update the history table, stating that this user viewed this node. node_tag_new($node->nid); - // For markup consistency with other pages, use node_build_multiple() rather than node_build(). - return node_build_multiple(array($node->nid => $node), 'full'); + // For markup consistency with other pages, use node_view_multiple() rather than node_view(). + return node_view_multiple(array($node->nid => $node), 'full'); } /** @@ -1582,7 +1582,7 @@ function node_search_execute($keys = NULL) { foreach ($find as $item) { // Render the node. $node = node_load($item->sid); - $build = node_build($node, 'search_result'); + $build = node_view($node, 'search_result'); unset($build['#theme']); $node->rendered = drupal_render($build); @@ -2089,7 +2089,7 @@ function node_feed($nids = FALSE, $channel = array()) { // The node gets built and modules add to or modify $node->rss_elements // and $node->rss_namespaces. - $build = node_build($node, 'rss'); + $build = node_view($node, 'rss'); unset($build['#theme']); if (!empty($node->rss_namespaces)) { @@ -2136,11 +2136,11 @@ function node_feed($nids = FALSE, $channel = array()) { * @return * An array in the format expected by drupal_render(). */ -function node_build_multiple($nodes, $build_mode = 'teaser', $weight = 0) { +function node_view_multiple($nodes, $build_mode = 'teaser', $weight = 0) { field_attach_prepare_view('node', $nodes, $build_mode); $build = array(); foreach ($nodes as $node) { - $build['nodes'][$node->nid] = node_build($node, $build_mode); + $build['nodes'][$node->nid] = node_view($node, $build_mode); $build['nodes'][$node->nid]['#weight'] = $weight; $weight++; } @@ -2166,7 +2166,7 @@ function node_page_default() { if (!empty($nids)) { $nodes = node_load_multiple($nids); - $build = node_build_multiple($nodes); + $build = node_view_multiple($nodes); $feed_url = url('rss.xml', array('absolute' => TRUE)); drupal_add_feed($feed_url, variable_get('site_name', 'Drupal') . ' ' . t('RSS')); @@ -2247,7 +2247,7 @@ function _node_index_node($node) { variable_set('node_cron_last', $node->changed); // Render the node. - $build = node_build($node, 'search_index'); + $build = node_view($node, 'search_index'); unset($build['#theme']); $node->rendered = drupal_render($build); @@ -3215,7 +3215,7 @@ function node_unpublish_by_keyword_action_submit($form, $form_state) { */ function node_unpublish_by_keyword_action($node, $context) { foreach ($context['keywords'] as $keyword) { - if (strpos(drupal_render(node_build(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) { + if (strpos(drupal_render(node_view(clone $node)), $keyword) !== FALSE || strpos($node->title, $keyword) !== FALSE) { $node->status = NODE_NOT_PUBLISHED; watchdog('action', 'Set @type %title to unpublished.', array('@type' => node_type_get_name($node), '%title' => $node->title[LANGUAGE_NONE][0]['value'])); break; |