/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 555 by dpavlin, Thu Nov 27 17:39:00 2008 UTC revision 582 by dpavlin, Fri Nov 28 13:18:18 2008 UTC
# Line 27  sub as_markup { Line 27  sub as_markup {
27    
28                  my $icon = '';                  my $icon = '';
29                  if ( ! $self->can('icon_path') ) {                  if ( ! $self->can('icon_path') ) {
30                          warn "FIXME: re-apply Frey::Web on $self";                          $self->TODO( "re-apply Frey::Web on $self" );
31                          Frey::Web->meta->apply( $self );                          Frey::Web->meta->apply( $self );
32                  }                  }
33                  $icon = $self->icon_path( $class );                  $icon = $self->icon_path( $class );
34                  if ($icon) {                  if ($icon) {
35                          push @icons, $icon;                          push @icons, $icon;
36                          $icon = qq|<!-- icon:$icon -->|;                          $icon = qq|<!-- icon:$icon -->|;
37                    } else {
38                            $icon = '';
39                  }                  }
40    
41                  my $html                  my $html
# Line 50  sub as_markup { Line 52  sub as_markup {
52                  }                  }
53    
54                  my @run = map {                  my @run = map {
55                            my $invoke = $_;
56                          s{^as_}{};                          s{^as_}{};
57                          qq|<a target="$class" href="/$class/as_$_" title="$class->as_$_">$_</a>|;                          s{_as_\w+}{};
58                            qq|<a target="$class" href="/$class/$invoke" title="$class->$invoke">$_</a>|;
59                  } $self->class_runnable( $class );                  } $self->class_runnable( $class );
60                  push @run, qq|<a target="$class" href="/Frey-ObjectBrowser?class=$class">collection</a>| if $class->can('collection_table');                  push @run, qq|<a target="$class" href="/Frey-ObjectBrowser?class=$class">collection</a>| if $class->can('collection_table');
61    
# Line 72  sub as_markup { Line 76  sub as_markup {
76    
77          my $icons_html = $self->combine_images( @icons );          my $icons_html = $self->combine_images( @icons );
78          sub icon {          sub icon {
79                  my $path = shift;                  my ($icons_html,$path) = @_;
                 warn "# icon $path";  
80                  $icons_html->{ $path } || die "can't find $path in ",dump($icons_html);                  $icons_html->{ $path } || die "can't find $path in ",dump($icons_html);
81          };          };
82    
# Line 81  sub as_markup { Line 84  sub as_markup {
84                  qq|<table>| . join("\n",                  qq|<table>| . join("\n",
85                          map {                          map {
86                                  my $html = $row->{$_};                                  my $html = $row->{$_};
87                                  $html =~ s{<!-- icon:(\S+) -->}{icon($1)}gse;                                  $html =~ s{<!-- icon:(\S+) -->}{icon($icons_html,$1)}gse;
88                                  $html;                                  $html;
89                          }                          }
90                          sort {                          sort {

Legend:
Removed from v.555  
changed lines
  Added in v.582

  ViewVC Help
Powered by ViewVC 1.1.26