Dispatch/Menu.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
cgiapp_init
2.0
display
2.0
BEGIN
2.0
CRAP 2.0
1 package CGI::Application::Demo::Dispatch::Menu;
2  
3 # Author:
4 # Ron Savage <ron@savage.net.au>
5  
6 use base 'CGI::Application::Demo::Dispatch::Base';
7 use strict;
8 use warnings;
9  
10 our $VERSION = '1.05';
11  
12 # -----------------------------------------------
13  
14 sub cgiapp_init
15 {
16 my($self) = @_;
17  
18 $self -> SUPER::cgiapp_init();
19 $self -> run_modes(['display']);
20  
21 } # End of cgiapp_init.
22  
23 # -----------------------------------------------
24  
25 sub display
26 {
27 my($self) = @_;
28 my($url) = $self -> url();
29  
30 my(@row);
31  
32 push @row, {th => 'Package', td => __PACKAGE__};
33 push @row, {th => 'Run mode', td => $self -> get_current_runmode()};
34 push @row, {th => 'URL', td => $self -> path_info()};
35 push @row, {th => 'Go to', td => "<a href='$url/Organization'>Organization</a>"};
36 push @row, {th => 'Go to', td => "<a href='$url/Person'>Person</a>"};
37  
38 my($table) = $self -> load_tmpl('table.tmpl');
39  
40 $table -> param(tr_loop => \@row);
41  
42 my($page) = $self -> load_tmpl('web.page.tmpl');
43  
44 $page -> param(content => $table -> output() );
45  
46 return $page -> output();
47  
48 } # End of display.
49  
50 # -----------------------------------------------
51  
52 1;