From 26806c934827c9f58feccb27cc8b6f42d829f38c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 6 Nov 2011 20:46:47 -0200 Subject: Fixing #34 --- muamba.module | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'muamba.module') diff --git a/muamba.module b/muamba.module index 1e010dc..66e0b52 100644 --- a/muamba.module +++ b/muamba.module @@ -107,8 +107,6 @@ function muamba_menu() { /** * Implements hook_node_view() - * - * @todo */ function muamba_node_view($node, $view_mode, $langcode) { global $user; @@ -120,15 +118,27 @@ function muamba_node_view($node, $view_mode, $langcode) { if ($view_mode == 'full') { if ($node->uid != $user->uid) { - $transaction = muamba_current_transactions($node, $user->uid); + $transactions = muamba_current_transactions($node, $user->uid); + $available = muamba_check_availability($node->nid); $node->content['muamba'] = array( - '#markup' => theme('muamba_widget', array('node' => $node, 'transaction' => $transaction)), + '#markup' => theme('muamba_widget', array( + 'node' => $node, + 'transactions' => $transactions, + 'available' => $available, + + )), '#weight' => 100, ); } else { - // @todo: muamba_widget is not working anymore for item owners, make a custom - // widget just for handling multiple requests, see #34 + $transactions = muamba_current_transactions($node); + $node->content['muamba'] = array( + '#markup' => theme('muamba_widget', array( + 'node' => $node, + 'transactions' => $transactions + )), + '#weight' => 100, + ); } return $node; @@ -143,8 +153,9 @@ function muamba_theme($existing, $type, $theme, $path) { 'muamba_widget' => array( 'template' => 'muamba-widget', 'variables' => array( - 'node' => NULL, - 'transaction' => NULL, + 'node' => NULL, + 'transactions' => NULL, + 'available' => NULL, ), ), 'muamba_powered' => array( -- cgit v1.2.3