This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  ed43a9271cc6569295b111e9a625c99a056f3bb4 (commit)
      from  68ed474726530d36230b8d49bc56e443449db5b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ed43a9271cc6569295b111e9a625c99a056f3bb4

commit ed43a9271cc6569295b111e9a625c99a056f3bb4
Author: Franck Villaume <[email protected]>
Date:   Sun Mar 20 21:31:51 2016 +0100

    add forge home widget: statistics, display main stats for the forge

diff --git a/src/common/widget/Widget.class.php 
b/src/common/widget/Widget.class.php
index 3896bd2..6a1543e 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -56,6 +56,7 @@ require_once 
$gfcommon.'widget/Widget_ProjectLatestCommits.class.php';
 require_once $gfcommon.'widget/Widget_MyMonitoredDocuments.class.php';
 
 require_once $gfcommon.'widget/Widget_HomeLatestNews.class.php';
+require_once $gfcommon.'widget/Widget_HomeStats.class.php';
 require_once $gfcommon.'widget/Widget_HomeTagCloud.class.php';
 require_once $gfcommon.'widget/Widget_HomeVersion.class.php';
 
@@ -179,6 +180,9 @@ require_once 
$gfcommon.'widget/Widget_HomeVersion.class.php';
                        case 'homelatestnews':
                                $o = new Widget_HomeLatestNews();
                                break;
+                       case 'homestats':
+                               $o = new Widget_HomeStats();
+                               break;
                        case 'hometagcloud':
                                $o = new Widget_HomeTagCloud();
                                break;
@@ -319,7 +323,7 @@ require_once 
$gfcommon.'widget/Widget_HomeVersion.class.php';
                                                );
                                break;
                        case WidgetLayoutManager::OWNER_TYPE_HOME:
-                               $widgets = array('hometagcloud', 'homeversion', 
'homelatestnews');
+                               $widgets = array('hometagcloud', 'homeversion', 
'homelatestnews', 'homestats');
                                break;
                        default:
                                $widgets = array();
diff --git a/src/common/widget/Widget_HomeStats.class.php 
b/src/common/widget/Widget_HomeStats.class.php
new file mode 100644
index 0000000..3628d19
--- /dev/null
+++ b/src/common/widget/Widget_HomeStats.class.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Copyright 2016, Franck Villaume - TrivialDev
+ * This file is a part of Fusionforge.
+ *
+ * Fusionforge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Fusionforge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+require_once 'Widget.class.php';
+
+class Widget_HomeStats extends Widget {
+       function __construct() {
+               $this->Widget('homestats');
+       }
+
+       function getTitle() {
+               return sprintf(_('%s Statistics'), 
forge_get_config('forge_name'));
+       }
+
+       function getContent() {
+               global $HTML;
+               $return = show_sitestats();
+               if (forge_get_config('use_frs')) {
+                       $return .= $HTML->boxMiddle(_('Top Project Downloads'), 
'Top_Projects_Downloads');
+                       $return .= show_top_downloads();
+               }
+               if (forge_get_config('use_ratings')) {
+                       $return .= $HTML->boxMiddle(_('Highest Ranked Users'), 
'Highest_Ranked_Users');
+                       $return .= show_highest_ranked_users();
+               }
+               $return .= $HTML->boxMiddle(_('Most Active This Week'), 
'Most_Active_This_Week');
+               $return .= show_highest_ranked_projects();
+               $return .= $HTML->boxMiddle(_('Recently Registered Projects'), 
'Recently_Registered_Projects');
+               $return .= show_newest_projects();
+               plugin_hook_by_reference("widget_homestats", $params);
+               return $return;
+       }
+}

-----------------------------------------------------------------------

Summary of changes:
 src/common/widget/Widget.class.php                 |  6 ++++-
 ...gCloud.class.php => Widget_HomeStats.class.php} | 31 +++++++++++++---------
 2 files changed, 24 insertions(+), 13 deletions(-)
 copy src/common/widget/{Widget_HomeTagCloud.class.php => 
Widget_HomeStats.class.php} (50%)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to