diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2013-05-10 17:01:18 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2013-05-10 17:01:18 +0200 |
commit | f71b98097013d61996d292c0713cccbecd0dcc96 (patch) | |
tree | 4a7d2bec9e784c962788cf2bc1e1c99ef9917473 /apk_browser.module | |
parent | 80e105a0b21b47a3935faa0a93e2d15a4de62d2e (diff) | |
download | apk_browser-f71b98097013d61996d292c0713cccbecd0dcc96.tar.bz2 apk_browser-f71b98097013d61996d292c0713cccbecd0dcc96.tar.xz |
Check if the package maintainer is a user in drupal.
When found we display the username which links to this user.
Diffstat (limited to 'apk_browser.module')
-rw-r--r-- | apk_browser.module | 12 |
1 files changed, 11 insertions, 1 deletions
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 |