/[drupal]/drupal/modules/comment/comment.api.php
ViewVC logotype

Diff of /drupal/modules/comment/comment.api.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.12, Sat Oct 10 13:37:09 2009 UTC revision 1.13, Sat Nov 7 13:35:20 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: comment.api.php,v 1.11 2009/08/17 13:10:45 webchick Exp $  // $Id: comment.api.php,v 1.12 2009/10/10 13:37:09 dries Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 73  function hook_comment_view($comment) { Line 73  function hook_comment_view($comment) {
73  }  }
74    
75  /**  /**
76     * The comment was built; the module may modify the structured content.
77     *
78     * This hook is called after the content has been assembled in a structured array
79     * and may be used for doing processing which requires that the complete comment
80     * content structure has been built.
81     *
82     * If the module wishes to act on the rendered HTML of the comment rather than the
83     * structured content array, it may use this hook to add a #post_render callback.
84     * Alternatively, it could also implement hook_preprocess_comment(). See
85     * drupal_render() and theme() documentation respectively for details.
86     *
87     * @param $build
88     *   A renderable array representing the comment.
89     *
90     * @see comment_build()
91     */
92    function hook_comment_build_alter($build) {
93      // Check for the existence of a field added by another module.
94      if ($build['#build_mode'] == 'full' && isset($build['an_additional_field'])) {
95        // Change its weight.
96        $build['an_additional_field']['#weight'] = -10;
97      }
98    
99      // Add a #post_render callback to act on the rendered HTML of the comment.
100      $build['#post_render'][] = 'my_module_comment_post_render';
101    }
102    
103    /**
104   * The comment is being published by the moderator.   * The comment is being published by the moderator.
105   *   *
106   * @param $comment   * @param $comment

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.2