[Jifty-commit] r4191 - in apps/CASPlus/trunk: lib/CASPlus

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Tue Oct 2 16:18:07 EDT 2007


Author: sterling
Date: Tue Oct  2 16:18:05 2007
New Revision: 4191

Modified:
   apps/CASPlus/trunk/   (props changed)
   apps/CASPlus/trunk/lib/CASPlus/Menu.pm

Log:
 r12804 at dynpc145:  andrew | 2007-10-02 14:58:29 -0500
 Adding Pod to CASPlus::Menu.


Modified: apps/CASPlus/trunk/lib/CASPlus/Menu.pm
==============================================================================
--- apps/CASPlus/trunk/lib/CASPlus/Menu.pm	(original)
+++ apps/CASPlus/trunk/lib/CASPlus/Menu.pm	Tue Oct  2 16:18:05 2007
@@ -6,6 +6,36 @@
 
 __PACKAGE__->mk_accessors( qw/ description side / );
 
+=head1 NAME
+
+CASPlus::Menu - a custom version of Jifty::Web::Menu for administration
+
+=head1 SYNOPSIS
+
+  my $admin_menu = CASPlus->admin_menu;
+
+  my $submenu = $admin_menu->child( MyItemGroup => 
+      label => _('Admin Group'), side => 'left' 
+  );
+
+  $submenu->child( MyItem =>
+      label => _('Administer Stuff'),
+      url   => '/admin/group/stuff',
+      description => _('This page will let you administer stuff.'),
+  );
+
+=head1 DESCRIPTION
+
+This is a custom extension of L<Jifty::Web::Menu> for the purpose of generating an administrative menu page.
+
+=head1 METHODS
+
+=head2 render_as_admin_page
+
+A special rendering method for rendering the admin page.
+
+=cut
+
 sub render_as_admin_page {
     my $self = shift;
     my @kids = $self->children;
@@ -25,6 +55,12 @@
     Jifty->web->out(qq{</div>});
 }
 
+=head2 child
+
+Overridden version of L<Jifty::Web::Menu/child> to overcome a problem in older version of Jifty that made it difficult to extend this class. (It has been fixed in the latest version of Jifty, so this implementation will go away someday.)
+
+=cut
+
 sub child {
     my $self = shift;
     my $key = shift;
@@ -56,6 +92,12 @@
     return $self->{children}{$key}
 }
 
+=head2 render_as_menu_group
+
+A helper to L</render_as_admin_page> to render each menu group.
+
+=cut
+
 sub render_as_menu_group {
     my $self = shift;
 
@@ -67,6 +109,12 @@
     Jifty->web->out(qq{</div>});
 }
 
+=head2 render_as_hierarchical_menu_item
+
+A customization of L<Jifty::Web::Menu/render_as_hierarchical_menu_item> to add descriptions to each menu item rendered.
+
+=cut
+
 sub render_as_hierarchical_menu_item {
     my $self = shift;
     my %args = (
@@ -110,4 +158,18 @@
 
 }
 
+=head1 SEE ALSO
+
+L<CASPlus>, L<Jifty::Web::Menu>
+
+=head1 COPYRIGHT AND LICENSE
+
+This code is a derived work from L<Jifty::Web::Menu>, which is Copyright 2005-2007 Best Practical Solutions, LLC and distributed under the same terms as Perl itself.
+
+Copyright 2007 Boomer Consulting, Inc. All Rights Reserved.
+
+This program is free software and may be modified and distributed under the same terms as Perl itself.
+
+=cut
+
 1;


More information about the Jifty-commit mailing list