/[A3C]/lib/A3C/View/Strix.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 /lib/A3C/View/Strix.pm

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

revision 216 by dpavlin, Fri Jun 20 20:54:41 2008 UTC revision 217 by dpavlin, Fri Jun 20 22:37:33 2008 UTC
# Line 148  template 'navigation' => page { Line 148  template 'navigation' => page {
148    
149  };  };
150    
 =head2 layout  
   
 =cut  
   
 template 'layout' => sub {  
   
         my $url = get('url') || '/';  
   
         my $category = strix->category( $url );  
   
         warn dump( $category );  
   
         strix_link( $category->{url}, $category->{naziv} );  
   
         my $layout = strix->layout( $url );  
   
         pre {  
                 dump( $layout );  
         }  
   
 };  
   
151  =head1 REGIONS  =head1 REGIONS
152    
153  =head2 execute-sql  =head2 execute-sql
# Line 409  template 'site' => sub { Line 387  template 'site' => sub {
387          }          }
388  };  };
389    
390    =head2 layout
391    
392    Shows layout for C<url>
393    
394    =cut
395    
396    template 'layout' => sub {
397    
398            my $url = get('url') || '/';
399            my $category = strix->category( $url );
400            my $layout = strix->layout( $url );
401    
402            h1 { $category->{naziv} }
403            pre {
404                    dump( $layout );
405            }
406    
407    };
408    
409    =head2 category
410    
411    Show category data for C<url>
412    
413    =cut
414    
415    template 'category' => sub {
416    
417            my $url = get('url') || '/';
418            my $category = strix->category( $url );
419    
420            h1 { $category->{naziv} }
421            pre {
422                    dump( $category );
423            }
424    
425    };
426    
427  =head1 PRIVATE TEMPLATES  =head1 PRIVATE TEMPLATES
428    
429  =head2 navigation-tree-category  =head2 navigation-tree-category
# Line 421  private template 'navigation-tree-catego Line 436  private template 'navigation-tree-catego
436          my $self = shift;          my $self = shift;
437          #warn "## navigation-tree-category",dump( @_ );          #warn "## navigation-tree-category",dump( @_ );
438          my $p = shift;          my $p = shift;
439          strix_link( $p->{url}, $p->{naziv} );          hyperlink(
440                    onclick => {
441                            region => 'strix-site-layout',  # FIXME do we have to hard-code region name here?
442                            replace_with => '/strix/category',
443                            args => {
444                                    url => $p->{url},
445                                    instance => get('instance'),
446                            }
447                    },
448                    label => $p->{naziv},
449            );
450            outs_raw('&nbsp;');
451          if ( $p->{type} eq 'category' ) {          if ( $p->{type} eq 'category' ) {
                 outs_raw('&nbsp;');  
452                  hyperlink(                  hyperlink(
453  #                       url => '/strix/layout?url=' . $p->{url} . ';instance=' . get('instance'),  #                               url => '/strix/layout?url=' . $p->{url} . ';instance=' . get('instance'),
454                          onclick => {                          onclick => {
455                                  region => 'strix-site-layout',  # FIXME do we have to hard-code region name here?                                  region => 'strix-site-layout',  # FIXME do we have to hard-code region name here?
456                                  replace_with => '/strix/layout',                                  replace_with => '/strix/layout',
# Line 438  private template 'navigation-tree-catego Line 463  private template 'navigation-tree-catego
463                          class => 'layout',                          class => 'layout',
464                  );                  );
465          }          }
466            outs_raw('&nbsp;');
467            strix_link( $p->{url}, '>>' );
468  };  };
469    
470  =head2 navigation-tree  =head2 navigation-tree
# Line 450  private template 'navigation-tree' => su Line 477  private template 'navigation-tree' => su
477          my $self = shift;          my $self = shift;
478          my ( $instance, $site_id ) = @_;          my ( $instance, $site_id ) = @_;
479    
480          warn ">>>> instance: $instance site_id: $site_id";          warn "## navigation-tree instance: $instance site_id: $site_id";
481    
482          set 'instance' => $instance;          set 'instance' => $instance;
483    
   
484          sub children {          sub children {
485                  my $c = shift;                  my $c = shift;
486                  return unless defined $c->{children};                  return unless defined $c->{children};
# Line 477  private template 'navigation-tree' => su Line 503  private template 'navigation-tree' => su
503          #warn "## navigation = ",dump( $navigation );          #warn "## navigation = ",dump( $navigation );
504          if ( $navigation ) {          if ( $navigation ) {
505                  ul {                  ul {
506                            { class is 'navigation' };
507                          foreach my $p ( @$navigation ) {                          foreach my $p ( @$navigation ) {
508                                  li {                                  li {
509                                          show( 'navigation-tree-category', $p );                                          show( 'navigation-tree-category', $p );

Legend:
Removed from v.216  
changed lines
  Added in v.217

  ViewVC Help
Powered by ViewVC 1.1.26