diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-11-14 19:02:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-11-14 19:02:24 -0200 |
commit | 2295fe29c395bc6b6306b2f11f187d26253ec54e (patch) | |
tree | 3b8c04743dffbec91a0267ff548d7a9eaa3b4279 | |
parent | b581c3605fbb053c063841ef730d9f26c5ebfb9a (diff) | |
download | muamba-2295fe29c395bc6b6306b2f11f187d26253ec54e.tar.gz muamba-2295fe29c395bc6b6306b2f11f187d26253ec54e.tar.bz2 |
Fixing 'meus emprestimos' widget
-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); + } } } } |