diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-27 20:59:10 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-27 20:59:10 +0000 |
commit | f3d77d909b399154dbb6aac4a2a53a9e11a6694a (patch) | |
tree | e5e2621e8ec2bfa296c560e36bd2b26fd861f640 /apk_browser.module | |
parent | 7d2bc871ba497eb5627d4bd84bb7265283d38471 (diff) | |
download | apk_browser-f3d77d909b399154dbb6aac4a2a53a9e11a6694a.tar.bz2 apk_browser-f3d77d909b399154dbb6aac4a2a53a9e11a6694a.tar.xz |
move vars inside if
Diffstat (limited to 'apk_browser.module')
-rw-r--r-- | apk_browser.module | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apk_browser.module b/apk_browser.module index 70e37ab..2a5532b 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -481,19 +481,19 @@ function apk_browser_cleanup() { //create an url from the commit, and if we find it in aggregator we add a title function apk_browser_commit_url($commit) { $fid = variable_get('apk_import_aggregator','0'); + $attributes = array(); + $href = str_replace('%commit%', $commit, variable_get('apk_import_commit_url', '')); if (module_exists('aggregator') && $fid) { if (!empty($commit)) { $search = '%' . $commit . '%'; } $title = db_query("SELECT title FROM {aggregator_item} WHERE link LIKE :commit AND fid = :fid", array(':commit' => $search, ':fid' => $fid))->fetchField(); - } - $href = str_replace('%commit%', $commit, variable_get('apk_import_commit_url', '')); - $attributes = empty($title) ? array() : array('title' => check_plain($title), 'class' => 'with-tooltip'); - //if we get title from query we add tooltip js script - if ($title) { - $path = drupal_get_path('module', 'apk_browser'); - drupal_add_js($path . '/tooltip/tooltip.js'); - drupal_add_js('jQuery().ready(function(){jQuery(".with-tooltip").simpletooltip();});', 'inline'); + if ($title) { + $attributes = array('title' => check_plain($title), 'class' => 'with-tooltip'); + $path = drupal_get_path('module', 'apk_browser'); + drupal_add_js($path . '/tooltip/tooltip.js'); + drupal_add_js('jQuery().ready(function(){jQuery(".with-tooltip").simpletooltip();});', 'inline'); + } } return l($commit, $href, array('attributes' => $attributes)); } @@ -551,7 +551,7 @@ function apk_browser_package_table($vars) { $fields[t('Build date')] = empty($vars['apk_build_time']) ? $empty : date('r', $vars['apk_build_time'][0]['safe_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 - if ($vars['apk_origin'][0]['value'] != $vars['title']) { + if (!empty($vars['apk_origin']) && ($vars['apk_origin'][0]['value'] != $vars['title'])) { $fields[t('Origin')] = $origin; } //to prevent misunderstanding only display when needed. |