diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-11-07 20:57:32 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-11-07 20:57:32 -0200 |
commit | 23843e21523a7b2a73c54eff2a71e6a481c56cae (patch) | |
tree | 8d7aa81bfded818fb607c63870372ac651af389d /muamba.module | |
parent | c205ae2d3a8eafcd8a07d2f0bcac1b2ea48a6a0f (diff) | |
download | muamba-23843e21523a7b2a73c54eff2a71e6a481c56cae.tar.gz muamba-23843e21523a7b2a73c54eff2a71e6a481c56cae.tar.bz2 |
Adding muamba_widget() for widget handling
Diffstat (limited to 'muamba.module')
-rw-r--r-- | muamba.module | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/muamba.module b/muamba.module index 2b76df9..e9d6bf1 100644 --- a/muamba.module +++ b/muamba.module @@ -109,29 +109,9 @@ function muamba_menu() { * Implements hook_node_view() */ function muamba_node_view($node, $view_mode, $langcode) { - global $user; - - // Check if widget can be shown - if ($node->type != MUAMBA_NODE_TYPE || !muamba_has_request_access($node)) { - return; - } - if ($view_mode == 'full') { - $available = muamba_check_availability($node->nid); - - if ($node->uid != $user->uid) { - $transactions = muamba_current_transactions($node, $user->uid); - } - else { - $transactions = muamba_current_transactions($node); - } - $node->content['muamba'] = array( - '#markup' => theme('muamba_widget', array( - 'node' => $node, - 'transactions' => $transactions, - 'available' => $available, - )), + '#markup' => muamba_widget($node), '#weight' => 100, ); @@ -152,6 +132,18 @@ function muamba_theme($existing, $type, $theme, $path) { 'available' => NULL, ), ), + 'muamba_widget_owner' => array( + 'variables' => array( + 'transaction' => NULL, + ), + 'file' => 'muamba.theme.inc', + ), + 'muamba_widget_requester' => array( + 'variables' => array( + 'transaction' => NULL, + ), + 'file' => 'muamba.theme.inc', + ), 'muamba_powered' => array( 'template' => 'muamba-powered', ), |