Skip to content

Commit 011a85d

Browse files
committed
new hook: HOOK_ADMIN_NEWS_ADD
1 parent 382f897 commit 011a85d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

system/src/News.php

+11
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ static public function add($title, $body, $type, $category, $player_id, $comment
4848
'article_text' => ($type == 3 ? $article_text : ''),
4949
'article_image' => ($type == 3 ? $article_image : '')
5050
]);
51+
52+
global $hooks;
53+
$hooks->trigger(HOOK_ADMIN_NEWS_ADD,
54+
[
55+
'title' => $title, 'body' => $body,
56+
'type' => $type, 'category' => $category,
57+
'player_id' => $player_id, 'comments' => $comments,
58+
'article_text' => $article_text, 'article_image' => $article_image,
59+
]
60+
);
61+
5162
self::clearCache();
5263
return true;
5364
}

system/src/global.php

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
define('HOOK_ADMIN_BODY_END', ++$i);
7272
define('HOOK_ADMIN_BEFORE_PAGE', ++$i);
7373
define('HOOK_ADMIN_MENU', ++$i);
74+
define('HOOK_ADMIN_NEWS_ADD', ++$i);
7475
define('HOOK_ADMIN_LOGIN_AFTER_ACCOUNT', ++$i);
7576
define('HOOK_ADMIN_LOGIN_AFTER_PASSWORD', ++$i);
7677
define('HOOK_ADMIN_LOGIN_AFTER_SIGN_IN', ++$i);

0 commit comments

Comments
 (0)