From 309c71bbfc3e652dce65170a9cc52acfc7bef601 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 6 Oct 2011 23:33:21 -0300 Subject: More widget fixes --- muamba-widget.tpl.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'muamba-widget.tpl.php') 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 = '
'; -$output .= '

'. t('Options') .'

'; +$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 .= '
'; +if (!empty($content)) { + $output = '
'; + $output .= '

'. t('Options') .'

'; + $output .= $content; + $output .= '
'; +} print $output; -- cgit v1.2.3