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