diff options
-rw-r--r-- | muamba.handlers.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/muamba.handlers.inc b/muamba.handlers.inc index 87d0dd8..def07ef 100644 --- a/muamba.handlers.inc +++ b/muamba.handlers.inc @@ -92,8 +92,20 @@ class views_handler_field_muamba_actions extends views_handler_field { } } elseif (isset($values->nid)) { - $node = node_load($values->nid); - return muamba_widget($node); + if (isset($values->users_muamba_uid)) { + $transaction = muamba_current_transactions($values->nid, $values->users_muamba_uid); + + if ($transaction['owner'] == $user->uid) { + return theme('muamba_widget_owner', array('transaction' => $transaction)); + } + elseif ($transaction['uid'] == $user->uid) { + return theme('muamba_widget_requester', array('transaction' => $transaction)); + } + } + else { + $node = node_load($values->nid); + return muamba_widget($node); + } } } } |