[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. bed93707fe7572bfcd969580c348a3d51389a6ae

Stefan Hornburg racke at rt.icdevgroup.org
Thu Jan 29 08:51:24 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  bed93707fe7572bfcd969580c348a3d51389a6ae (commit)
      from  fcdfd2f6855426dc784dd0d41ac2f06a9ea0ed58 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bed93707fe7572bfcd969580c348a3d51389a6ae
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jan 29 09:50:39 2009 +0100

    rewrote component, now checking permissions for menu entries
    TODO: recursive menus

-----------------------------------------------------------------------

Summary of changes and diff:
 components/menu |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/components/menu b/components/menu
index dc412ec..bdbc785 100644
--- a/components/menu
+++ b/components/menu
@@ -1,15 +1,22 @@
-<ul>
-[tree
-        table=menus
-        master=parent
-        start=0
-				sort=weight
-        subordinate=code
-        full=1
-	where="menu_name='__NAME__'"
-]
-[if-item-param mv_up]<ul>[/if-item-param]
-[if-item-param mv_down]</ul>[/if-item-param]
-<li><a href='[area href="[item-param url]"]'>[item-param name]</a></li>
-[/tree]
-</ul>
+[perl tables="menus users roles user_roles permissions"]
+my ($menu_name, $joiner, @entries);
+
+$menu_name = $Variable->{NAME} || 'main';
+$joiner = exists $Variable->{JOINER} ? $Variable->{JOINER} : '&nbsp;|&nbsp;';
+$style = $Variable->{STYLE};
+
+my ($set, $url);
+$set = $Db{menus}->query(q{select name,url,permission from menus where menu_name = '%s' order by weight desc,name}, $menu_name);
+
+for (@$set) {
+	next unless $Tag->acl('check', $_->[2]);
+	$url = $Tag->area({href => $_->[1]});
+
+	push (@entries, qq{<a href="$url"><span>$_->[0]</span></a>});
+}
+
+if (@entries && $style eq 'list') {
+	return '<ul>' . join('', map {"<li>$_</li>"} @entries) . '</ul>';
+}
+return join($joiner, @entries);
+[/perl]


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list