diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-21 13:47:32 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-21 13:47:32 +0000 |
commit | d1c017660c1b620267fdcdf0a8400fb411c2dd70 (patch) | |
tree | 8401e11dfb9b142f8507d985eb382599c5fa8099 /modules/node | |
parent | ef10abde20c8052ca4dd6eec9ca84b6f74d37a11 (diff) | |
download | brdo-d1c017660c1b620267fdcdf0a8400fb411c2dd70.tar.gz brdo-d1c017660c1b620267fdcdf0a8400fb411c2dd70.tar.bz2 |
- Patch #658364 by effulgentsia: made the build/view/formatter terminology more consistent.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.api.php | 16 | ||||
-rw-r--r-- | modules/node/node.module | 24 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 4 |
3 files changed, 22 insertions, 22 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 6553dab6f..0ec37f42a 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -445,7 +445,7 @@ function hook_node_prepare_translation($node) { * Act on a node being displayed as a search result. * * This hook is invoked from node_search_execute(), after node_load() - * and node_build() have been called. + * and node_view() have been called. * * @param $node * The node being displayed in a search result. @@ -497,7 +497,7 @@ function hook_node_update($node) { * Act on a node being indexed for searching. * * This hook is invoked during search indexing, after node_load(), and after - * the result of node_build() is added as $node->rendered to the node object. + * the result of node_view() is added as $node->rendered to the node object. * * @param $node * The node being indexed. @@ -563,7 +563,7 @@ function hook_node_validate($node, $form) { * @param $node * The node that is being assembled for rendering. * @param $build_mode - * The $build_mode parameter from node_build(). + * The $build_mode parameter from node_view(). */ function hook_node_view($node, $build_mode) { $node->content['my_additional_field'] = array( @@ -574,7 +574,7 @@ function hook_node_view($node, $build_mode) { } /** - * Alter the results of node_build(). + * Alter the results of node_view(). * * This hook is called after the content has been assembled in a structured * array and may be used for doing processing which requires that the complete @@ -588,9 +588,9 @@ function hook_node_view($node, $build_mode) { * @param $build * A renderable array representing the node content. * - * @see node_build() + * @see node_view() */ -function hook_node_build_alter($build) { +function hook_node_view_alter($build) { if ($build['#build_mode'] == 'full' && isset($build['an_additional_field'])) { // Change its weight. $build['an_additional_field']['#weight'] = -10; @@ -990,9 +990,9 @@ function hook_validate($node, &$form) { * by assembling a structured array, formatted as in the Form API, in * $node->content. As with Form API arrays, the #weight property can be * used to control the relative positions of added elements. After this - * hook is invoked, node_build() calls field_attach_view() to add field + * hook is invoked, node_view() calls field_attach_view() to add field * views to $node->content, and then invokes hook_node_view() and - * hook_node_build_alter(), so if you want to affect the final + * hook_node_view_alter(), so if you want to affect the final * view of the node, you might consider implementing one of these hooks * instead. * 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; diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 01f540002..63d818a5f 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -397,8 +397,8 @@ function theme_node_preview($variables) { $preview_trimmed_version = FALSE; - $trimmed = drupal_render(node_build(clone $node, 'teaser')); - $full = drupal_render(node_build($node, 'full')); + $trimmed = drupal_render(node_view(clone $node, 'teaser')); + $full = drupal_render(node_view($node, 'full')); // Do we need to preview trimmed version of post as well as full version? if ($trimmed != $full) { |