diff options
Diffstat (limited to 'muamba.module')
-rw-r--r-- | muamba.module | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/muamba.module b/muamba.module index 4c7c4b8..96882d6 100644 --- a/muamba.module +++ b/muamba.module @@ -34,23 +34,39 @@ function muamba_menu() { /** * Implements hook_node_view() + * + * @todo + * Check widget status + * Check permissions */ function muamba_node_view($node, $view_mode, $langcode) { + global $user; + /* - *$node->content['my_additional_field'] = array( - * '#markup' => $additional_field, - * '#weight' => 10, - * '#theme' => 'mymodule_my_additional_field', - *); + // Do not show widget to the owner + if ($node->uid == $user->uid) { + return; + } */ - global $user; if ($view_mode == 'full') { $node->content['muamba'] = array( - '#markup' => 'Request item.', + '#markup' => theme('muamba_widget', array('nid' => $node->nid)), '#weight' => 100, - ); + ); return $node; } } + +/** + * Implements hook_theme() + */ +function muamba_theme($existing, $type, $theme, $path) { + return array( + 'muamba_widget' => array( + 'template' => 'muamba-widget', + 'variables' => array('nid' => NULL), + ), + ); +} |