[Fusionforge-commits] r13186 - in trunk/src/plugins/oslc/include: . oslc-zend/application/views/scripts/fusionforgecompact

Olivier Berger olberger at fusionforge.org
Wed Apr 20 18:41:26 CEST 2011


Author: olberger
Date: 2011-04-20 18:41:25 +0200 (Wed, 20 Apr 2011)
New Revision: 13186

Modified:
   trunk/src/plugins/oslc/include/compactResource.class.php
   trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecompact/oslc-compact-user-small.phtml
   trunk/src/plugins/oslc/include/oslcPlugin.class.php
Log:
Add user_logo hook to display gravatars if gravatar plugin enabled

Modified: trunk/src/plugins/oslc/include/compactResource.class.php
===================================================================
--- trunk/src/plugins/oslc/include/compactResource.class.php	2011-04-20 16:41:15 UTC (rev 13185)
+++ trunk/src/plugins/oslc/include/compactResource.class.php	2011-04-20 16:41:25 UTC (rev 13186)
@@ -62,8 +62,22 @@
 	public function getResourceLink() {
 		$username = $this->params['username'];
 		$user_id = $this->params['user_id'];
-		return '<a class="resourcePopupTrigger" href="'. util_make_url_u ($username, $user_id) .
+		
+		// invoke user_logo hook
+		$logo_params = array('user_id' => $user_id, 'size' => $this->params['size'], 'content' => '');
+        plugin_hook_by_reference('user_logo', $logo_params);
+        
+        $html = '';
+        // construct a link that is the base for a hover popup.
+        $url = '<a class="resourcePopupTrigger" href="'. util_make_url_u ($username, $user_id) .
 				'" rel="user,' . $username . '">'. $username . '</a>';
+        if ($logo_params['content']) {
+        	$html = $logo_params['content'] . $url .'<div class="new_line"></div>';
+        }
+		else {
+			$html = $url;
+		}
+		return $html;
 	}	
 	
 }

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecompact/oslc-compact-user-small.phtml
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecompact/oslc-compact-user-small.phtml	2011-04-20 16:41:15 UTC (rev 13185)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecompact/oslc-compact-user-small.phtml	2011-04-20 16:41:25 UTC (rev 13186)
@@ -26,15 +26,32 @@
 $user_id = $this->user->getID();
 $user_uri = $this->serverUrl().'/users/'.$user_name;
 $user_title = $this->user->getTitle();
-$title = ($user_title ? $user_title .' ' :''). $user_real_name;?>
+$title = ($user_title ? $user_title .' ' :''). $user_real_name;
 
+// invoke user_logo hook
+$logo_params = array('user_id' => $user_id, 'size' => 'm', 'content' => '');
+plugin_hook_by_reference('user_logo', $logo_params);
+        
+if ($logo_params['content']) {
+	$logo = $logo_params['content'];
+}
+else {
+	$logo = '';
+}
+?>
 <html>
 <head>
-<title>User: <?php echo $user_real_name;?> (Idenntifier: <?php echo $user_id;?>)</title>
+<title>User: <?php echo $user_real_name;?> (Identifier: <?php echo $user_id;?>)</title>
 </head>
 <body>
 <table>
 <tr>
+<td>
+<?php echo $logo;?>
+</td>
+<td>
+<table>
+<tr>
 	<td colspan="2"><i>Compact User Preview</i></td>
 </tr>
 <tr>
@@ -55,7 +72,9 @@
 	<td><small><b>URI:</b> <a href="<?php echo $user_uri;?>"><?php echo $user_uri;?></a></small></td>
 </tr>
 </table>
-
+</td>
+</tr>
+</table>
 <!-- 
 <b>User Name:</b> <?php echo $title;?><br/>
 <b>Login Name:</b> <?php echo $user_name;?> <br/>

Modified: trunk/src/plugins/oslc/include/oslcPlugin.class.php
===================================================================
--- trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-04-20 16:41:15 UTC (rev 13185)
+++ trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-04-20 16:41:25 UTC (rev 13186)
@@ -166,24 +166,7 @@
 		elseif ($hookname == "project_link_with_tooltip") {
 			require_once dirname( __FILE__ ) . '/compactResource.class.php';
 			$cR = compactResource::createCompactResource($params);
-			$params['group_link'] = $cR->getResourceLink();			
-			/*
-			// replace behaviour of util_display_user()
-		
-			// invoke user_logo hook
-			$logo_params = array('user_id' => $params['user_id'], 'size' => $params['size'], 'content' => '');
-        	plugin_hook_by_reference('user_logo', $logo_params);
-        
-        	// construct a link that is the base for a hover popup.
-        	$url = '<a class="personPopupTrigger" href="'. util_make_url_u ($params['username'], $params['user_id']) .
-				'" rel="' . $params['username'] . '">'. $params['username'] . '</a>';
-        	if ($logo_params['content']) {
-                $params['user_link'] = $logo_params['content'] . $url .'<div class="new_line"></div>';
-        	}
-			else {
-				$params['user_link'] = $url;
-			}
-			*/
+			$params['group_link'] = $cR->getResourceLink();
 		}
 		elseif ($hookname == "javascript_file") {
 			// The userTooltip.js script is used by the compact preview feature (see content_negociated_user_home)




More information about the Fusionforge-commits mailing list