From 011a85d8ae34283ded6999882833f9d4797028ec Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 10 Nov 2024 20:25:17 +0100 Subject: [PATCH] new hook: HOOK_ADMIN_NEWS_ADD --- system/src/News.php | 11 +++++++++++ system/src/global.php | 1 + 2 files changed, 12 insertions(+) diff --git a/system/src/News.php b/system/src/News.php index 02923837..83eedb38 100644 --- a/system/src/News.php +++ b/system/src/News.php @@ -48,6 +48,17 @@ class News 'article_text' => ($type == 3 ? $article_text : ''), 'article_image' => ($type == 3 ? $article_image : '') ]); + + global $hooks; + $hooks->trigger(HOOK_ADMIN_NEWS_ADD, + [ + 'title' => $title, 'body' => $body, + 'type' => $type, 'category' => $category, + 'player_id' => $player_id, 'comments' => $comments, + 'article_text' => $article_text, 'article_image' => $article_image, + ] + ); + self::clearCache(); return true; } diff --git a/system/src/global.php b/system/src/global.php index e106a57c..8ab06c81 100644 --- a/system/src/global.php +++ b/system/src/global.php @@ -71,6 +71,7 @@ define('HOOK_ADMIN_BODY_START', ++$i); define('HOOK_ADMIN_BODY_END', ++$i); define('HOOK_ADMIN_BEFORE_PAGE', ++$i); define('HOOK_ADMIN_MENU', ++$i); +define('HOOK_ADMIN_NEWS_ADD', ++$i); define('HOOK_ADMIN_LOGIN_AFTER_ACCOUNT', ++$i); define('HOOK_ADMIN_LOGIN_AFTER_PASSWORD', ++$i); define('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN', ++$i);