1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

Run new webadmin hooks to add items to system menu

This commit is contained in:
Badlop 2025-04-14 17:58:58 +02:00
parent 288eecc23d
commit 653413e912
2 changed files with 21 additions and 6 deletions

View file

@ -131,9 +131,12 @@ ul li #navhead a, ul li #navheadsub a, ul li #navheadsubsub a {
background: #424a55;
color: #fff;
}
#navitemlogin-start {
border-top: 0.2em solid #cae7e4;
}
#navitemlogin {
padding: 0.5em;
border-top: 0.2em solid #cae7e4;
border-bottom: 0.2em solid #cae7e4;
padding-left: 0.5em;
}

View file

@ -1660,9 +1660,19 @@ make_login_items(#request{us = {Username, Host}} = R, Level) ->
_ ->
UserEl
end,
MenuPost =
case ejabberd_hooks:run_fold(webadmin_menu_system_post, [], [R]) of
[] ->
[];
PostElements ->
[{xmlel,
<<"div">>,
[{<<"id">>, <<"navitemlogin">>}],
[?XE(<<"ul">>, PostElements)]}]
end,
[{xmlel,
<<"li">>,
[],
[{<<"id">>, <<"navitemlogin-start">>}],
[{xmlel,
<<"div">>,
[{<<"id">>, <<"navitemlogin">>}],
@ -1673,10 +1683,12 @@ make_login_items(#request{us = {Username, Host}} = R, Level) ->
R,
[{<<"sentence">>, misc:atom_to_binary(node())}],
[{only, value},
{result_links, [{sentence, node, Level, <<"">>}]}])]),
?LI([?C(unicode:characters_to_binary("📤")),
{result_links, [{sentence, node, Level, <<"">>}]}])])]
++ ejabberd_hooks:run_fold(webadmin_menu_system_inside, [], [R])
++ [?LI([?C(unicode:characters_to_binary("📤")),
?AC(<<(binary:copy(<<"../">>, Level))/binary, "logout/">>,
<<"Logout">>)])])]}]}].
<<"Logout">>)])])]}]
++ MenuPost}].
%%%==================================