From 77ff6573514664769bdd4abff2557d3d5cefa23a Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 3 Mar 2009 18:24:42 +0000 Subject: [PATCH] Merge 1859 from trunk. * src/web/ejabberd_web_admin.erl: Calls to the hook webadmin_menu_node provide the node as first argument, and calls to webadmin_menu_hostnode provide both the host and the node. Fix call to make_menu_items, because webadmin_menu_node was called in cases where webadmin_menu_hostnode should be called. Align to right some table elements. SVN Revision: 1938 --- ChangeLog | 19 +++++++++++++------ src/web/ejabberd_web_admin.erl | 23 ++++++++++++----------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 688f4deba..2395362a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-03-03 Badlop + * src/web/ejabberd_web_admin.erl: Calls to the hook + webadmin_menu_node provide the node as first argument, and calls + to webadmin_menu_hostnode provide both the host and the node. Fix + call to make_menu_items, because webadmin_menu_node was called in + cases where webadmin_menu_hostnode should be called. Align to + right some table elements. + * doc/Makefile: In Clean do not remove html. In new Distclean, remove also html. @@ -8,21 +15,21 @@ * src/Makefile.in: Fix arguments to Install program * doc/guide.tex: Provide only an example of language option - * doc/guide.html: Likewise + * doc/guide.html: Likewise * doc/guide.tex: mod_muc can run in several nodes of cluster - * doc/guide.html: Likewise + * doc/guide.html: Likewise * doc/api/process-one.css: Add some style to HTML elements - * src/ejabberd_listener.erl: Fix EDoc errors - * src/web/ejabberd_web_admin.erl: Likewise + * src/ejabberd_listener.erl: Fix EDoc errors + * src/web/ejabberd_web_admin.erl: Likewise * src/ejabberd_hooks.erl: Explanation in EDoc of some functions * doc/guide.tex: Explain that account creation is only supported - by internal and odbc authentication methods - * doc/guide.html: Likewise + by internal and odbc authentication methods + * doc/guide.html: Likewise * src/Makefile.in: The path to the installed copy of ejabberd Guide is set in the environment variable diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index 1182c2a9f..7092697a4 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -556,6 +556,7 @@ p.result { *.alignright { font-size: 10pt; + text-align: right; } ". @@ -1724,7 +1725,7 @@ get_node(global, Node, [], Query, Lang) -> get_node(Host, Node, [], _Query, Lang) -> Base = get_base_path(Host, Node), - MenuItems2 = make_menu_items(global, Node, Base, Lang), + MenuItems2 = make_menu_items(Host, Node, Base, Lang), [?XC('h1', ?T("Node ") ++ atom_to_list(Node)), ?XE('ul', [?LI([?ACT(Base ++ "modules/", "Modules")])] ++ MenuItems2) @@ -2345,16 +2346,16 @@ make_menu_items(global, cluster, Base, Lang) -> HookItems = get_menu_items_hook(server, Lang), make_menu_items(Lang, {Base, "", HookItems}); -make_menu_items(global, _Node, Base, Lang) -> - HookItems = get_menu_items_hook(node, Lang), +make_menu_items(global, Node, Base, Lang) -> + HookItems = get_menu_items_hook({node, Node}, Lang), make_menu_items(Lang, {Base, "", HookItems}); make_menu_items(Host, cluster, Base, Lang) -> HookItems = get_menu_items_hook({host, Host}, Lang), make_menu_items(Lang, {Base, "", HookItems}); -make_menu_items(Host, _Node, Base, Lang) -> - HookItems = get_menu_items_hook({hostnode, Host}, Lang), +make_menu_items(Host, Node, Base, Lang) -> + HookItems = get_menu_items_hook({hostnode, Host, Node}, Lang), make_menu_items(Lang, {Base, "", HookItems}). @@ -2365,7 +2366,7 @@ make_host_node_menu(_, cluster, _Lang) -> make_host_node_menu(Host, Node, Lang) -> HostNodeBase = get_base_path(Host, Node), HostNodeFixed = [{"modules/", "Modules"}], - HostNodeHook = get_menu_items_hook({hostnode, Host}, Lang), + HostNodeHook = get_menu_items_hook({hostnode, Host, Node}, Lang), {HostNodeBase, atom_to_list(Node), HostNodeFixed ++ HostNodeHook}. make_host_menu(global, _HostNodeMenu, _Lang) -> @@ -2391,7 +2392,7 @@ make_node_menu(global, Node, Lang) -> {"ports/", "Listened Ports"}, {"stats/", "Statistics"}, {"update/", "Update"}], - NodeHook = get_menu_items_hook(node, Lang), + NodeHook = get_menu_items_hook({node, Node}, Lang), {NodeBase, atom_to_list(Node), NodeFixed ++ NodeHook}; make_node_menu(_Host, _Node, _Lang) -> {"", "", []}. @@ -2407,12 +2408,12 @@ make_server_menu(HostMenu, NodeMenu, Lang) -> {Base, "ejabberd", Fixed ++ Hook}. -get_menu_items_hook({hostnode, Host}, Lang) -> - ejabberd_hooks:run_fold(webadmin_menu_hostnode, list_to_binary(Host), [], [Host, Lang]); +get_menu_items_hook({hostnode, Host, Node}, Lang) -> + ejabberd_hooks:run_fold(webadmin_menu_hostnode, list_to_binary(Host), [], [Host, Node, Lang]); get_menu_items_hook({host, Host}, Lang) -> ejabberd_hooks:run_fold(webadmin_menu_host, list_to_binary(Host), [], [Host, Lang]); -get_menu_items_hook(node, Lang) -> - ejabberd_hooks:run_fold(webadmin_menu_node, [], [Lang]); +get_menu_items_hook({node, Node}, Lang) -> + ejabberd_hooks:run_fold(webadmin_menu_node, [], [Node, Lang]); get_menu_items_hook(server, Lang) -> ejabberd_hooks:run_fold(webadmin_menu_main, [], [Lang]).