From 6dcb9c045682e28c7fc98d037f5935531a038b5a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 8 Oct 2005 00:41:56 +0000 Subject: [PATCH] r494: Changed construct_user_display() to use a template --- global.php | 3 ++- includes/functions.php | 4 +++- templates/username_display.tpl | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 templates/username_display.tpl diff --git a/global.php b/global.php index 3943be7..a282077 100755 --- a/global.php +++ b/global.php @@ -80,7 +80,8 @@ $globaltemplates = array( 'bugfield_input_text', 'bugfield_input_checkbox', 'bugfield_select_single_option', - 'bugfield_select_single' + 'bugfield_select_single', + 'username_display' ); $start = microtime(); diff --git a/includes/functions.php b/includes/functions.php index 53bedb6..922a633 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -42,8 +42,10 @@ function construct_option_select($name, $array, $selected = 0, $valuekey = '', $ // $userinfo needs userid, email, displayname, and showemail function construct_user_display($userinfo, $userid = true) { + global $bugsys; fetch_user_display_name($userinfo); - return "$userinfo[displayname]" . (($userinfo['showemail']) ? " <$userinfo[email]>" : '') . (($userid) ? " (userid: $userinfo[userid])" : ''); + eval('$username = "' . $bugsys->template->fetch('username_display') . '";'); + return $username; } // ######################## Start can_perform ######################## diff --git a/templates/username_display.tpl b/templates/username_display.tpl new file mode 100644 index 0000000..b7a1a3d --- /dev/null +++ b/templates/username_display.tpl @@ -0,0 +1 @@ +{@"User ID: %1$s"}">$userinfo[displayname]$userinfo[displayname] \ No newline at end of file -- 2.22.5