aboutsummaryrefslogtreecommitdiff
path: root/muamba-widget.tpl.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-10-06 23:33:21 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-10-06 23:33:21 -0300
commit309c71bbfc3e652dce65170a9cc52acfc7bef601 (patch)
tree192cd9cdae6b8a87c412985a49e7a6b479eaf2a2 /muamba-widget.tpl.php
parentdf60f5e42bc2f0a29b855a54708c033939802231 (diff)
downloadmuamba-309c71bbfc3e652dce65170a9cc52acfc7bef601.tar.gz
muamba-309c71bbfc3e652dce65170a9cc52acfc7bef601.tar.bz2
More widget fixes
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;