From f71b98097013d61996d292c0713cccbecd0dcc96 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Fri, 10 May 2013 17:01:18 +0200 Subject: Check if the package maintainer is a user in drupal. When found we display the username which links to this user. --- apk_browser.module | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apk_browser.module b/apk_browser.module index 7e3ee69..5ceb281 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -562,7 +562,17 @@ function apk_browser_package_table($vars) { $fields[t('Project')] = l('URL', $vars['apk_url'][0]['safe_value']); $fields[t('Description')] = $vars['apk_description'][0]['safe_value']; $fields[t('License')] = $vars['apk_license'][0]['safe_value']; - $fields[t('Maintainer')] = empty($vars['apk_maintainer']) ? $empty : $vars['apk_maintainer'][0]['safe_value']; + if (isset($vars['apk_maintainer'][0]['value'])) { + $uid = apk_browser_maintainer_to_user($vars['apk_maintainer'][0]['value']); + if ($uid) { + $user = user_load($uid); + $fields[t('Maintainer')] = l($user->name, 'user/' . $user->uid); + } else { + $fields[t('Maintainer')] = $vars['apk_maintainer'][0]['safe_value']; + } + } else { + $fields[t('Maintainer')] = $empty; + } $fields[t('Build date')] = empty($vars['apk_build_time']) ? $empty : date('r', $vars['apk_build_time'][0]['value']); $fields[t('Commit')] = empty($vars['apk_commit']) ? $empty : apk_browser_commit_url($vars['apk_commit']['0']['value']); //only show origin if its different then itself -- cgit v1.2.3