diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-11-07 13:35:21 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-11-07 13:35:21 +0000 |
commit | a8ec4e1d505c705ed891212cbf9149c71e4e0a31 (patch) | |
tree | 9784ad6ba7f1777614cc5de9221833f3072f9d94 /modules/node/node.api.php | |
parent | 803bd4f968f2d2e16c379cb915bc4fd75088bb6d (diff) | |
download | brdo-a8ec4e1d505c705ed891212cbf9149c71e4e0a31.tar.gz brdo-a8ec4e1d505c705ed891212cbf9149c71e4e0a31.tar.bz2 |
- Patch #607244 by sun: added permission to decrease performance impact of contextual links.
Diffstat (limited to 'modules/node/node.api.php')
-rw-r--r-- | modules/node/node.api.php | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/node/node.api.php b/modules/node/node.api.php index fc967e3ef..d922d9b47 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -540,9 +540,9 @@ function hook_node_view(stdClass $node, $build_mode) { } /** - * The node content was built, the module may modify the structured content. + * The node content was built; the module may modify the structured content. * - * This hook is called after the content has been assembled in $node->content + * 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 node * content structure has been built. * @@ -551,20 +551,19 @@ function hook_node_view(stdClass $node, $build_mode) { * Alternatively, it could also implement hook_preprocess_node(). See * drupal_render() and theme() documentation respectively for details. * - * @param $node - * The node the action is being performed on. - * @param $build_mode - * The $build_mode parameter from node_build(). + * @param $build + * A renderable array representing the node content. + * + * @see node_build() */ -function hook_node_build_alter(stdClass $node, $build_mode) { - // Check for the existence of a field added by another module. - if (isset($node->content['an_additional_field'])) { +function hook_node_build_alter($build) { + if ($build['#build_mode'] == 'full' && isset($build['an_additional_field'])) { // Change its weight. - $node->content['an_additional_field']['#weight'] = -10; + $build['an_additional_field']['#weight'] = -10; } // Add a #post_render callback to act on the rendered HTML of the node. - $node->content['#post_render'][] = 'my_module_node_post_render'; + $build['#post_render'][] = 'my_module_node_post_render'; } /** |