-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.php
More file actions
46 lines (39 loc) · 1.51 KB
/
Example.php
File metadata and controls
46 lines (39 loc) · 1.51 KB
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
<?php
class ExamplePlugin extends MantisPlugin {
function register() {
$this->name = 'Example'; # Proper name of plugin
$this->description = ''; # Short description of the plugin
$this->page = ''; # Default plugin page
$this->version = '1.0'; # Plugin version string
$this->requires = array( # Plugin dependencies, array of basename => version pairs
'MantisCore' => '1.2.0', # Should always depend on an appropriate version of MantisBT
);
$this->author = 'Anderson Fortaleza'; # Author/team name
$this->contact = 'afortaleza@hotmail.com'; # Author/team e-mail address
$this->url = 'https://www.github.com/afortaleza'; # Support webpage
}
function events() {
return array(
'EVENT_EXAMPLE_FOO' => EVENT_TYPE_EXECUTE,
'EVENT_EXAMPLE_BAR' => EVENT_TYPE_CHAIN,
);
}
function hooks() {
return array(
'EVENT_EXAMPLE_FOO' => 'foo',
'EVENT_EXAMPLE_BAR' => 'bar',
);
}
function foo($p_event) {
echo 'In method foo(). ';
}
function bar($p_event, $p_chained_param) {
return str_replace('foo', 'bar', $p_chained_param);
}
function config() {
return array(
'foo_or_bar' => 'foo',
);
}
}
?>