]>
Commit | Line | Data |
---|---|---|
e98b5a51 BM |
1 | <?php |
2 | define('UPATH', dirname(__FILE__)); | |
d72d1923 | 3 | require_once UPATH . "/config.php"; |
e010b54c | 4 | if (!defined('BASE_URL')) die("You need to define BASE_URL in config.php (see config.php.sample for documentation)"); |
55fd88eb | 5 | require_once "Classes/class-hook.php"; |
c4f272ad BM |
6 | if (!is_dir(UPATH . "/vendor")) |
7 | die("The vendor/ directory is missing. Most likely the admin forgot to run 'composer install'\n"); | |
e98b5a51 | 8 | require_once UPATH . '/vendor/autoload.php'; |
d72d1923 VP |
9 | require_once UPATH . "/cfg/defines.php"; |
10 | require_once UPATH . "/connection.php"; | |
11 | require_once UPATH . "/misc/strings.php"; | |
12 | require_once UPATH . "/misc/user-lookup-misc.php"; | |
13 | require_once UPATH . "/misc/server-lookup-misc.php"; | |
14 | require_once UPATH . "/misc/ip-whois-misc.php"; | |
15 | require_once UPATH . "/Classes/class-log.php"; | |
16 | require_once UPATH . "/Classes/class-message.php"; | |
17 | require_once UPATH . "/Classes/class-rpc.php"; | |
18 | require_once UPATH . "/plugins.php"; | |
1e6ffd06 | 19 | |
69f605af BM |
20 | $pages = Array( |
21 | "Overview" => "", | |
22 | "Users" => "users", | |
23 | "Channels" => "channels", | |
24 | "Servers" => "servers", | |
33f512fa VP |
25 | "Server Bans" => [ |
26 | "Server Bans" => "server-bans", | |
27 | "Name Bans" => "server-bans/name-bans.php", | |
28 | "Ban Exceptions" => "server-bans/ban-exceptions.php" | |
29 | ], | |
69f605af BM |
30 | "Spamfilter" => "spamfilter.php", |
31 | "News" => "news.php", | |
32 | ); | |
90dc8f2b VP |
33 | |
34 | ||
35 | Hook::run(HOOKTYPE_NAVBAR, $pages); | |
36 | ||
37 | /* Example to add new menu item: | |
90dc8f2b VP |
38 | * |
39 | * class MyPlugin | |
40 | * { | |
41 | * | |
55fd88eb VP |
42 | * function __construct() |
43 | * { | |
44 | * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu']) | |
45 | * } | |
90dc8f2b | 46 | * |
55fd88eb VP |
47 | * function add_menu(&$pages) // this should pass by reference (using the & prefix) |
48 | * { | |
49 | * $page_name = "My New Page"; | |
50 | * $page_link = "link/to/page.php"; | |
51 | * $pages[$page_name] = $page_link; | |
52 | * } | |
90dc8f2b VP |
53 | * } |
54 | */ |