]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - common.php
Add hooking system and example plugin
[irc/unrealircd/unrealircd-webpanel.git] / common.php
1 <?php
2 define('UPATH', dirname(__FILE__));
3 require_once "config.php";
4 require_once "hook.php";
5 require_once "plugins.php";
6 require_once UPATH . '/vendor/autoload.php';
7 require_once "connection.php";
8 require_once "Classes/class-log.php";
9 require_once "Classes/class-message.php";
10 require_once "Classes/class-rpc.php";
11
12 $pages = Array("Overview" => "overview.php",
13 "Users" => "users.php",
14 "Channels" => "channels.php",
15 "Server Bans" => "tkl.php",
16 "Spamfilter" => "spamfilter.php",
17 "News" => "news.php");
18
19
20 Hook::run(HOOKTYPE_NAVBAR, $pages);
21
22 /* Example to add new menu item:
23 *
24 * Example to add a navigation bar:
25 *
26 * class MyPlugin
27 * {
28 *
29 * function __construct()
30 * {
31 * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu'])
32 * }
33 *
34 * function add_menu(&$pages) // this should pass by reference (using the & prefix)
35 * {
36 * $page_name = "My New Page";
37 * $page_link = "link/to/page.php";
38 * $pages[$page_name] = $page_link;
39 * }
40 * }
41 */