diff --git a/ChangeLog b/ChangeLog index 5bc641e81..c5320ff1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-12-26 Badlop + * 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) diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index 3741a1bf6..81bc0e321 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -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, diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 7bc169abe..7da1a8125 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -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)