25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

* 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: 1859
This commit is contained in:
Badlop 2009-02-02 10:12:44 +00:00
parent dd49b98580
commit aab07df37b
2 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2009-02-02 Badlop <badlop@process-one.net>
* 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.
2009-01-31 Badlop <badlop@process-one.net> 2009-01-31 Badlop <badlop@process-one.net>
* doc/guide.tex: Provide only an example of language option * doc/guide.tex: Provide only an example of language option

View File

@ -550,6 +550,7 @@ p.result {
*.alignright { *.alignright {
font-size: 10pt; font-size: 10pt;
text-align: right;
} }
". ".
@ -1697,7 +1698,7 @@ get_node(global, Node, [], Query, Lang) ->
get_node(Host, Node, [], _Query, Lang) -> get_node(Host, Node, [], _Query, Lang) ->
Base = get_base_path(Host, Node), 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)), [?XC("h1", ?T("Node ") ++ atom_to_list(Node)),
?XE("ul", ?XE("ul",
[?LI([?ACT(Base ++ "modules/", "Modules")])] ++ MenuItems2) [?LI([?ACT(Base ++ "modules/", "Modules")])] ++ MenuItems2)
@ -2360,16 +2361,16 @@ make_menu_items(global, cluster, Base, Lang) ->
HookItems = get_menu_items_hook(server, Lang), HookItems = get_menu_items_hook(server, Lang),
make_menu_items(Lang, {Base, "", HookItems}); make_menu_items(Lang, {Base, "", HookItems});
make_menu_items(global, _Node, Base, Lang) -> make_menu_items(global, Node, Base, Lang) ->
HookItems = get_menu_items_hook(node, Lang), HookItems = get_menu_items_hook({node, Node}, Lang),
make_menu_items(Lang, {Base, "", HookItems}); make_menu_items(Lang, {Base, "", HookItems});
make_menu_items(Host, cluster, Base, Lang) -> make_menu_items(Host, cluster, Base, Lang) ->
HookItems = get_menu_items_hook({host, Host}, Lang), HookItems = get_menu_items_hook({host, Host}, Lang),
make_menu_items(Lang, {Base, "", HookItems}); make_menu_items(Lang, {Base, "", HookItems});
make_menu_items(Host, _Node, Base, Lang) -> make_menu_items(Host, Node, Base, Lang) ->
HookItems = get_menu_items_hook({hostnode, Host}, Lang), HookItems = get_menu_items_hook({hostnode, Host, Node}, Lang),
make_menu_items(Lang, {Base, "", HookItems}). make_menu_items(Lang, {Base, "", HookItems}).
@ -2380,7 +2381,7 @@ make_host_node_menu(_, cluster, _Lang) ->
make_host_node_menu(Host, Node, Lang) -> make_host_node_menu(Host, Node, Lang) ->
HostNodeBase = get_base_path(Host, Node), HostNodeBase = get_base_path(Host, Node),
HostNodeFixed = [{"modules/", "Modules"}], 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}. {HostNodeBase, atom_to_list(Node), HostNodeFixed ++ HostNodeHook}.
make_host_menu(global, _HostNodeMenu, _Lang) -> make_host_menu(global, _HostNodeMenu, _Lang) ->
@ -2406,7 +2407,7 @@ make_node_menu(global, Node, Lang) ->
{"ports/", "Listened Ports"}, {"ports/", "Listened Ports"},
{"stats/", "Statistics"}, {"stats/", "Statistics"},
{"update/", "Update"}], {"update/", "Update"}],
NodeHook = get_menu_items_hook(node, Lang), NodeHook = get_menu_items_hook({node, Node}, Lang),
{NodeBase, atom_to_list(Node), NodeFixed ++ NodeHook}; {NodeBase, atom_to_list(Node), NodeFixed ++ NodeHook};
make_node_menu(_Host, _Node, _Lang) -> make_node_menu(_Host, _Node, _Lang) ->
{"", "", []}. {"", "", []}.
@ -2422,12 +2423,12 @@ make_server_menu(HostMenu, NodeMenu, Lang) ->
{Base, "ejabberd", Fixed ++ Hook}. {Base, "ejabberd", Fixed ++ Hook}.
get_menu_items_hook({hostnode, Host}, Lang) -> get_menu_items_hook({hostnode, Host, Node}, Lang) ->
ejabberd_hooks:run_fold(webadmin_menu_hostnode, Host, [], [Host, Lang]); ejabberd_hooks:run_fold(webadmin_menu_hostnode, Host, [], [Host, Node, Lang]);
get_menu_items_hook({host, Host}, Lang) -> get_menu_items_hook({host, Host}, Lang) ->
ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host, Lang]); ejabberd_hooks:run_fold(webadmin_menu_host, Host, [], [Host, Lang]);
get_menu_items_hook(node, Lang) -> get_menu_items_hook({node, Node}, Lang) ->
ejabberd_hooks:run_fold(webadmin_menu_node, [], [Lang]); ejabberd_hooks:run_fold(webadmin_menu_node, [], [Node, Lang]);
get_menu_items_hook(server, Lang) -> get_menu_items_hook(server, Lang) ->
ejabberd_hooks:run_fold(webadmin_menu_main, [], [Lang]). ejabberd_hooks:run_fold(webadmin_menu_main, [], [Lang]).