aboutsummaryrefslogtreecommitdiff
path: root/muamba.module
blob: 4c7c4b888959d879f8ec804b45994199edb02b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php

/**
 * @file
 * Multiple-user Asset Manager and Borrowing Ambient.
 */

/**
 * Implements hook_permission()
 */
function muamba_permission() {
  return array(
    'administer muamba' =>  array(
      'title'       => t('request item'),
      'description' => t('Request an item to be borrowed or donated.'),
    ),
  );
}

/**
 * Implements hook_menu()
 */
function muamba_menu() {
  $items['muamba/request'] = array(
    'title'            => 'Request item',
    'page callback'    => 'muamba_request',
    'access arguments' => array('request item'),
    'type'             => MENU_SUGGESTED_ITEM,
    'file'             => 'muamba.misc.inc',
  );

  return $items;
}

/**
 * Implements hook_node_view()
 */
function muamba_node_view($node, $view_mode, $langcode) {
  /*
   *$node->content['my_additional_field'] = array(
   *  '#markup' => $additional_field,
   *  '#weight' => 10,
   *  '#theme' => 'mymodule_my_additional_field',
   *);
   */
  global $user;

  if ($view_mode == 'full') {
    $node->content['muamba'] = array(
      '#markup' => 'Request item.',
      '#weight' => 100,
      );

    return $node;
  }
}