aboutsummaryrefslogtreecommitdiff
path: root/muamba-widget.tpl.php
diff options
context:
space:
mode:
Diffstat (limited to 'muamba-widget.tpl.php')
-rw-r--r--muamba-widget.tpl.php21
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;