[Jifty-commit] r1548 - in jifty/trunk: lib/Jifty/Web

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jul 12 22:49:03 EDT 2006


Author: trs
Date: Wed Jul 12 22:49:00 2006
New Revision: 1548

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Menu.pm

Log:
 r14350 at zot:  tom | 2006-07-12 22:48:16 -0400
 Let classes be set on menu items


Modified: jifty/trunk/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Menu.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Menu.pm	Wed Jul 12 22:49:00 2006
@@ -3,7 +3,7 @@
 use base qw/Class::Accessor::Fast/;
 use URI;
 
-__PACKAGE__->mk_accessors(qw(label parent sort_order link escape_label));
+__PACKAGE__->mk_accessors(qw(label parent sort_order link escape_label class));
 
 =head2 new PARAMHASH
 
@@ -43,6 +43,10 @@
 you're looking to do complex ajaxy things with menus, this is likely
 the option you want.
 
+=head2 class [STRING]
+
+Gets or sets the CSS class the link should have in addition to the default
+classes.  This is only used if C<link> isn't specified.
 
 =head2 url
 
@@ -263,7 +267,8 @@
     } elsif ( $self->url ) {
         return Jifty->web->link( label => _( $self->label ),
                                  url   => $self->url,
-                                 escape_label => $self->escape_label );
+                                 escape_label => $self->escape_label,
+                                 class => $self->class );
     } else {
         return _( $self->label );
     }


More information about the Jifty-commit mailing list