/[Frey]/trunk/lib/Frey/ClassBrowser.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/ClassBrowser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 427 - (show annotations)
Tue Nov 18 23:42:40 2008 UTC (15 years, 5 months ago) by dpavlin
File size: 1186 byte(s)
don't cache markup, reformat html into new quite readable form
1 package Frey::ClassBrowser;
2 use Moose;
3
4 extends 'Frey::ClassLoader';
5 with 'Frey::Web';
6
7 use Frey::Run;
8
9 sub markup {
10 my $self = shift;
11 my @rows;
12 foreach my $class ( $self->classes ) {
13 my $html
14 = qq|<tr><td><a href="/$class" title="|
15 . $self->class_path( $class )
16 . qq|">$class</a></td><td>|
17 ;
18 if ( $class->can('meta') ) {
19 if ( $class->meta->isa('Moose::Meta::Role') ) {
20 $html .= qq|role|;
21 } else {
22 $html .= qq|<a href="/Frey-ObjectDesigner?class=$class">design</a>| if $class->can('collection');
23 }
24 }
25 my @run;
26 my @input;
27 push @run, qq|<a href="/Frey-ObjectBrowser?class=$class">collection</a>| if $class->can('collection_table');
28 my $class_method = $self->class_methods( $class );
29 foreach my $try ( Frey::Run->runnable ) {
30 next unless $class->can($try);
31 if ( $class_method->{ $try } ) {
32 push @run, qq|<a href="/$class/$try">$try</a>|;
33 } else {
34 push @input, $try;
35 }
36 }
37 $html
38 .= qq|</td><td>|
39 . join(' ', @run)
40 . qq|</td><td>|
41 . ( @input ? '&larr; ' . join(' ', @input) : '' )
42 . qq|</td></tr>|
43 ;
44 push @rows, $html if $html;
45 }
46 return qq|<table>| . join("\n", @rows) . qq|</table>| if @rows;
47 }
48
49 1;

  ViewVC Help
Powered by ViewVC 1.1.26