forked from jfinstrom/FreePBX-HelloWorld
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfunctions.inc.php
54 lines (46 loc) · 1.61 KB
/
functions.inc.php
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
<?php
/**
* <this raw module name>_hook_<hooked raw module name>
*
* This function allows one to hook html into many different modules' pages to display html/information
* In this example we have hooked into blacklist
*
* @return string The return HTML to send back
*/
function helloworld_hook_blacklist() {
$html = '';
$html = '<tr><td colspan="2"><h5>';
$html .= _("Hello World Hook");
$html .= '<hr></h5></td></tr>';
$html .= '<tr><td><a href="#" class="info">';
$html .= _("This is the Text for the item").'<span>'._("Popup Help Descriptions").'.</span></a>';
$html .= '</td><td>';
$html .= 'This is the item';
$html .= '</td></tr>';
return $html;
}
/**
* <this raw module name>_hookProcess_<hooked raw module name>
*
* This function allows one to process data that was saved on the hooked raw module page
*
* @param $viewing_itemid string the id of the item being viewed
* @param $request array php's $_REQUEST array
* @return bool true successful or false if not
*/
function helloworld_hookProcess_blacklist($viewing_itemid, $request) {
}
function helloworld_configpageinit($pagename) {
helloworld_applyhooks();
}
function helloworld_applyhooks() {
global $currentcomponent;
// Add the 'process' function - this gets called when the page is loaded, to hook into
// displaying stuff on the page.
$currentcomponent->addguifunc('helloworld_configpageload');
}
function helloworld_configpageload() {
global $currentcomponent, $endpoint, $db;
$section = _('Hooker');
$currentcomponent->addguielem($section, new gui_drawselects('hooker_box', 50, '', 'GUI Item Name', 'Gui Item Help Text'), 9);
}