[Fusionforge-commits] FusionForge branch master updated. 1ad254d64f40a5c883f87cba89150899dbce7bc8

Alain Peyrat aljeux at fusionforge.org
Wed Nov 20 15:26:13 CET 2013


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  1ad254d64f40a5c883f87cba89150899dbce7bc8 (commit)
      from  4c0092bad2c69f74a91664b965efb1fbc1392a85 (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 -----------------------------------------------------------------
commit 1ad254d64f40a5c883f87cba89150899dbce7bc8
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Wed Nov 20 15:25:53 2013 +0100

    Indent

diff --git a/src/common/widget/Widget_MyAdmin.class.php b/src/common/widget/Widget_MyAdmin.class.php
index e1e41b3..5af9e99 100644
--- a/src/common/widget/Widget_MyAdmin.class.php
+++ b/src/common/widget/Widget_MyAdmin.class.php
@@ -28,53 +28,53 @@ require_once 'Widget.class.php';
  */
 
 class Widget_MyAdmin extends Widget {
-    function __construct() {
-        $this->Widget('myadmin');
-    }
-    function getTitle() {
-        return _("Pending administrative tasks");
-    }
-    function getContent() {
-	$i = 0;
-	$html_my_admin = '<table width="100%">';
+	function __construct() {
+		$this->Widget('myadmin');
+	}
+	function getTitle() {
+		return _("Pending administrative tasks");
+	}
+	function getContent() {
+		$i = 0;
+		$html_my_admin = '<table width="100%">';
 
-	if (forge_check_global_perm ('forge_admin')) {
-		$res = db_query_params("SELECT count(*) AS count FROM users WHERE status='P' OR status='V' OR status='W'",array());
-		$row = db_fetch_array($res);
-		$pending_users = $row['count'];
-		$res = db_query_params("SELECT count(*) AS count FROM users WHERE status='V' OR status='W'",array());
-		$row = db_fetch_array($res);
-		$validated_users = $row['count'];
+		if (forge_check_global_perm ('forge_admin')) {
+			$res = db_query_params("SELECT count(*) AS count FROM users WHERE status='P' OR status='V' OR status='W'",array());
+			$row = db_fetch_array($res);
+			$pending_users = $row['count'];
+			$res = db_query_params("SELECT count(*) AS count FROM users WHERE status='V' OR status='W'",array());
+			$row = db_fetch_array($res);
+			$validated_users = $row['count'];
 
-		$html_my_admin .= $this->_get_admin_row(
-			$i++,
-			vsprintf(_('Users in <a href="%s"><strong>P</strong> (pending) Status</a>'), array("/admin/userlist.php?status=P")),
-			$pending_users,
-			$this->_get_color($pending_users)
+			$html_my_admin .= $this->_get_admin_row(
+				$i++,
+				vsprintf(_('Users in <a href="%s"><strong>P</strong> (pending) Status</a>'), array("/admin/userlist.php?status=P")),
+				$pending_users,
+				$this->_get_color($pending_users)
 			);
-	}
+		}
 
-	if (forge_check_global_perm ('approve_projects')) {
-		$res = db_query_params('SELECT count(*) AS count FROM groups
+		if (forge_check_global_perm ('approve_projects')) {
+			$res = db_query_params('SELECT count(*) AS count FROM groups
 			WHERE group_id > 4
 			    AND status = $1
 			    AND register_time > 0
 			    AND is_template = 0',
-		    array('P'));
-		$row = db_fetch_array($res);
-		$pending_projects = $row['count'];
+				array('P'));
+			$row = db_fetch_array($res);
+			$pending_projects = $row['count'];
 
-		$html_my_admin .= $this->_get_admin_row(
-			$i++,
-			vsprintf(_('Groups in <a href="%s"><strong>P</strong> (pending) Status</A>'), array("/admin/approve-pending.php")),
-			$pending_projects,
-			$this->_get_color($pending_projects)
+			$html_my_admin .= $this->_get_admin_row(
+				$i++,
+				vsprintf(_('Groups in <a href="%s"><strong>P</strong> (pending) Status</A>'), array("/admin/approve-pending.php")),
+				$pending_projects,
+				$this->_get_color($pending_projects)
 			);
-	}
+		}
 
-	if (forge_check_global_perm ('approve_news')) {
-		$old_date = time()-60*60*24*30;
-		$res = db_query_params('SELECT groups.group_id,id,post_date,summary,
+		if (forge_check_global_perm ('approve_news')) {
+			$old_date = time()-60*60*24*30;
+			$res = db_query_params('SELECT groups.group_id,id,post_date,summary,
 				group_name,unix_group_name
 			FROM news_bytes,groups
 			WHERE is_approved=0
@@ -82,25 +82,25 @@ class Widget_MyAdmin extends Widget {
 			AND post_date > $1
 			AND groups.status=$2
 			ORDER BY post_date',
-					  array ($old_date, 'A')) ;
-		$pending_news = db_numrows($res);
+				array ($old_date, 'A')) ;
+			$pending_news = db_numrows($res);
 
-		$html_my_admin .= $this->_get_admin_row(
-			$i++,
-			'<a href="/news/admin">'. _("Site News Approval") .'</a>',
-			$pending_news,
-			$this->_get_color($pending_news)
+			$html_my_admin .= $this->_get_admin_row(
+				$i++,
+				'<a href="/news/admin">'. _("Site News Approval") .'</a>',
+				$pending_news,
+				$this->_get_color($pending_news)
 			);
-	}
-	$html_my_admin .= '</table>';
+		}
+		$html_my_admin .= '</table>';
 
-	return $html_my_admin;
-    }
-    function _get_color($nb) {
-	    return $nb == 0 ? 'green' : 'orange';
-    }
-    function _get_admin_row($i, $text, $value, $bgcolor, $textcolor = 'white') {
-	    $i=$i++;
-	    return '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'. $text .'</td><td nowrap="nowrap" style="width:20%; background:'. $bgcolor .'; color:'. $textcolor .'; padding: 2px 8px; font-weight:bold; text-align:center;">'. $value .'</td></tr>';
-    }
+		return $html_my_admin;
+	}
+	function _get_color($nb) {
+		return $nb == 0 ? 'green' : 'orange';
+	}
+	function _get_admin_row($i, $text, $value, $bgcolor, $textcolor = 'white') {
+		$i=$i++;
+		return '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'. $text .'</td><td nowrap="nowrap" style="width:20%; background:'. $bgcolor .'; color:'. $textcolor .'; padding: 2px 8px; font-weight:bold; text-align:center;">'. $value .'</td></tr>';
+	}
 }

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

Summary of changes:
 src/common/widget/Widget_MyAdmin.class.php |  108 ++++++++++++++--------------
 1 file changed, 54 insertions(+), 54 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list