]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - common.php
BASE_URL, not BASE_DIR :D
[irc/unrealircd/unrealircd-webpanel.git] / common.php
1 <?php
2 define('UPATH', dirname(__FILE__));
3 require_once "config.php";
4 if (!defined('BASE_URL')) die("You need to define BASE_URL in config.php (see config.php.sample for documentation)");
5 require_once "Classes/class-hook.php";
6 if (!is_dir(UPATH . "/vendor"))
7 die("The vendor/ directory is missing. Most likely the admin forgot to run 'composer install'\n");
8 require_once UPATH . '/vendor/autoload.php';
9 require_once "connection.php";
10 require_once "misc/strings.php";
11 require_once "misc/user-lookup-misc.php";
12 require_once "Classes/class-log.php";
13 require_once "Classes/class-message.php";
14 require_once "Classes/class-rpc.php";
15 require_once "plugins.php";
16
17 $pages = Array("Overview" => "index.php",
18 "Users" => "users/index.php",
19 "Channels" => "channels.php",
20 "Server Bans" => "tkl.php",
21 "Spamfilter" => "spamfilter.php",
22 "News" => "news.php");
23
24
25 Hook::run(HOOKTYPE_NAVBAR, $pages);
26
27 /* Example to add new menu item:
28 *
29 * class MyPlugin
30 * {
31 *
32 * function __construct()
33 * {
34 * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu'])
35 * }
36 *
37 * function add_menu(&$pages) // this should pass by reference (using the & prefix)
38 * {
39 * $page_name = "My New Page";
40 * $page_link = "link/to/page.php";
41 * $pages[$page_name] = $page_link;
42 * }
43 * }
44 */