]>
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'; |
e92763ac | 9 | require_once UPATH . "/Classes/class-cmodes.php"; |
d72d1923 VP |
10 | require_once UPATH . "/cfg/defines.php"; |
11 | require_once UPATH . "/connection.php"; | |
12 | require_once UPATH . "/misc/strings.php"; | |
e92763ac | 13 | require_once UPATH . "/misc/channel-lookup-misc.php"; |
d72d1923 VP |
14 | require_once UPATH . "/misc/user-lookup-misc.php"; |
15 | require_once UPATH . "/misc/server-lookup-misc.php"; | |
16 | require_once UPATH . "/misc/ip-whois-misc.php"; | |
17 | require_once UPATH . "/Classes/class-log.php"; | |
18 | require_once UPATH . "/Classes/class-message.php"; | |
19 | require_once UPATH . "/Classes/class-rpc.php"; | |
6930484c | 20 | require_once UPATH . "/Classes/class-paneluser.php"; |
d72d1923 | 21 | require_once UPATH . "/plugins.php"; |
1e6ffd06 | 22 | |
5a7f0cde | 23 | $pages = [ |
69f605af BM |
24 | "Overview" => "", |
25 | "Users" => "users", | |
26 | "Channels" => "channels", | |
27 | "Servers" => "servers", | |
33f512fa VP |
28 | "Server Bans" => [ |
29 | "Server Bans" => "server-bans", | |
30 | "Name Bans" => "server-bans/name-bans.php", | |
31 | "Ban Exceptions" => "server-bans/ban-exceptions.php" | |
32 | ], | |
69f605af | 33 | "Spamfilter" => "spamfilter.php", |
e6ad9895 VP |
34 | "Tools" => [ |
35 | "IP WHOIS" => "tools/ip-whois.php", | |
36 | ], | |
b65f0496 | 37 | "Settings" => [ |
0129a486 | 38 | "Panel Access" => "settings", |
b65f0496 VP |
39 | "Plugins" => "settings/plugins.php", |
40 | ], | |
180b8ec1 | 41 | |
69f605af | 42 | "News" => "news.php", |
5a7f0cde | 43 | ]; |
180b8ec1 VP |
44 | if (unreal_get_current_user()) |
45 | { | |
46 | $pages["Logout"] = "login/?logout=true"; | |
47 | } | |
90dc8f2b VP |
48 | |
49 | Hook::run(HOOKTYPE_NAVBAR, $pages); | |
50 | ||
51 | /* Example to add new menu item: | |
90dc8f2b VP |
52 | * |
53 | * class MyPlugin | |
54 | * { | |
55 | * | |
55fd88eb VP |
56 | * function __construct() |
57 | * { | |
58 | * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu']) | |
59 | * } | |
90dc8f2b | 60 | * |
55fd88eb VP |
61 | * function add_menu(&$pages) // this should pass by reference (using the & prefix) |
62 | * { | |
63 | * $page_name = "My New Page"; | |
64 | * $page_link = "link/to/page.php"; | |
65 | * $pages[$page_name] = $page_link; | |
66 | * } | |
90dc8f2b VP |
67 | * } |
68 | */ |