/[Frey]/trunk/lib/Frey/ObjectBrowser.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/ObjectBrowser.pm

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

revision 75 by dpavlin, Wed Jul 9 20:47:27 2008 UTC revision 83 by dpavlin, Thu Jul 10 15:41:17 2008 UTC
# Line 34  use Data::Structure::Util qw(unbless); Line 34  use Data::Structure::Util qw(unbless);
34  sub html {  sub html {
35          my ( $self, $req ) = @_;          my ( $self, $req ) = @_;
36    
         my $params = $req->param;  
         warn "# params = ",dump( $params );  
   
37          use Strix::User;          use Strix::User;
38          use Strix::View::User;          use Strix::View::User;
39    
40          my $s = Strix::User->rows();          my $s = Strix::User->rows();
41          warn "# s = ",dump( $s );          #warn "# s = ",dump( $s );
42    
         my $f = {};  
43          my @w;          my @w;
44    
45          while ( my $u = $s->next ) {          while ( my $u = $s->next ) {
46                  warn "# u = ",dump( $u );                  my $w = Strix::View::User->new( %{ $u } );
                 my $w = Strix::View::User->new(  
                         #%{ unbless( $u ) }, # FIXME this is cludge  
                         %{ $u } # much better :-)  
                 );  
47                  $w->_fey( $u );                  $w->_fey( $u );
48                  warn "# w = ",dump( $w );                  warn "# w = ",dump( $w ) if $self->debug;
49                  push @w, $w;                  push @w, $w;
50          }          }
51    
52          push @w, Strix::View::User->new( render_as => 'edit' );          my $f = { $req->params };
53    
54          while ( 1 ) {          while ( 1 ) {
55                    
56                  warn "# got $#w elements\n";                  warn "# got $#w elements: ",dump( map { $_->id } @w );
57                    warn "<<< GOT REQUEST ",dump( $f );
58    
59                    warn "does last element have id? ",dump( $w[$#w]->id );
60    
61                    if ( $w[ $#w ]->_fey ) {
62                            warn "+++ added new widget\n";
63                            push @w, Strix::View::User->new( render_as => 'edit' );
64                    }
65    
66                  my $form = join('<hr/>', map { $_->process($f) } @w );                  my $form = join('<hr/>', map { $_->process($f) || '[deleted]' } @w );
67              my $doc = Continuity::Widget::DomNode->create(              my $doc = Continuity::Widget::DomNode->create(
68                          html => [                          html => [
69                                  head => [                                  head => [
70                                          link  => { rel=>"stylesheet", href=>"form.css", type=>"text/css" }                                          link  => { rel=>"stylesheet", href=>"/static/form.css", type=>"text/css" }
71                                  ],                                  ],
72                                  body => [                                  body => [
73                                          h1 => [ 'Strix::User' ],                                          h1 => [ 'Strix::User' ],

Legend:
Removed from v.75  
changed lines
  Added in v.83

  ViewVC Help
Powered by ViewVC 1.1.26