[Fusionforge-general] [PATCH] Add hooks in projects stats

Julien Heyman julien.heyman at atosorigin.com
Thu Apr 2 12:08:03 CEST 2009


Ok, I change it.

diff --git a/gforge/www/stats/site_stats_utils.php 
b/gforge/www/stats/site_stats_utils.php
index 923014e..026b808 100644
--- a/gforge/www/stats/site_stats_utils.php
+++ b/gforge/www/stats/site_stats_utils.php
@@ -276,6 +276,7 @@ function stats_site_projects( $report, $orderby, 
$projects, $trove ) {
             <?php if ($GLOBALS['sys_use_scm']) { ?>
             <td colspan="3"><strong><?php echo _('CVS'); ?></strong></td>
             <?php } ?>
+            <?php plugin_hook('stats_header_table'); ?>
         </tr>
 
         <?php
@@ -317,6 +318,7 @@ function stats_site_projects( $report, $orderby, 
$projects, $trove ) {
             <td><a href="<?php echo $uri_string; ?>cvs_commits"><?php 
echo _('Commits'); ?></a></td>
             <td><a href="<?php echo $uri_string; ?>cvs_adds"><?php echo 
_('Adds'); ?></a></td>
             <?php } ?>
+            <?php plugin_hook('stats_detail_header_table'); ?>
             </tr>
         <?php
    
@@ -348,6 +350,9 @@ function stats_site_projects( $report, $orderby, 
$projects, $trove ) {
                 . '<td>&nbsp;&nbsp;' . number_format( 
$row["cvs_commits"],0 ) . '</td>'
                 . '<td>&nbsp;&nbsp;' . number_format( 
$row["cvs_adds"],0 ) . '</td>';
             }
+            $hook_params = array();
+            $hook_params['group_id'] = $row["group_id"];
+            plugin_hook('stats_data',$hook_params);
             print '</tr>' . "\n";
             $i++;
             $sum = stats_util_sum_array( $sum, $row );
-- 
1.6.0.4

Roland Mas a écrit :
> Julien Heyman, 2009-03-31 11:25:23 +0200 :
>
> [...]
>
>   
>> +			<?php plugin_hook('stats_header1'); ?>
>>     
>
> [...]
>
>   
>> +			<?php plugin_hook('stats_header2'); ?>
>>     
>
> I'm generally fine with the patch, although I'd prefer if the hook names
> were a bit more descriptive.  Something like 'stats_header_before_scm'
> and 'stats_header_after_scm' for instance (or something more accurate, I
> didn't read the whole file in detail :-)
>
> Roland.
>   

-- 
Julien HEYMAN
Open Source Center - Atos Origin
www.portaildulibre.fr

Les Miroirs - 18 avenue d'Alsace
92926 Paris La Défense CEDEX
Tél : +33 01 55 91 20 00
www.atosorigin.com





More information about the Fusionforge-general mailing list