[evolvis-commits] r18719: offload inline-userpicture

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Oct 8 15:00:37 CEST 2012


Author: mirabilos
Date: 2012-10-08 15:00:35 +0200 (Mon, 08 Oct 2012)
New Revision: 18719

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/forum/ForumHTML.class.php
   trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
   trunk/gforge_base/evolvisforge-5.1/src/www/news/news_utils.php
   trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectTaskHTML.class.php
   trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectView.class.php
   trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
Log:
offload inline-userpicture

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/forum/ForumHTML.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/forum/ForumHTML.class.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/forum/ForumHTML.class.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -62,11 +62,9 @@
 			}
 			echo '<p>
 			<strong>'._('Posted by').':</strong> ' .
-			    str_replace('img-shadow-', 'img-inline-',
-			    str_replace('<div', '<span',
-			    str_replace('</div', '</span',
 			    util_display_user($user->getUnixName(),
-			    $user->getID(), $user->getRealName())))) . '<br />
+			    $user->getID(), $user->getRealName(),
+			    true, true) . '<br />
 			<strong>'._('Date').':</strong> '. date(_('Y-m-d H:i'),db_result($result,0,'post_date')).'<br />
 			<strong>'._('Summary').':</strong> '.
 				util_make_link ('/forum/forum.php?forum_id='.db_result($result,0,'forum_id').'&group_id='.$group_id,

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -1157,9 +1157,11 @@
  * @param string $text
  * @param string $size
  * @param bool $dolink (default: true)
+ * @param bool $inline (default: false)
  * @return string
  */
-function util_display_user($username, $user_id, $text, $size='xs', $dolink=true) {
+function util_display_user($username, $user_id, $text, $size='xs',
+    $dolink=true, $inline=false) {
         $hook_params = array();
         $hook_params['username'] = $username;
         $hook_params['user_id'] = $user_id;
@@ -1176,8 +1178,17 @@
 		$url = $text;
 	}
         if ($params['content']) {
-                return $params['content'].$url.'<div class="new_line"></div>';
+		$url = $params['content'] . $url;
+		if (!$inline) {
+			$url .= '<div class="new_line"></div>';
+		}
         }
+	if ($inline) {
+		$url = str_replace('img-shadow-', 'img-inline-',
+		    str_replace('<div', '<span', str_replace('</div', '</span',
+		    $url)));
+	}
+
         return $url;
 }
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/news/news_utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/news/news_utils.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/news/news_utils.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -128,10 +128,8 @@
 			$t_thread_author = db_result($result,$i,'realname');
 			if (($xu = user_get_object_by_name(db_result($result,
 			    $i, 'user_name'))) && $xu->getID() != 100) {
-				$t_thread_author = str_replace('<div', '<span',
-				    str_replace('</div', '</span',
-				    util_display_user($xu->getUnixName(),
-				    $xu->getID(), $t_thread_author, 'xs')));
+				$t_thread_author = util_display_user($xu->getUnixName(),
+				    $xu->getID(), $t_thread_author, 'xs', true, true);
 			}
 
 			$return .= '<div class="one-news bordure-dessous">';

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectTaskHTML.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectTaskHTML.class.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectTaskHTML.class.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -62,10 +62,8 @@
 			if ($control == 'checkbox' &&
 			    ($xu = user_get_object_by_name($tech->getUnixName())) &&
 			    $xu->getID() != 100) {
-				$xt = str_replace('<div', '<span',
-				    str_replace('</div', '</span',
-				    util_display_user($xu->getUnixName(),
-				    $xu->getID(), $xt, 'xs', false)));
+				$xt = util_display_user($xu->getUnixName(),
+				    $xu->getID(), $xt, 'xs', false, true);
 			}
 	XXX*/
 			$tech_name_arr[] = $xt;

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectView.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectView.class.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/include/ProjectView.class.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -503,9 +503,7 @@
 			$xt = util_display_user($xu->getUnixName(),
 			    $xu->getID(), sprintf('%s (<tt>%s</tt>)',
 			    $xu->getRealName(), $xu->getUnixName()),
-			    'xs', false);
-			$xt = str_replace('<div', '<span', str_replace('</div',
-			    '</span', $xt));
+			    'xs', false, true);
 		} else {
 			$xt = $pt->getSubmittedRealName() . ' (<tt>' .
 			    $pt->getSubmittedUnixName() . '</tt>)';

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php	2012-10-08 13:00:00 UTC (rev 18718)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/item.php	2012-10-08 13:00:35 UTC (rev 18719)
@@ -253,9 +253,7 @@
 	    $xu->getID() != 100) {
 		$xs = util_display_user($xu->getUnixName(), $xu->getID(),
 		    sprintf('%s (<tt>%s</tt>)', $xu->getRealName(),
-		    $xu->getUnixName()), 'xs');
-		echo str_replace('<div', '<span', str_replace('</div',
-		    '</span', $xs));
+		    $xu->getUnixName()), 'xs', true, true);
 	} elseif ($ah->getSubmittedBy() != 100) {
 		echo $ah->getSubmittedRealName();
 		echo ' (<tt>' . util_make_link_u($ah->getSubmittedUnixName(),



More information about the evolvis-commits mailing list