[Maypole-dev] [PATCH] Don't display buttons for non-public actions

From: Dagfinn Ilmari Mannsåker (ilmari at ilmari.org)
Date: Wed Dec 08 2004 - 10:28:38 GMT


This patch makes the button() macro display the button only if the
action is public.

Index: templates/factory/macros
===================================================================
--- templates/factory/macros (revision 302)
+++ templates/factory/macros (working copy)
@@ -81,9 +81,11 @@
 
 #%]
 [% MACRO button(obj, action) BLOCK; %]
+[% IF obj.is_public(action) %]
 <DEFANGED_form class="actionform" action="[% base %]/[% obj.table %]/[% action %]/[% obj.id.join('/') %]" method="post">
 <div class="field"><input class="actionbutton" type="submit" value="[% action %]" /></div></form>
 [% END %]
+[% END %]
 [%#
 
 =head2 view_related

-- 
ilmari

_______________________________________________ maypole-dev mailing list maypole-dev at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole-dev



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT