[Fusionforge-commits] r8610 - trunk/gforge/www/export

Alexandre Neymann neymanna at libremir.placard.fr.eu.org
Tue Dec 22 15:12:03 CET 2009


Author: neymanna
Date: 2009-12-22 15:12:03 +0100 (Tue, 22 Dec 2009)
New Revision: 8610

Modified:
   trunk/gforge/www/export/rss_project.php
Log:
add gettext and add conditionnal rss

Modified: trunk/gforge/www/export/rss_project.php
===================================================================
--- trunk/gforge/www/export/rss_project.php	2009-12-21 18:15:48 UTC (rev 8609)
+++ trunk/gforge/www/export/rss_project.php	2009-12-22 14:12:03 UTC (rev 8610)
@@ -8,50 +8,119 @@
 require_once '../env.inc.php';
 require_once $gfwww.'include/pre.php';
 
+function get_rss_20_doc () {
+	return '&nbsp;(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp;' . 
+		html_image('ic/rss.png',16,16,array('border'=>'0'));
+}
+
+function get_rss_feed_20 ($page,$rss_title) {
+	// RSS 2.0 format
+	$rss_feed_20 .= '<li><a href="' . $page . '">' . $rss_title . '</a>';
+	$rss_feed_20 .= '<link href="' . $page . '" title="' . $rss_title . ', RSS 2.0" rel="alternate" type="application/rss+xml" />';
+	$rss_feed_20 .= get_rss_20_doc () . '</li>';
+	return $rss_feed_20;
+}
+
+$project = &group_get_object(getIntFromRequest('group_id'));
+
 $HTML->header(array('title'=>"Project Exports"));
-?>
-<h2>RSS/XML Exports</h2>
 
-<p><?php print $GLOBALS['sys_name'] ?> data is exported in a variety of standard formats. Many of
+echo '<h2>' . _('RSS/XML Exports') . '</h2><p>';
+ 
+echo sprintf(_('%1$s data is exported in a variety of standard formats. Many of
 the export URLs can also accept form/get data to customize the output. All
-data generated by these pages is realtime.
-</p>
+data generated by these pages is realtime.'),$GLOBALS['sys_name']);
 
-<h3><?php echo _('News Data') ?></h3>
-<p>
-<?php echo _('To get Project News or New Project Releases of a specific project use the Links below.') ?>
-<ul>
-<li><a href="rss_sfnews.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS['sys_name'] ?> Developer Project News</a>
- <link href="rss_sfnews.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer Project News, RSS 0.91" rel="alternate" type="application/rss+xml" />
-(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS 0.91</a>,
-<a href="http://my.netscape.com/publish/formats/rss-0.91.dtd">&lt;rss-0.91.dtd&gt;</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss_sfnewreleases.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS['sys_name'] ?> Developer New Project Releases</a>
- <link href="rss_sfnewreleases.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer New Project Releases, RSS 0.91" rel="alternate" type="application/rss+xml" />
-(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS 0.91</a>,
-<a href="http://my.netscape.com/publish/formats/rss-0.91.dtd">&lt;rss-0.91.dtd&gt;</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-</ul>
+echo '</p><h3>' . _('News Data') . '</h3><p>';
 
-<ul>
-<li><a href="rss20_news.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS['sys_name'] ?> Developer Project News</a>
- <link href="rss20_news.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer Project News, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss20_activity.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS['sys_name'] ?> Activity</a>
- <link href="rss20_activity.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Activity, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss20_newreleases.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS['sys_name'] ?> Developer New Project Releases</a>
- <link href="rss20_newreleases.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer New Project Releases, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss20_tracker.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS[sys_name] ?> Developer Bug Tracker</a>
- <link href="rss20_tracker.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer Bug Tracker, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss20_docman.php?group_id=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS[sys_name] ?> Developer Documents</a>
- <link href="rss20_docman.php?group_id=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer Documents, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-<li><a href="rss20_forum.php?group_ids=<?php echo getIntFromRequest('group_id'); ?>"><?php print $GLOBALS[sys_name] ?> Developer forum Threads</a>
- <link href="rss20_forum.php?group_ids=<?php echo getIntFromRequest('group_id'); ?>" title="<?php print $GLOBALS[sys_name] ?> Developer forum Threads, RSS 2.0" rel="alternate" type="application/rss+xml" />
-(<a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0</a>)&nbsp; <?php echo html_image('ic/rss.png',16,16,array('border'=>'0'));?></li>
-</ul>
+echo _('To get Project News or New Project Releases of a specific project use the Links below.'); 
 
+
+$string_rss_091 =  '<ul>';
+$string_rss_20 = '<ul>';
+
+// RSS for project news
+if ($project->usesNews() && $GLOBALS['sys_use_news']) {
+	// RSS 0.91 format
+	$string_rss_091 .= '<li><a href="rss_sfnews.php?group_id=' . getIntFromRequest('group_id') . '">' . 
+		$GLOBALS['sys_name'] . ' Developer Project News</a>';
+	$string_rss_091 .= '<link href="rss_sfnews.php?group_id=' . getIntFromRequest('group_id') . '" title="' . 
+		$GLOBALS[sys_name] . ' Developer Project News, RSS 0.91" rel="alternate" type="application/rss+xml" />';
+	/* these links are obsolete
+	$string_rss_091 .= '(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS 0.91</a>,
+		<a href="http://my.netscape.com/publish/formats/rss-0.91.dtd">&lt;rss-0.91.dtd&gt;</a>)&nbsp;' . 
+		html_image('ic/rss.png',16,16,array('border'=>'0')) . '</li>';
+	*/
+	$string_rss_091 .= '&nbsp;(RSS 0.91)';
+		
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_news.php?group_id=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Developer Project News");
+}
+
+
+// RSS for project Activity
+if ( ($project->usesNews() && $GLOBALS['sys_use_news']) || 
+	($project->usesFRS() && $GLOBALS['sys_use_frs']) || 
+	($project->usesTracker() && $GLOBALS['sys_use_tracker']) || 
+	($project->usesForum() && $GLOBALS['sys_use_forum']) ||
+	($project->usesSCM() && $GLOBALS['sys_use_scm']) ){
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_activity.php?group_id=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Activity");
+}
+
+
+// RSS for project Releases
+if ($project->usesFRS() && $GLOBALS['sys_use_frs']) {
+	// RSS 0.91 format
+	$string_rss_091 .= '<li><a href="rss_sfnewreleases.php?group_id=' . getIntFromRequest('group_id') . '">' . 
+		$GLOBALS['sys_name'] . ' Developer New Project Releases</a>';
+	$string_rss_091 .= '<link href="rss_sfnewreleases.php?group_id=' . getIntFromRequest('group_id') . 
+		'" title="' . $GLOBALS[sys_name] . ' Developer New Project Releases, RSS 0.91" rel="alternate" type="application/rss+xml" />';
+	/* these links are obsolete
+	$string_rss_091 .= '(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS 0.91</a>,
+		<a href="http://my.netscape.com/publish/formats/rss-0.91.dtd">&lt;rss-0.91.dtd&gt;</a>)&nbsp;' . 
+		html_image('ic/rss.png',16,16,array('border'=>'0')) . '</li>';
+	*/
+	$string_rss_091 .= '&nbsp;(RSS 0.91)';
+	
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_newreleases.php?group_id=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Developer New Project Releases");
+}
+
+
+// RSS for project Bug Tracker
+if ($project->usesTracker() && $GLOBALS['sys_use_tracker']) {
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_tracker.php?group_id=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Developer Bug Tracker");
+}
+
+
+// RSS for project Documents
+if ($project->usesDocman() && $GLOBALS['sys_use_docman']) {
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_docman.php?group_id=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Developer Documents");
+}
+
+// RSS for project Forums Threads
+if ($project->usesForum() && $GLOBALS['sys_use_forum']) {
+	// RSS 2.0 format
+	$string_rss_20 .= get_rss_feed_20 ("rss20_forum.php?group_ids=" . getIntFromRequest('group_id'),
+										$GLOBALS['sys_name'] . " Developer forum Threads");
+}
+
+$string_rss_091 .= '</ul>';
+$string_rss_20 .= '</ul>';
+
+echo $string_rss_091;
+echo $string_rss_20;
+?>
+
+</p>
 <ul>
 <li><a href="http://wiki.evolvis.org/evolvis/index.php/RSS">Get more Feeds here.</a></li>
 </ul>




More information about the Fusionforge-commits mailing list