new hook: HOOK_ADMIN_NEWS_ADD

This commit is contained in:
slawkens 2024-11-10 20:25:17 +01:00
parent 382f897322
commit 011a85d8ae
2 changed files with 12 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);