]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - common.php
Add ability to add and delete access to the panel
[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 "misc/server-lookup-misc.php";
13 require_once "Classes/class-log.php";
14 require_once "Classes/class-message.php";
15 require_once "Classes/class-rpc.php";
16 require_once "plugins.php";
17
18 function show_nick_only($str)
19 {
20 $x = strpos($str, "!");
21 if ($x !== false)
22 $str = substr($str, 0, $x);
23 return $str;
24 }
25
26 $pages = Array(
27 "Overview" => "",
28 "Users" => "users",
29 "Channels" => "channels",
30 "Servers" => "servers",
31 "Server Bans" => "server_bans.php",
32 "Spamfilter" => "spamfilter.php",
33 "News" => "news.php",
34 );
35
36
37 Hook::run(HOOKTYPE_NAVBAR, $pages);
38
39 /* Example to add new menu item:
40 *
41 * class MyPlugin
42 * {
43 *
44 * function __construct()
45 * {
46 * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu'])
47 * }
48 *
49 * function add_menu(&$pages) // this should pass by reference (using the & prefix)
50 * {
51 * $page_name = "My New Page";
52 * $page_link = "link/to/page.php";
53 * $pages[$page_name] = $page_link;
54 * }
55 * }
56 */