| 1 | package GedNav::Menu; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | |||
| 5 | use File::Basename; | ||
| 6 | |||
| 7 | # Define external interface | ||
| 8 | use Exporter; | ||
| 9 | use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION ); | ||
| 10 | @ISA = qw( Exporter ); | ||
| 11 | ($VERSION) = ('$Revision: 1.1.1.1 $' =~ / ([\d\.]+) \$$/); | ||
| 12 | |||
| 13 | # Always exported into callers namespace | ||
| 14 | @EXPORT = qw( | ||
| 15 | gednav_menu | ||
| 16 | ); | ||
| 17 | |||
| 18 | # Externally visible if specified | ||
| 19 | @EXPORT_OK = qw( | ||
| 20 | ); | ||
| 21 | |||
| 22 | sub gednav_menu | ||
| 23 | { | ||
| 24 | my $report = shift; | ||
| 25 | my $indi = shift; | ||
| 26 | |||
| 27 | my $html = ''; | ||
| 28 | |||
| 29 | $html .= sprintf("<h3>Gedcom Dataset: %s</h3>Last modified %s<p>", | ||
| 30 | $indi ? basename($indi->dataset) . ".ged" : '', | ||
| 31 | $indi ? $indi->gedcom->lastmod : '', | ||
| 32 | ); | ||
| 33 | |||
| 34 | $html .= "<a href=\"\">Top</a><br>\n"; | ||
| 35 | |||
| 36 | # $html .= "<a href=\"surnames\">Surname Index</a><br>\n"; | ||
| 37 | |||
| 38 | $html .= sprintf("<a href=\"surname?choice=%s\">Individuals with surname %s</a><br>\n", | ||
| 39 | $indi->surname, | ||
| 40 | $indi->surname, | ||
| 41 | ) if ($indi); | ||
| 42 | |||
| 43 | # $html .= sprintf("<a href=\"list?soundex=%s\">All with the same Soundex</a><br>\n", | ||
| 44 | # soundex($indi->surname)); | ||
| 45 | |||
| 46 | $html .= sprintf("<a href=\"outline?indi=%s\">Outline Descendant Tree</a><br>\n", | ||
| 47 | $indi->code, | ||
| 48 | ) if ($report !~ /outline/i && $indi && $indi->fams); | ||
| 49 | |||
| 50 | $html .= sprintf("<a href=\"register?indi=%s\">Descendant Register Report</a><br>\n", | ||
| 51 | $indi->code, | ||
| 52 | ) if ($report !~ /register/i && $indi && $indi->fams); | ||
| 53 | |||
| 54 | $html .= "<hr>\n"; | ||
| 55 | |||
| 56 | } | ||
| 57 | |||
| 58 | 1; |