/[Frey]/trunk/lib/Frey/Class/Browser.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

Annotation of /trunk/lib/Frey/Class/Browser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 418 - (hide annotations)
Tue Nov 18 16:54:10 2008 UTC (15 years, 5 months ago) by dpavlin
Original Path: trunk/lib/Frey/ClassBrowser.pm
File size: 1165 byte(s)
Add title to Frey::Web and use it
1 dpavlin 119 package Frey::ClassBrowser;
2     use Moose;
3    
4 dpavlin 308 extends 'Frey::ClassLoader';
5 dpavlin 418 with 'Frey::Web';
6 dpavlin 119
7 dpavlin 223 use Frey::Run;
8 dpavlin 119
9     our $markup;
10    
11 dpavlin 121 sub markup {
12 dpavlin 308 my $self = shift;
13 dpavlin 144 return $markup if $markup;
14     my $html;
15 dpavlin 308 foreach my $class ( $self->classes ) {
16     $html .= qq|<tr><td><a href="/$class" title="| . $self->class_path( $class ) . qq|">$class</a></td><td>|;
17     if ( $class->can('meta') ) {
18     if ( $class->meta->isa('Moose::Meta::Role') ) {
19 dpavlin 144 $html .= qq|role|;
20     } else {
21 dpavlin 308 $html .= qq|<a href="/Frey-ObjectDesigner?class=$class">design</a>| if $class->can('collection');
22 dpavlin 144 }
23     }
24 dpavlin 408 my @run;
25     my @input;
26     push @run, qq|<a href="/Frey-ObjectBrowser?class=$class">collection</a>| if $class->can('collection_table');
27 dpavlin 409 my $class_method = $self->class_methods( $class );
28 dpavlin 314 foreach my $try ( Frey::Run->runnable ) {
29 dpavlin 408 next unless $class->can($try);
30 dpavlin 409 if ( $class_method->{ $try } ) {
31 dpavlin 408 push @run, qq|<a href="/$class/$try">$try</a>|;
32     } else {
33     push @input, $try;
34     }
35 dpavlin 223 }
36 dpavlin 408 $html .= qq|</td><td>| . join(' ', @run) . qq|</td><td>| .
37     ( @input ? '&larr; ' . join(' ', @input) : '' ) .
38     qq|</td></tr>|;
39 dpavlin 144 }
40     $html = "<table>$html</table>" if $html;
41     $markup = $html;
42 dpavlin 119 }
43    
44     1;

  ViewVC Help
Powered by ViewVC 1.1.26