[Fusionforge-commits] r18048 - in trunk/src/www/search/include: . renderers

Marc-Etienne VARGENAU vargenau at fusionforge.org
Mon Sep 23 11:05:17 CEST 2013


Author: vargenau
Date: 2013-09-23 11:05:17 +0200 (Mon, 23 Sep 2013)
New Revision: 18048

Modified:
   trunk/src/www/search/include/SearchManager.class.php
   trunk/src/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/ForumsHtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/FrsHtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/FullProjectHtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/HtmlGroupSearchRenderer.class.php
   trunk/src/www/search/include/renderers/HtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php
   trunk/src/www/search/include/renderers/TrackersHtmlSearchRenderer.class.php
Log:
Use relative_date

Modified: trunk/src/www/search/include/SearchManager.class.php
===================================================================
--- trunk/src/www/search/include/SearchManager.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/SearchManager.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -142,7 +142,7 @@
 		// Global search engine
 		$this->addSearchEngine(
 			SEARCH__TYPE_IS_SOFTWARE,
-			new GFSearchEngine(SEARCH__TYPE_IS_SOFTWARE, 'ProjectHtmlSearchRenderer', _('Project'))
+			new GFSearchEngine(SEARCH__TYPE_IS_SOFTWARE, 'ProjectHtmlSearchRenderer', _('Projects'))
 		);
 		$this->addSearchEngine(
 			SEARCH__TYPE_IS_PEOPLE,
@@ -155,14 +155,14 @@
 		if (forge_get_config('use_people')) {
 			$this->addSearchEngine(
 				SEARCH__TYPE_IS_SKILL,
-				new GFSearchEngine(SEARCH__TYPE_IS_SKILL, 'SkillHtmlSearchRenderer', _('Skill'))
+				new GFSearchEngine(SEARCH__TYPE_IS_SKILL, 'SkillHtmlSearchRenderer', _('Skills'))
 			);
 		}
 
 		// Rss search engines
 		$this->addSearchEngine(
 			SEARCH__TYPE_IS_SOFTWARE,
-			new GFSearchEngine(SEARCH__TYPE_IS_SOFTWARE, 'ProjectRssSearchRenderer', _('Project')),
+			new GFSearchEngine(SEARCH__TYPE_IS_SOFTWARE, 'ProjectRssSearchRenderer', _('Projects')),
 			SEARCH__OUTPUT_RSS
 		);
 

Modified: trunk/src/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/AdvancedSearchHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -192,9 +192,9 @@
 			$result .= $renderer->getRows();
 			$result .= $GLOBALS['HTML']->listTableBottom();
 		} elseif(method_exists($renderer, 'getSections') && (count($renderer->getSections($this->groupId)) == 0)) {
-			$result .= '<p>'.sprintf(_('No matches found for “%1$s” - No sections available (check your permissions)'), $this->words).'</p>';
+			$result .= '<p>'.sprintf(_('No matches found for “%s” - No sections available (check your permissions)'), $this->words).'</p>';
 		} else {
-			$result .= '<p>'.sprintf(_('No matches found for “%1$s”'), $this->words).'</p>';
+			$result .= '<p>'.sprintf(_('No matches found for “%s”'), $this->words).'</p>';
 		}
 		return $result;
 	}

Modified: trunk/src/www/search/include/renderers/ForumsHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/ForumsHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/ForumsHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -29,12 +29,11 @@
 	/**
 	 * Constructor
 	 *
-	 * @param string $words words we are searching for
-	 * @param int $offset offset
-	 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
-	 * @param int $groupId group id
-	 * @param array $sections array of all sections to search in (array of strings)
-	 *
+	 * @param string       $words    words we are searching for
+	 * @param int          $offset   offset
+	 * @param boolean      $isExact  if we want to search for all the words or if only one matching the query is sufficient
+	 * @param int          $groupId  group id
+	 * @param array|string $sections array of all sections to search in (array of strings)
 	 */
 	function ForumsHtmlSearchRenderer($words, $offset, $isExact, $groupId, $sections=SEARCH__ALL_SECTIONS) {
 		$userIsGroupMember = $this->isGroupMember($groupId);
@@ -85,8 +84,6 @@
 	function getRows() {
 		$fd = $this->getFilteredRows();
 
-		$dateFormat = _('Y-m-d H:i');
-
 		$return = '';
 		$rowColor = 0;
 		$lastForumName = null;
@@ -105,7 +102,7 @@
 							. html_image('ic/msg.png', '10', '12').' '.$row['subject']
 							.'</a></td>'			
 						. '<td width="15%">'.$row['realname'].'</td>'
-						. '<td width="15%">'.date($dateFormat, $row['post_date']).'</td></tr>';
+						. '<td width="15%">'.relative_date($row['post_date']).'</td></tr>';
 			$rowColor ++;
 		}
 		return $return;

Modified: trunk/src/www/search/include/renderers/FrsHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/FrsHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/FrsHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -59,7 +59,6 @@
 	function getRows() {
 		$rowsCount = $this->searchQuery->getRowsCount();
 		$result =& $this->searchQuery->getResult();
-		$dateFormat = _('Y-m-d H:i');
 
 		$return = '';
 		$rowColor = 0;
@@ -77,7 +76,7 @@
 				. '<td width="5%"> </td>'
 				. '<td>'.util_make_link ('/frs/shownotes.php?release_id='.db_result($result, $i, 'release_id'),db_result($result, $i, 'release_name')).'</td>'
 				. '<td width="15%">'.db_result($result, $i, 'realname').'</td>'
-				. '<td width="15%">'.date($dateFormat,db_result($result,$i, 'release_date')).'</td></tr>';
+				. '<td width="15%">'.relative_date(db_result($result,$i, 'release_date')).'</td></tr>';
 			$rowColor ++;
 		}
 		return $return;

Modified: trunk/src/www/search/include/renderers/FullProjectHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/FullProjectHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/FullProjectHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -218,9 +218,9 @@
 			$result .= $renderer->getRows();
 			$result .= $GLOBALS['HTML']->listTableBottom();
 		} elseif(method_exists($renderer, 'getSections') && (count($renderer->getSections($this->groupId)) == 0)) {
-			$result .= '<p>'.sprintf(_('No matches found for <em>%s</em> - No sections available (check your permissions)'), $this->words).'</p>';
+			$result .= '<p>'.sprintf(_('No matches found for “%s” - No sections available (check your permissions)'), htmlspecialchars($this->words)).'</p>';
 		} else {
-			$result .= '<p>'.sprintf(_('No matches found for <em>%s</em>'), $this->words).'</p>';
+			$result .= '<p>'.sprintf(_('No matches found for “%s”'), htmlspecialchars($this->words)).'</p>';
 		}
 		return $result;
 	}

Modified: trunk/src/www/search/include/renderers/HtmlGroupSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/HtmlGroupSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/HtmlGroupSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -66,7 +66,7 @@
 	 * writeHeader - write the header of the output
 	 */
 	function writeHeader() {
-		$title = sprintf(_('Search results for “%1$s”'), $this->query['words']);
+		$title = sprintf(_('Search results for “%s”'), $this->query['words']);
 		site_project_header(array('title' => $title, 'group' => $this->groupId, 'toptab' => $this->topTab));
 
 		printf (_('Tip: Use %s to get more precise results.'),

Modified: trunk/src/www/search/include/renderers/HtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/HtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/HtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -97,7 +97,7 @@
 		$query =& $this->query;
 
 		if(!$searchQuery->getResult() || $searchQuery->getRowsCount() < 1) {
-			$html = '<p><strong>'.sprintf(_('No matches found for “%1$s”'), $query['words']).'</strong></p>';
+			$html = '<p><strong>'.sprintf(_('No matches found for “%s”'), $query['words']).'</strong></p>';
 			$html .= db_error();
 		} else {
 			$html = $GLOBALS['HTML']->listTableTop($this->tableHeaders);

Modified: trunk/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/NewsHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -48,7 +48,7 @@
 		$this->tableHeaders = array(
 			_('Summary'),
 			_('Submitted by'),
-			_('Post date'),
+			_('Post Date'),
 		);
 	}
 
@@ -60,7 +60,6 @@
 	function getRows() {
 		$rowsCount = $this->searchQuery->getRowsCount();
 		$result =& $this->searchQuery->getResult();
-		$dateFormat = _('Y-m-d H:i');
 
 		$return = '';
 		for($i = 0; $i < $rowsCount; $i++) {
@@ -69,7 +68,7 @@
 				. html_image('ic/msg.png', '10', '12')
 				. ' '.db_result($result, $i, 'summary').'</a></td>
 				<td width="15%">'.db_result($result, $i, 'realname').'</td>
-				<td width="15%">'.date($dateFormat, db_result($result, $i, 'post_date')).'</td></tr>';
+				<td width="15%">'.relative_date(db_result($result, $i, 'post_date')).'</td></tr>';
 		}
 		return $return;
 	}

Modified: trunk/src/www/search/include/renderers/TrackersHtmlSearchRenderer.class.php
===================================================================
--- trunk/src/www/search/include/renderers/TrackersHtmlSearchRenderer.class.php	2013-09-20 15:18:11 UTC (rev 18047)
+++ trunk/src/www/search/include/renderers/TrackersHtmlSearchRenderer.class.php	2013-09-23 09:05:17 UTC (rev 18048)
@@ -86,8 +86,6 @@
 	function getRows() {
 		$fd = $this->getFilteredRows();
 
-		$dateFormat = _('Y-m-d H:i');
-
 		$return = '';
 		$rowColor = 0;
 		$lastTracker = null;
@@ -108,7 +106,7 @@
 							. html_image('ic/tracker20g.png').' '.$row['summary']
 							. '</a></td>'		
 						. '<td width="15%">'.$row['realname'].'</td>'
-						. '<td width="15%">'.date($dateFormat, $row['open_date']).'</td></tr>';
+						. '<td width="15%">'.relative_date($row['open_date']).'</td></tr>';
 			$rowColor ++;
 		}
 		return $return;




More information about the Fusionforge-commits mailing list