diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-10-06 23:33:21 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-10-06 23:33:21 -0300 |
commit | 309c71bbfc3e652dce65170a9cc52acfc7bef601 (patch) | |
tree | 192cd9cdae6b8a87c412985a49e7a6b479eaf2a2 /muamba-widget.tpl.php | |
parent | df60f5e42bc2f0a29b855a54708c033939802231 (diff) | |
download | muamba-309c71bbfc3e652dce65170a9cc52acfc7bef601.tar.gz muamba-309c71bbfc3e652dce65170a9cc52acfc7bef601.tar.bz2 |
More widget fixes
Diffstat (limited to 'muamba-widget.tpl.php')
-rw-r--r-- | muamba-widget.tpl.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/muamba-widget.tpl.php b/muamba-widget.tpl.php index d2c6ca7..06d547b 100644 --- a/muamba-widget.tpl.php +++ b/muamba-widget.tpl.php @@ -13,24 +13,24 @@ global $user; drupal_add_js($path .'/muamba.js'); drupal_add_css($path .'/muamba.css'); -$output = '<div class="muamba-widget">'; -$output .= '<h3>'. t('Options') .'</h3>'; +$content = ''; +$output = ''; -if (empty($transaction)) { - $output .= theme('muamba_widget_icon', array('status' => MUAMBA_REQUESTED, 'id' => $nid)); +if (empty($transaction) && $node->uid != $user->uid) { + $content .= theme('muamba_widget_icon', array('status' => MUAMBA_REQUESTED, 'id' => $node->nid)); } elseif ($transaction['uid'] == $user->uid) { foreach (muamba_actions_available('sent', $transaction['status']) as $action) { - $output .= theme('muamba_widget_icon', array('status' => $action, 'id' => $transaction['mid'])); + $content .= theme('muamba_widget_icon', array('status' => $action, 'id' => $transaction['mid'])); } } elseif ($transaction['owner'] == $user->uid) { foreach (muamba_actions_available('received', $transaction['status']) as $action) { - $output .= theme('muamba_widget_icon', array('status' => $action, 'id' => $transaction['mid'])); + $content .= theme('muamba_widget_icon', array('status' => $action, 'id' => $transaction['mid'])); } } else { - $icon = theme('image', + $content .= theme('image', array( 'path' => $path .'/images/unavailable.png', 'alt' => t('Item unavailable'), @@ -39,6 +39,11 @@ else { ); } -$output .= '</div>'; +if (!empty($content)) { + $output = '<div class="muamba-widget">'; + $output .= '<h3>'. t('Options') .'</h3>'; + $output .= $content; + $output .= '</div>'; +} print $output; |