[evolvis-commits] r15710: Add function util_display_user() to allow further customization of the name.
mirabilos at evolvis.org
mirabilos at evolvis.org
Tue Mar 1 00:25:45 CET 2011
Author: mirabilos
Date: 2011-03-01 00:25:45 +0100 (Tue, 01 Mar 2011)
New Revision: 15710
Modified:
trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
Log:
Add function util_display_user() to allow further customization of the name.
Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php 2011-02-28 23:25:41 UTC (rev 15709)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/utils.php 2011-02-28 23:25:45 UTC (rev 15710)
@@ -360,7 +360,6 @@
/**
* util_unconvert_htmlspecialchars() - Unconverts a string converted with htmlspecialchars()
- * This function requires PHP 4.0.3 or greater
*
* @param string The string to unconvert
* @returns The unconverted string
@@ -1070,6 +1069,26 @@
}
/**
+ * Display username with link to a user's profile page
+ * and icon face if possible.
+ *
+ * @param string $username
+ * @param int $user_id
+ * @param string $text
+ * @param string $size
+ * @return string
+ */
+function util_display_user($username, $user_id,$text, $size='xs') {
+ $params = array('user_id' => $user_id, 'size' => $size, 'content' => '');
+ plugin_hook_by_reference('user_logo', $params);
+ $url = '<a href="' . util_make_url_u ($username, $user_id) . '">' . $text . '</a>';
+ if ($params['content']) {
+ return $params['content'].$url.'<div class="new_line"></div>';
+ }
+ return $url;
+}
+
+/**
* Create URL for user's profile page
*
* @param string $username
More information about the evolvis-commits
mailing list