]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Add HOOKTYPE_HEADER and run during/after header
authorValerie Pond <redacted>
Wed, 5 Jul 2023 00:21:10 +0000 (01:21 +0100)
committerValerie Pond <redacted>
Wed, 5 Jul 2023 00:21:10 +0000 (01:21 +0100)
Classes/class-hook.php
inc/header.php

index e9ba379554ebf2e6612ad78cc20a13120e239d7b..385854173201d135a1ff10430b7d7d3e81ac28f6 100644 (file)
@@ -25,13 +25,16 @@ define('HOOKTYPE_NAVBAR', 100);
  * This doesn't receive anything, however you must still specify an
  * parameter for your hook function, because it's referring to memory. Sorry =]
  * 
- * Currently this is only used by the "sql_db" plugin by Valware in order to
- * redirect users immediately to the login page.
- * 
  * Putting HTML in this hook is not a good idea.
  */
 define('HOOKTYPE_PRE_HEADER', 101);
 
+/** HOOKTYPE_HEADER
+ * 
+ * This is run after/during the header is sent. You can call your global scripts, global css or whatnot from here.
+ */
+define('HOOKTYPE_HEADER', 119);
+
 /** HOOKTYPE_PRE_OVERVIEW_CARD
  * 
  * @param object $stats
@@ -138,6 +141,9 @@ define('HOOKTYPE_EDIT_USER', 117);
 
 define('HOOKTYPE_RIGHTCLICK_MENU', 118);
 
+/* 119 = HOOKTYPE_HEADER (See under HOOKTYPE_PRE_HEADER) */
+
+/** Send out a request to ask if there are any plugins which provide authentication */
 define('HOOKTYPE_AUTH_MOD', 200);
 
 /** An upgrade has been detected.
index 62f433a06f76c309a8f48cb196f66c7bc781d715..256687bd8ddc09916a6603a5a30a72f19caf51ec 100644 (file)
@@ -109,6 +109,7 @@ $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr);
                color: black;
        }
 </style>
+<?php $a = []; Hook::run(HOOKTYPE_HEADER, $a); ?>
 <nav id="sidebarlol" style="left:0;overflow:auto" class="w3-sidebar navbar-expand-md bg-dark padding-top me-5 ma-5">
 <div class="list-group">
        <div class="badge badge-secondary rounded-pill">Main Menu</div>