-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugnpay.module
108 lines (103 loc) · 4.19 KB
/
plugnpay.module
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
// $Id$
/**
* @file plugnpay.module
* TODO: Enter file description here.
*/
/**
* Implementation of hook_menu().
*/
function plugnpay_menu() {
// This is the minimum information you can provide for a menu item.
$items['TODO: Enter path'] = array(
'title' => 'TODO: Enter menu item title',
'page callback' => 'TODO: Enter callback function',
'access arguments' => array('TODO: Enter user permissions'),
);
// more complex menu item
$items['TODO: Enter path'] = array(
'title' => 'TODO: Enter menu item title',
'description' => 'TODO: Enter description',
'page callback' => 'TODO: Enter callback function',
'page arguments' => '', // An array of arguments to pass to the page callback function. Integer values pass the corresponding URL component.
'access callback' => '', // defaults to user_access()
'access arguments' => array('TODO: Enter user permissions'),
'weight' => 0,
'type' => MENU_NORMAL_ITEM, // One of MENU_NORMAL_ITEM / MENU_CALLBACK / MENU_SUGGESTED_ITEM / MENU_LOCAL_TASK / MENU_DEFAULT_LOCAL_TASK
'menu_name' => '', // Menu to place this item in.
'title callback' => '', // Function to generate the title, defaults to t().
'title arguments' => '', // Arguments to send to t() or your custom callback.
);
// OPTIONAL: Fill in additional static menu items
return $items;
}
/**
* Implementation of hook_nodeapi().
*/
function plugnpay_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'alter':
// OPTIONAL: the $node->content array has been rendered, so the node body or
// teaser is filtered and now contains HTML. This op should only be used when
// text substitution, filtering, or other raw text operations are necessary.
break;
case 'delete':
// OPTIONAL: The node is being deleted.
break;
case 'delete revision':
// OPTIONAL: The revision of the node is deleted. You can delete data
// associated with that revision.
break;
case 'insert':
// OPTIONAL: The node is being created (inserted in the database).
break;
case 'load':
// OPTIONAL: The node is about to be loaded from the database. This hook
// can be used to load additional data at this time.
break;
case 'prepare':
// OPTIONAL: The node is about to be shown on the add/edit form.
break;
case 'prepare translation':
// OPTIONAL: The node is being cloned for translation. Load
// additional data or copy values from $node->translation_source.
break;
case 'print':
// OPTIONAL: Prepare a node view for printing. Used for printer-friendly
// view in book_module
break;
case 'rss item':
// OPTIONAL: An RSS feed is generated. The module can return properties
// to be added to the RSS item generated for this node. See comment_nodeapi()
// and upload_nodeapi() for examples. The $node passed can also be modified
// to add or remove contents to the feed item.
break;
case 'search result':
// OPTIONAL: The node is displayed as a search result. If you
// want to display extra information with the result, return it.
break;
case 'presave':
// OPTIONAL: The node passed validation and is about to be saved. Modules may
// use this to make changes to the node before it is saved to the database.
break;
case 'update':
// OPTIONAL: The node is being updated.
break;
case 'update index':
// OPTIONAL: The node is being indexed. If you want additional
// information to be indexed which is not already visible through
// nodeapi "view", then you should return it here.
break;
case 'validate':
// OPTIONAL: The user has just finished editing the node and is
// trying to preview or submit it. This hook can be used to check
// the node data. Errors should be set with form_set_error().
break;
case 'view':
// OPTIONAL: The node content is being assembled before rendering. The module
// may add elements $node->content prior to rendering. This hook will be
// called after hook_view(). The format of $node->content is the same as
// used by Forms API.
break;
}
}