[Fusionforge-commits] r14431 - in trunk/src: plugins/compactpreview/include plugins/compactpreview/www www/include

Olivier Berger olberger at fusionforge.org
Mon Sep 19 10:01:07 CEST 2011


Author: olberger
Date: 2011-09-19 10:01:07 +0200 (Mon, 19 Sep 2011)
New Revision: 14431

Modified:
   trunk/src/plugins/compactpreview/include/CompactPreviewPlugin.class.php
   trunk/src/plugins/compactpreview/www/user.php
   trunk/src/www/include/user_profile.php
Log:
Differentiate title of the compact preview between local and OSLC

Modified: trunk/src/plugins/compactpreview/include/CompactPreviewPlugin.class.php
===================================================================
--- trunk/src/plugins/compactpreview/include/CompactPreviewPlugin.class.php	2011-09-19 08:01:01 UTC (rev 14430)
+++ trunk/src/plugins/compactpreview/include/CompactPreviewPlugin.class.php	2011-09-19 08:01:07 UTC (rev 14431)
@@ -90,7 +90,7 @@
 		}
 	}
 	
-	function display_user_html_compact_preview($username) {
+	function display_user_html_compact_preview($username, $title = false) {
 		global $gfwww;
 		
 		require_once $gfwww.'include/user_profile.php';
@@ -107,7 +107,7 @@
 						</head>
 						<body>';
 		$compact = true;
-		$html .= user_personal_information($user_obj, $compact);
+		$html .= user_personal_information($user_obj, $compact, $title);
 		$html .= '</body>
 						</html>';
 		
@@ -251,7 +251,8 @@
 			// if want direct compact-preview rendering
 			case 'application/x-fusionforge-compact+html' : {
 				$params['content_type'] = 'text/html';
-				$params['content'] = $this->display_user_html_compact_preview($username);
+				$title = _('Compact preview of local user');
+				$params['content'] = $this->display_user_html_compact_preview($username, $title);
 				break;
 			}
 		}

Modified: trunk/src/plugins/compactpreview/www/user.php
===================================================================
--- trunk/src/plugins/compactpreview/www/user.php	2011-09-19 08:01:01 UTC (rev 14430)
+++ trunk/src/plugins/compactpreview/www/user.php	2011-09-19 08:01:07 UTC (rev 14431)
@@ -31,7 +31,8 @@
 
 $username = getStringFromRequest('user');
 
-echo $pluginCompatPreview->display_user_html_compact_preview($username);
+$title = _('OSLC Compact preview of user');
+echo $pluginCompatPreview->display_user_html_compact_preview($username, $title);
 
 // Local Variables:
 // mode: php

Modified: trunk/src/www/include/user_profile.php
===================================================================
--- trunk/src/www/include/user_profile.php	2011-09-19 08:01:01 UTC (rev 14430)
+++ trunk/src/www/include/user_profile.php	2011-09-19 08:01:07 UTC (rev 14431)
@@ -32,7 +32,7 @@
 * @param boolean $compact
 * @return string HTML
 */
-function user_personal_information($user, $compact = false) {
+function user_personal_information($user, $compact = false, $title = false) {
 
 	$user_id = $user->getID();
 
@@ -45,6 +45,11 @@
 
 	if($compact) {
 		$html = '<table>';
+		if($title) {
+			$html .= '<tr>
+						<td>'. $title . '</td>
+					  </tr>';
+		}
 	} else {
 		$html = '<table width="100%" cellpadding="2" cellspacing="2" border="0">';
 	}




More information about the Fusionforge-commits mailing list