diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 16:31:58 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 16:31:58 -0300 |
commit | 3b83a67933707f41ba03b763a1728aa4afd6176f (patch) | |
tree | 6ad7a98586e29d8dbf64b6d0294e2e2f2bd41fa1 /muamba.module | |
parent | 1459c2923a6f1de73a20466b521fb6e1a627bc45 (diff) | |
download | muamba-3b83a67933707f41ba03b763a1728aa4afd6176f.tar.gz muamba-3b83a67933707f41ba03b763a1728aa4afd6176f.tar.bz2 |
Setting widget
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), + ), + ); +} |