[evolvis-commits] r18732: widget-areas pending merges:↵ Thorsten Glaser 2012-10-29 re-indent (mostly)

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Oct 29 15:08:30 CET 2012


Author: mirabilos
Date: 2012-10-29 15:08:29 +0100 (Mon, 29 Oct 2012)
New Revision: 18732

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/widget/Widget_ProjectPublicAreas.class.php
Log:
widget-areas pending merges:
  Thorsten Glaser 2012-10-29 re-indent (mostly)

almost a no-op here in this branch; no functional changes

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/widget/Widget_ProjectPublicAreas.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/widget/Widget_ProjectPublicAreas.class.php	2012-10-29 14:08:24 UTC (rev 18731)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/widget/Widget_ProjectPublicAreas.class.php	2012-10-29 14:08:29 UTC (rev 18732)
@@ -27,15 +27,19 @@
 	function Widget_ProjectPublicAreas() {
 		$this->Widget('projectpublicareas');
 	}
+
 	function getTitle() {
 		return _('Public Areas');
 	}
+
 	function getContent() {
+		global $HTML;
+
 		$request =& HTTPRequest::instance();
 		$group_id = $request->get('group_id');
 		$pm = ProjectManager::instance();
 		$project = $pm->getProject($group_id);
-		$HTML = $GLOBALS['HTML'];
+
 		// ################# Homepage Link
 
 		echo '<div class="public-area-box" rel="doap:homepage">';
@@ -49,33 +53,32 @@
 		if ($project->usesTracker()) {
 			echo '<div class="public-area-box">'."\n";
 			$link_content = $HTML->getFollowPic(_('Tracker')) . ' ' . _('Tracker');
-			echo util_make_link ( '/tracker/?group_id=' . $group_id, $link_content);
+			echo util_make_link('/tracker/?group_id=' . $group_id, $link_content);
 
-			$result=db_query_params ('SELECT agl.*,aca.count,aca.open_count
-					FROM artifact_group_list agl
-					LEFT JOIN artifact_counts_agg aca USING (group_artifact_id)
-					WHERE agl.group_id=$1
-					AND agl.is_public=1
-					ORDER BY group_artifact_id ASC',
-					array($group_id));
-
+			$result = db_query_params('SELECT agl.*,aca.count,aca.open_count
+				FROM artifact_group_list agl
+				LEFT JOIN artifact_counts_agg aca USING (group_artifact_id)
+				WHERE agl.group_id=$1
+				AND agl.is_public=1
+				ORDER BY group_artifact_id ASC',
+			    array($group_id));
 			$rows = db_numrows($result);
 
 			if (!$result || $rows < 1) {
-				echo "<br />\n<em>"._('There are no public trackers available').'</em>';
+				echo "<br />\n<em>" .
+				    _('There are no public trackers available') .
+				    "</em>\n";
 			} else {
 				echo "\n".'<ul class="tracker" rel="doap:bug-database">'."\n";
 				for ($j = 0; $j < $rows; $j++) {
-					// tracker REST paths are something like : /tracker/cm/project/A_PROJECT/atid/NUMBER to plan compatibility
-					// with OSLC-CM server API
 					$group_artifact_id = db_result($result, $j, 'group_artifact_id');
 					$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $project->getUnixName() .'/atid/'. $group_artifact_id);
 					echo "\t".'<li about="'. $tracker_stdzd_uri . '" typeof="sioc:Container">'."\n";
 					print '<span rel="http://www.w3.org/2002/07/owl#sameAs">'."\n";
-					echo util_make_link ('/tracker/?atid='. $group_artifact_id . '&group_id='.$group_id.'&func=browse',db_result($result, $j, 'name')) . ' ' ;
-					echo "</span>\n"; // /owl:sameAs
-					printf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int) db_result($result, $j, 'open_count')), (int) db_result($result, $j, 'open_count'), (int) db_result($result, $j, 'count'));
-					echo '<br />'; //.db_result($result, $j, 'description');
+					echo util_make_link('/tracker/?atid='. $group_artifact_id . '&group_id='.$group_id.'&func=browse',db_result($result, $j, 'name')) . ' ';
+					echo "</span>\n";
+					printf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int)db_result($result, $j, 'open_count')), (int)db_result($result, $j, 'open_count'), (int)db_result($result, $j, 'count'));
+					echo '<br />';
 					print '<span rel="sioc:has_space" resource="" ></span>'."\n";
 					echo "</li>\n";
 				}
@@ -84,30 +87,32 @@
 			echo "</div>\n";
 		}
 
-		// ################## forums
+		// ################## Forums
 
 		if ($project->usesForum()) {
 			echo '<div class="public-area-box">'."\n";
-			//	print '<hr size="1" /><a rel="sioc:container_of" href="'.util_make_url ('/forum/?group_id='.$group_id).'">';
 			$link_content = $HTML->getForumPic('') . ' ' . _('Public Forums');
-			echo util_make_link ( '/forum/?group_id=' . $group_id, $link_content);
+			echo util_make_link('/forum/?group_id=' . $group_id, $link_content);
 			print ' (';
 			$messages_count = project_get_public_forum_message_count($group_id);
 			$forums_count = project_get_public_forum_count($group_id);
-			printf(ngettext("<strong>%d</strong> message","<strong>%d</strong> messages",$messages_count),$messages_count);
+			printf(ngettext("<strong>%d</strong> message",
+			    "<strong>%d</strong> messages", $messages_count),
+			    $messages_count);
 			print ' in ';
-			printf(ngettext("<strong>%d</strong> forum","<strong>%d</strong> forums",$forums_count),$forums_count);
-			print ')' ;
-			print "\n</div>";
+			printf(ngettext("<strong>%d</strong> forum",
+			    "<strong>%d</strong> forums", $forums_count),
+			    $forums_count);
+			print ")\n</div>\n";
 		}
 
 		// ##################### Doc Manager
 
 		if ($project->usesDocman()) {
 			echo '<div class="public-area-box">'."\n";
-			$link_content = $HTML->getDocmanPic('') . ' ' . _('DocManager: Project Documentation');
-			//	<a rel="sioc:container_of" xmlns:sioc="http://rdfs.org/sioc/ns#" href="'.util_make_url ('/docman/?group_id='.$group_id).'">';
-			print util_make_link( '/docman/?group_id='.$group_id, $link_content);
+			$link_content = $HTML->getDocmanPic('') .
+			     ' ' . _('DocManager: Project Documentation');
+			print util_make_link('/docman/?group_id=' . $group_id, $link_content);
 			echo "\n</div>\n";
 		}
 
@@ -116,10 +121,11 @@
 		if ($project->usesMail()) {
 			echo '<div class="public-area-box">'."\n";
 			$link_content = $HTML->getMailPic('') . ' ' . _('Mailing Lists');
-			print util_make_link( '/mail/?group_id='.$group_id, $link_content);
+			print util_make_link('/mail/?group_id=' . $group_id, $link_content);
 			$n = project_get_mail_list_count($group_id);
 			echo ' ';
-			printf(ngettext('(<strong>%1$s</strong> public mailing list)', '(<strong>%1$s</strong> public mailing lists)', $n), $n);
+			printf(ngettext('(<strong>%1$s</strong> public mailing list)',
+			    '(<strong>%1$s</strong> public mailing lists)', $n), $n);
 			echo "\n</div>\n";
 		}
 
@@ -128,19 +134,22 @@
 		if ($project->usesPm()) {
 			echo '<div class="public-area-box">'."\n";
 			$link_content = $HTML->getPmPic('') . ' ' . _('Tasks');
-			print util_make_link( '/pm/?group_id='.$group_id, $link_content);
+			print util_make_link('/pm/?group_id=' . $group_id, $link_content);
 
-			$result = db_query_params ('SELECT * FROM project_group_list WHERE group_id=$1 AND is_public=1',
-					array ($group_id));
+			$result = db_query_params('SELECT * FROM project_group_list
+				WHERE group_id=$1 AND is_public=1',
+			    array($group_id));
 			$rows = db_numrows($result);
 			if (!$result || $rows < 1) {
-				echo "<br />\n<em>"._('There are no public subprojects available').'</em>';
+				echo "<br />\n<em>" .
+				    _('There are no public subprojects available') .
+				    "</em>\n";
 			} else {
 				echo "\n".'<ul class="task-manager">';
 				for ($j = 0; $j < $rows; $j++) {
 					echo "\n\t<li>";
-					print util_make_link ('/pm/task.php?group_project_id='.db_result($result, $j, 'group_project_id').'&group_id='.$group_id.'&func=browse',db_result($result, $j, 'project_name'));
-					echo '</li>' ;
+					print util_make_link('/pm/task.php?group_project_id='.db_result($result, $j, 'group_project_id').'&group_id='.$group_id.'&func=browse',db_result($result, $j, 'project_name'));
+					echo '</li>';
 				}
 				echo "\n</ul>";
 			}
@@ -153,7 +162,9 @@
 			echo '<div class="public-area-box">'."\n";
 			$link_content = $HTML->getSurveyPic('') . ' ' . _('Surveys');
 			echo util_make_link( '/survey/?group_id='.$group_id, $link_content);
-			echo ' (<strong>'. project_get_survey_count($group_id) .'</strong> ' . _('surveys').')';
+			echo ' (<strong>' .
+			    project_get_survey_count($group_id) .
+			    '</strong> ' . _('surveys') . ')';
 			echo "\n</div>\n";
 		}
 
@@ -163,50 +174,46 @@
 			echo '<div class="public-area-box">'."\n";
 
 			$link_content = $HTML->getScmPic('') . ' ' . _('SCM Repository');
-			//	print '<hr size="1" /><a rel="doap:repository" href="'.util_make_url ('/scm/?group_id='.$group_id).'">';
-			print util_make_link( '/scm/?group_id='.$group_id, $link_content);
+			print util_make_link('/scm/?group_id=' . $group_id, $link_content);
 
-			$hook_params = array () ;
-			$hook_params['group_id'] = $group_id ;
-			plugin_hook ("scm_stats", $hook_params) ;
+			$hook_params = array();
+			$hook_params['group_id'] = $group_id;
+			plugin_hook("scm_stats", $hook_params);
 			echo "\n</div>\n";
 		}
 
 		// ######################### Plugins
 
-		$hook_params = array ();
+		$hook_params = array();
 		$hook_params['group_id'] = $group_id;
-		plugin_hook ("project_public_area", $hook_params);
+		plugin_hook("project_public_area", $hook_params);
 
 		// ######################## AnonFTP
 
-		// CB hide FTP if desired
-		if ($project->usesFTP()) {
-			if ($project->isActive()) {
-				echo '<div class="public-area-box">'."\n";
+		if ($project->usesFTP() && $project->isActive()) {
+			echo '<div class="public-area-box">'."\n";
 
-				$link_content = $HTML->getFtpPic('') . ' ' . _('Anonymous FTP Space');
-				//		print '<a rel="doap:anonymous root" href="ftp://' . $project->getUnixName() . '.' . forge_get_config('web_host') . '/pub/'. $project->getUnixName() .'/">';
-				if (forge_get_config('use_project_vhost')) {
-					print util_make_link('ftp://' . $project->getUnixName() . '.' . forge_get_config('web_host') . '/pub/'. $project->getUnixName(), $link_content, false, true);
-				} else {
-					print util_make_link('ftp://' . forge_get_config('web_host') . '/pub/'. $project->getUnixName(), $link_content, false, true);
-				}
-				echo "\n</div>\n";
+			$link_content = $HTML->getFtpPic('') . ' ' . _('Anonymous FTP Space');
+			$link_target = 'ftp://';
+			if (forge_get_config('use_project_vhost')) {
+				$link_target .= $project->getUnixName() . '.';
 			}
+			$link_target .= forge_get_config('web_host') . '/pub/' .
+			    $project->getUnixName();
+			print util_make_link($link_target, $link_content, false, true);
+			echo "\n</div>\n";
 		}
 
-		//webcalendar
-		plugin_hook("cal_link_group",$group_id);
+		// ######################## WebCalendar
+
+		plugin_hook("cal_link_group", $group_id);
 	}
+
 	function canBeUsedByProject(&$project) {
 		return true;
 	}
+
 	function getDescription() {
 		return _('List all available services for this project along with some information next to it. Click on any of this item to access a service.<br />The role of this area is pretty much equivalent to the Project Main Menu at the top of the screen except that it shows additional information about each of the service (e.g. total number of open bugs, tasks, ...)');
 	}
-
-
 }
-
-?>



More information about the evolvis-commits mailing list