| 1 | package CGI::Application::Demo::Dispatch::Organization; | ||
| 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 | $url =~ s|/Organization$||; | ||
| 30 | |||
| 31 | my(@row); | ||
| 32 | |||
| 33 | push @row, {th => 'Package', td => __PACKAGE__}; | ||
| 34 | push @row, {th => 'Run mode', td => $self -> get_current_runmode()}; | ||
| 35 | push @row, {th => 'URL', td => $self -> path_info()}; | ||
| 36 | push @row, {th => 'Go to', td => "<a href='$url/Menu'>Menu</a>"}; | ||
| 37 | push @row, {th => 'Go to', td => "<a href='$url/Person'>Person</a>"}; | ||
| 38 | |||
| 39 | my($table) = $self -> load_tmpl('table.tmpl'); | ||
| 40 | |||
| 41 | $table -> param(tr_loop => \@row); | ||
| 42 | |||
| 43 | my($page) = $self -> load_tmpl('web.page.tmpl'); | ||
| 44 | |||
| 45 | $page -> param(content => $table -> output() ); | ||
| 46 | |||
| 47 | return $page -> output(); | ||
| 48 | |||
| 49 | } # End of display. | ||
| 50 | |||
| 51 | # ----------------------------------------------- | ||
| 52 | |||
| 53 | 1; |