405 |
); |
); |
406 |
|
|
407 |
if ( my $site_id = $action->result->content('site_id') ) { |
if ( my $site_id = $action->result->content('site_id') ) { |
408 |
show('strix-site-navigation-tree', $action->result->content('instance'), $site_id); |
show('navigation-tree', $action->result->content('instance'), $site_id); |
409 |
} |
} |
410 |
}; |
}; |
411 |
|
|
412 |
=head1 PRIVATE TEMPLATES |
=head1 PRIVATE TEMPLATES |
413 |
|
|
414 |
=head2 strix-site-navigation-tree |
=head2 navigation-tree-category |
415 |
|
|
416 |
show('strix-site-navigation-tree',$instance,$site_id); |
show('navigation-tree-category',$kat_row); |
417 |
|
|
418 |
=cut |
=cut |
419 |
|
|
420 |
private template 'select-category' => sub { |
private template 'navigation-tree-category' => sub { |
421 |
my $self = shift; |
my $self = shift; |
422 |
|
#warn "## navigation-tree-category",dump( @_ ); |
423 |
my $p = shift; |
my $p = shift; |
424 |
strix_link( $p->{url}, $p->{naziv} ); |
strix_link( $p->{url}, $p->{naziv} ); |
425 |
if ( $p->{type} eq 'category' ) { |
if ( $p->{type} eq 'category' ) { |
440 |
} |
} |
441 |
}; |
}; |
442 |
|
|
443 |
private template 'strix-site-navigation-tree' => sub { |
=head2 navigation-tree |
444 |
|
|
445 |
|
show('navigation-tree',$instance,$site_id); |
446 |
|
|
447 |
|
=cut |
448 |
|
|
449 |
|
private template 'navigation-tree' => sub { |
450 |
my $self = shift; |
my $self = shift; |
451 |
my ( $instance, $site_id ) = @_; |
my ( $instance, $site_id ) = @_; |
452 |
|
|
464 |
if ( defined( $p->{class} ) ) { |
if ( defined( $p->{class} ) ) { |
465 |
{ class is $p->{class} }; |
{ class is $p->{class} }; |
466 |
} |
} |
467 |
show( 'select-category', $p ); |
show( 'navigation-tree-category', $p ); |
468 |
children( $p ); |
children( $p ); |
469 |
} |
} |
470 |
} |
} |
473 |
|
|
474 |
my $strix = Strix->new({ instance => $instance }); |
my $strix = Strix->new({ instance => $instance }); |
475 |
|
|
476 |
my @navigation = @{ $strix->site_navigation( $site_id ) }; |
my $navigation = $strix->site_navigation( $site_id ); |
477 |
if ( @navigation ) { |
#warn "## navigation = ",dump( $navigation ); |
478 |
|
if ( $navigation ) { |
479 |
ul { |
ul { |
480 |
foreach my $p ( @navigation ) { |
foreach my $p ( @$navigation ) { |
481 |
li { |
li { |
482 |
show( 'select-category', $p ); |
show( 'navigation-tree-category', $p ); |
483 |
children( $p ); |
children( $p ); |
484 |
} |
} |
485 |
} |
} |