25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/web/ejabberd_web_admin.erl: Translate menu items of webadmin

hooks in each module (EJAB-485)
* src/mod_shared_roster.erl: Likewise

SVN Revision: 1125
This commit is contained in:
Badlop 2007-12-26 14:53:37 +00:00
parent 264ea1c25f
commit 4562a79b69
3 changed files with 19 additions and 15 deletions

View File

@ -1,5 +1,9 @@
2007-12-26 Badlop <badlop@process-one.net>
* src/web/ejabberd_web_admin.erl: Translate menu items of webadmin
hooks in each module (EJAB-485)
* src/mod_shared_roster.erl: Likewise
* src/web/ejabberd_web_admin.erl: max_user_sessions access rule
contains an integer, but webadmin always expects atoms (EJAB-482)

View File

@ -30,7 +30,7 @@
-behaviour(gen_mod).
-export([start/2, stop/1,
webadmin_menu/2, webadmin_page/3,
webadmin_menu/3, webadmin_page/3,
get_user_roster/2,
get_subscription_lists/3,
get_jid_info/4,
@ -387,8 +387,8 @@ remove_user_from_group(Host, US, Group) ->
%% Web Admin
%%---------------------
webadmin_menu(Acc, _Host) ->
[{"shared-roster", "Shared Roster"} | Acc].
webadmin_menu(Acc, _Host, Lang) ->
[{"shared-roster", ?T("Shared Roster Groups")} | Acc].
webadmin_page(_, Host,
#request{us = _US,

View File

@ -105,8 +105,8 @@ get_auth(Auth) ->
end.
make_xhtml(Els, global, Lang) ->
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_main, [], []),
MenuItems2 = [?LI([?ACT("/admin/"++MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_main, [], [Lang]),
MenuItems2 = [?LI([?AC("/admin/"++MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
{200, [html],
{xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"},
{"xml:lang", Lang},
@ -156,8 +156,8 @@ make_xhtml(Els, global, Lang) ->
make_xhtml(Els, Host, Lang) ->
Base = "/admin/server/" ++ Host ++ "/",
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host]),
MenuItems2 = [?LI([?ACT(Base ++ MI_uri ++ "/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host, Lang]),
MenuItems2 = [?LI([?AC(Base ++ MI_uri ++ "/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
{200, [html],
{xmlelement, "html", [{"xmlns", "http://www.w3.org/1999/xhtml"},
{"xml:lang", Lang},
@ -598,8 +598,8 @@ logo_fill() ->
process_admin(global,
#request{path = [],
lang = Lang}) ->
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_main, [], []),
MenuItems2 = [?LI([?ACT("/admin/"++MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_main, [], [Lang]),
MenuItems2 = [?LI([?AC("/admin/"++MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
make_xhtml([?XCT("h1", "Administration"),
?XE("ul",
[?LI([?ACT("/admin/acls/", "Access Control Lists"), ?C(" "),
@ -617,8 +617,8 @@ process_admin(Host,
#request{path = [],
lang = Lang}) ->
Base = "/admin/server/" ++ Host ++ "/",
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host]),
MenuItems2 = [?LI([?ACT(Base ++ MI_uri ++ "/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host, Lang]),
MenuItems2 = [?LI([?AC(Base ++ MI_uri ++ "/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
make_xhtml([?XCT("h1", "Administration"),
?XE("ul",
[?LI([?ACT(Base ++ "acls/", "Access Control Lists"), ?C(" "),
@ -1647,8 +1647,8 @@ search_running_node(SNode, [Node | Nodes]) ->
get_node(global, Node, [], Query, Lang) ->
Res = node_parse_query(Node, Query),
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_node, [], [Node]),
MenuItems2 = [?LI([?ACT(MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_node, [], [Node, Lang]),
MenuItems2 = [?LI([?AC(MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
[?XC("h1", ?T("Node ") ++ atom_to_list(Node))] ++
case Res of
ok -> [?CT("Submitted"), ?P];
@ -1669,8 +1669,8 @@ get_node(global, Node, [], Query, Lang) ->
];
get_node(Host, Node, [], _Query, Lang) ->
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_hostnode, Host, [], [Host, Node]),
MenuItems2 = [?LI([?ACT(MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
MenuItems1 = ejabberd_hooks:run_fold(webadmin_menu_hostnode, Host, [], [Host, Node, Lang]),
MenuItems2 = [?LI([?AC(MI_uri++"/", MI_name)]) || {MI_uri, MI_name} <- MenuItems1],
[?XC("h1", ?T("Node ") ++ atom_to_list(Node)),
?XE("ul",
[?LI([?ACT("modules/", "Modules")])] ++ MenuItems2)