]> jfr.im git - irc/unrealircd/unrealircd-webpanel-plugins.git/blob - example_plugin/example_plugin.php
Update example_plugin.php
[irc/unrealircd/unrealircd-webpanel-plugins.git] / example_plugin / example_plugin.php
1 <?php
2 /*
3 --======-- Example Plugin --=======--
4
5 Below are the credentials needed.
6 You must specify them in this format.
7 The only things that are not mandatory
8 are icons and screenshots. the rest
9 are mandatory or your plugin will not
10 be accepted.
11
12 */
13 /**
14 @title Example Plugin
15 @author Valware
16 @description This plugin adds an example page and does nothing special by itself. Have a nice day!
17 @contact valerie@valware.co.uk
18 @version 1.0
19 @tested 0.9
20 @minver 0.9
21 @maxver *
22 @license GPLv3
23 @icon https://github.com/unrealircd/unrealircd-webpanel-plugins/blob/main/example_plugin/screenshots/example_icon.png?raw=true
24 @screenshot https://github.com/unrealircd/unrealircd-webpanel-plugins/blob/main/example_plugin/screenshots/example_plugin.jpg?raw=true
25 @screenshot https://github.com/unrealircd/unrealircd-webpanel-plugins/blob/main/example_plugin/screenshots/example_plugin2.jpg?raw=true
26 */
27
28 class example_plugin
29 {
30 /* You must specify these here for internal use
31 * All of these are mandatory or your plugin will not work.
32 */
33 public $name = "Example plugin"; // Name of your plugin
34 public $author = "Valware"; // Name or handle of your lovely self
35 public $version = "1.0"; // Version of this plugin
36 public $description = "An example plugin to show how to make stuff"; // Description of your beautiful plugin
37 public $email = "v.a.pond@outlook.com"; // An email people can contact you with in case of problems
38
39 /** This is run on plugin load. You can add hooks and initialize whatever databases
40 * that you think you might need.
41 */
42 function __construct()
43 {
44 /**The hook for the navigation bar.
45 * The first argument is the HOOKTYPE we're using. In this case
46 * we're using NAVBAR to add our page to the navigation bar.
47 * For a full list of hooks, see this page:
48 * https://github.com/unrealircd/unrealircd-webpanel/blob/main/Classes/class-hook.php
49 *
50 * The second argument references the function you want to include
51 * in your hooked function. In this example we are referencing a
52 * method (function) in this class (example_plugin)
53 */
54 Hook::func(HOOKTYPE_NAVBAR, 'example_plugin::add_navbar');
55 }
56
57 /** This is the method (function) that we have hooked.
58 * Now we can do things. Make sure to check the relevant hooks
59 * for the right variables to use.
60 * We use variable reference (&) on this hook
61 */
62 public static function add_navbar(&$pages)
63 {
64 $page_name = "Example";
65 $page_link = "plugins/example_plugin/example.php";
66 $pages[$page_name] = $page_link;
67 }
68 }
69