X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/1e6ffd061e2de3f6f6cb225ba2cd86eb465c107c..4225314ca50f26eaecfc828a1608b7d81c274a82:/common.php diff --git a/common.php b/common.php index 3950d60..4892428 100644 --- a/common.php +++ b/common.php @@ -1,15 +1,56 @@ "overview.php", - "Users" => "users.php", - "Channels" => "channels.php", - "Server Bans" => "tkl.php", - "Spamfilter" => "spamfilter.php", - "News" => "news.php"); +function show_nick_only($str) +{ + $x = strpos($str, "!"); + if ($x !== false) + $str = substr($str, 0, $x); + return $str; +} + +$pages = Array( + "Overview" => "", + "Users" => "users", + "Channels" => "channels", + "Servers" => "servers", + "Server Bans" => "server_bans.php", + "Spamfilter" => "spamfilter.php", + "News" => "news.php", +); + + +Hook::run(HOOKTYPE_NAVBAR, $pages); + +/* Example to add new menu item: + * + * class MyPlugin + * { + * + * function __construct() + * { + * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu']) + * } + * + * function add_menu(&$pages) // this should pass by reference (using the & prefix) + * { + * $page_name = "My New Page"; + * $page_link = "link/to/page.php"; + * $pages[$page_name] = $page_link; + * } + * } +*/ \ No newline at end of file