« lib/Ftree/DataParsers/ArrayImporters/CSVArrayImporter.pm
↑ Summary
lib/Ftree/FamilyTreeGraphics.pm »
| 1 | package Ftree::FamilyTreeBase; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use version; our $VERSION = qv('2.3.41'); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Params::Validate qw(:all); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use CGI qw(:standard); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use Ftree::FamilyTreeDataFactory; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Ftree::Person; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Ftree::TextGeneratorFactory; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use Ftree::SettingsFactory; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Ftree::Date::Tiny; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | ▶ | use CGI::Carp qw(warningsToBrowser);#fatalsToBrowser | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | # use Perl6::Export::Attrs; | ||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | ▶ | use Sub::Exporter -setup => { exports => [ qw(new) ] }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | use Encode qw(decode_utf8); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 4 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 4 | my $q = new CGI; | |||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 3 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | my ($classname, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 3 | my $self = { | |||||||||||||||||||||||||||||||||||||||||
| 25 | lang => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 26 | password => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | # treeScript => CGI::url(-relative=>1), | ||||||||||||||||||||||||||||||||||||||||||
| 29 | treeScript => 'ftree', | ||||||||||||||||||||||||||||||||||||||||||
| 30 | personScript => 'person_page', | ||||||||||||||||||||||||||||||||||||||||||
| 31 | photoUrl => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 32 | graphicsUrl => '../graphics', | ||||||||||||||||||||||||||||||||||||||||||
| 33 | imgwidth => 60, | ||||||||||||||||||||||||||||||||||||||||||
| 34 | reqLevels => 2, | ||||||||||||||||||||||||||||||||||||||||||
| 35 | textGenerator => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 36 | settings => undef, | ||||||||||||||||||||||||||||||||||||||||||
| 37 | cgi => new CGI, | ||||||||||||||||||||||||||||||||||||||||||
| 38 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 3 | $self->{imgheight} = $self->{imgwidth} * 1.5; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 3 | $self->{settings} = Ftree::SettingsFactory::importSettings('perl', $args[0] ); | |||||||||||||||||||||||||||||||||||||||||
| 41 | 3 | $self->{photoUrl} = $self->{settings}{data_source}{config}{photo_url}; | |||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | 3 | ▶ | if ( defined $self->{settings}{date_format} ){ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | 3 | Ftree::Date::Tiny->set_format( $self->{settings}{date_format} ); | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 3 | return bless $self, $classname; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 1 | ▶ | sub _process_parameters { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process_parameters: called CC=3 SCAR=11.1
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | my ($self) = validate_pos( @_, { type => HASHREF } ); | |||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | $self->{lang} = CGI::param('lang'); | |||||||||||||||||||||||||||||||||||||||||
| 53 | $self->{lang} = $self->{settings}{default_language} | ||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | ▶ | unless defined $self->{lang}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | Ftree::TextGeneratorFactory::init( $self->{lang} ); | |||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | $self->{textGenerator} = Ftree::TextGeneratorFactory::getTextGenerator(); | |||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | $self->{password} = CGI::param('passwd'); | |||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | $self->{password} = "" unless defined $self->{password}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | ▶ | sub _toppage { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_toppage: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | my ( $self, $title ) = | |||||||||||||||||||||||||||||||||||||||||
| 65 | validate_pos( @_, { type => HASHREF }, { type => SCALAR } ); | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | binmode STDOUT, ":encoding(UTF-8)"; | |||||||||||||||||||||||||||||||||||||||||
| 67 | print $self->{cgi}->header( -charset => 'UTF-8' ), | ||||||||||||||||||||||||||||||||||||||||||
| 68 | $self->{cgi}->start_html( | ||||||||||||||||||||||||||||||||||||||||||
| 69 | -title => $title, | ||||||||||||||||||||||||||||||||||||||||||
| 70 | -style => { -src => $self->{settings}{css_filename} }, | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | -meta => { | |||||||||||||||||||||||||||||||||||||||||
| 72 | http_equiv => 'Content-Type', | ||||||||||||||||||||||||||||||||||||||||||
| 73 | content => 'text/html', | ||||||||||||||||||||||||||||||||||||||||||
| 74 | charset => 'UTF-8' | ||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | warningsToBrowser(1); | |||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | print $self->{cgi}->center( $self->{cgi}->h1($title) ), "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | ####################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 84 | # generates the html for the end of the page | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | ▶ | sub _endpage { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_endpage: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 1 | my ($self) = validate_pos( @_, { type => HASHREF } ); | |||||||||||||||||||||||||||||||||||||||||
| 87 | 1 | my $password = $self->{settings}{password}; | |||||||||||||||||||||||||||||||||||||||||
| 88 | 1 | ▶ | $password = ( defined $password ) ? $password : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | print $self->{cgi}->br(), $self->{cgi}->hr(), "\n", | ||||||||||||||||||||||||||||||||||||||||||
| 90 | $self->{cgi}->start_strong(), | ||||||||||||||||||||||||||||||||||||||||||
| 91 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 92 | { | ||||||||||||||||||||||||||||||||||||||||||
| 93 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 94 | . '?type=;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 95 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 96 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 97 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 98 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 99 | $self->{textGenerator}->{Relatives} | ||||||||||||||||||||||||||||||||||||||||||
| 100 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 101 | " - \n", | ||||||||||||||||||||||||||||||||||||||||||
| 102 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 103 | { | ||||||||||||||||||||||||||||||||||||||||||
| 104 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 105 | . '?type=faces;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 106 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 107 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 108 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 109 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 110 | $self->{textGenerator}->{Faces} | ||||||||||||||||||||||||||||||||||||||||||
| 111 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 112 | " - \n", | ||||||||||||||||||||||||||||||||||||||||||
| 113 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 114 | { | ||||||||||||||||||||||||||||||||||||||||||
| 115 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 116 | . '?type=snames;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 117 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 118 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 119 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 120 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 121 | $self->{textGenerator}->{Surnames} | ||||||||||||||||||||||||||||||||||||||||||
| 122 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 123 | " - \n", | ||||||||||||||||||||||||||||||||||||||||||
| 124 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 125 | { | ||||||||||||||||||||||||||||||||||||||||||
| 126 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 127 | . '?type=hpages;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 128 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 129 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 130 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 131 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 132 | $self->{textGenerator}->{Homepages} | ||||||||||||||||||||||||||||||||||||||||||
| 133 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 134 | " - \n", | ||||||||||||||||||||||||||||||||||||||||||
| 135 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||||||||||||||
| 137 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 138 | . '?type=emails;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 139 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 140 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 141 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 142 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 143 | $self->{textGenerator}->{Emails} | ||||||||||||||||||||||||||||||||||||||||||
| 144 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 145 | " - \n", | ||||||||||||||||||||||||||||||||||||||||||
| 146 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 147 | { | ||||||||||||||||||||||||||||||||||||||||||
| 148 | -href => ${self}->{treeScript} | ||||||||||||||||||||||||||||||||||||||||||
| 149 | . '?type=bdays;passwd=' | ||||||||||||||||||||||||||||||||||||||||||
| 150 | . $password | ||||||||||||||||||||||||||||||||||||||||||
| 151 | . ';lang=' | ||||||||||||||||||||||||||||||||||||||||||
| 152 | . $self->{lang} | ||||||||||||||||||||||||||||||||||||||||||
| 153 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 154 | $self->{textGenerator}->{Birthdays} | ||||||||||||||||||||||||||||||||||||||||||
| 155 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 156 | "\n", | ||||||||||||||||||||||||||||||||||||||||||
| 157 | 1 | $self->{cgi}->end_strong(), $self->{cgi}->br, $self->{cgi}->br, "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | $self->language_chooser(); | |||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | 1 | print "\n", | |||||||||||||||||||||||||||||||||||||||||
| 161 | '<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">', | ||||||||||||||||||||||||||||||||||||||||||
| 162 | '</script>', | ||||||||||||||||||||||||||||||||||||||||||
| 163 | '<script type="text/javascript">', | ||||||||||||||||||||||||||||||||||||||||||
| 164 | '_uacct = "UA-1237567-1";', | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 'urchinTracker();', | ||||||||||||||||||||||||||||||||||||||||||
| 166 | '</script>', "\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 167 | print $self->{cgi}->start_i, | ||||||||||||||||||||||||||||||||||||||||||
| 168 | $self->{textGenerator}->maintainer( | ||||||||||||||||||||||||||||||||||||||||||
| 169 | $self->{settings}{adminName}, | ||||||||||||||||||||||||||||||||||||||||||
| 170 | $self->{settings}{adminEmail}, | ||||||||||||||||||||||||||||||||||||||||||
| 171 | $self->{settings}{adminHomepage} | ||||||||||||||||||||||||||||||||||||||||||
| 172 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 173 | $self->{cgi}->br, | ||||||||||||||||||||||||||||||||||||||||||
| 174 | $self->{textGenerator}->software($VERSION), "\n", | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | $self->{cgi}->end_i, $self->{cgi}->br; | |||||||||||||||||||||||||||||||||||||||||
| 176 | 1 | print $self->{cgi}->i( $self->{textGenerator}{DonationSentence} ), | |||||||||||||||||||||||||||||||||||||||||
| 177 | <<"END_PAYPAL"; | ||||||||||||||||||||||||||||||||||||||||||
| 178 | <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> | ||||||||||||||||||||||||||||||||||||||||||
| 179 | <input type="hidden" name="cmd" value="_s-xclick"> | ||||||||||||||||||||||||||||||||||||||||||
| 180 | <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it is fast, free and secure!"> | ||||||||||||||||||||||||||||||||||||||||||
| 181 | <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> | ||||||||||||||||||||||||||||||||||||||||||
| 182 | <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----"> | ||||||||||||||||||||||||||||||||||||||||||
| 183 | </form> | ||||||||||||||||||||||||||||||||||||||||||
| 184 | END_PAYPAL | ||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||
| 186 | 1 | ▶ | if ( $self->{settings}{sitemeter_needed} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | 1 | ||||||||||||||||||||||||||||||||||||||||||
| 188 | "<!--WEBBOT bot=\"HTMLMarkup\" startspan ALT=\"Site Meter\" -->\n", | ||||||||||||||||||||||||||||||||||||||||||
| 189 | "<script type=\"text/javascript\" language=\"JavaScript\">var site=\"$self->{settings}{sitemeter_id}\"</script>\n", | ||||||||||||||||||||||||||||||||||||||||||
| 190 | "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"http://s22.sitemeter.com/js/counter.js?site=$self->{settings}{sitemeter_id}\">\n", | ||||||||||||||||||||||||||||||||||||||||||
| 191 | "</script>\n", | ||||||||||||||||||||||||||||||||||||||||||
| 192 | "<noscript>\n", | ||||||||||||||||||||||||||||||||||||||||||
| 193 | "<a href=\"http://s22.sitemeter.com/stats.asp?site=$self->{settings}{sitemeter_id}\" target=\"_top\">\n", | ||||||||||||||||||||||||||||||||||||||||||
| 194 | "<img src=\"http://s22.sitemeter.com/meter.asp?site=$self->{settings}{sitemeter_id}\" alt=\"Site Meter\" border=\"0\"/></a>\n", | ||||||||||||||||||||||||||||||||||||||||||
| 195 | "</noscript>\n", | ||||||||||||||||||||||||||||||||||||||||||
| 196 | "<!-- Copyright (c)2005 Site Meter -->\n", | ||||||||||||||||||||||||||||||||||||||||||
| 197 | "<!--WEBBOT bot=\"HTMLMarkup\" Endspan -->\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | 1 | print $self->{cgi}->end_html; | |||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||
| 201 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | ######################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 205 | # check password | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 1 | ▶ | sub _password_check { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_password_check: called CC=5 SCAR=27.4
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | my ($self) = validate_pos( @_, { type => HASHREF } ); | |||||||||||||||||||||||||||||||||||||||||
| 208 | 1 | ▶ | if ( defined $self->{settings}{passwordReq} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $self->{"settings"}{"passwordReq"} and $self->{"settings"}{"passwordReq"} ne "" and $self->{"settings"}{"password"} ne $self->{"password"}
defined $self->{"settings"}{"passwordReq"} and $self->{"settings"}{"passwordReq"} ne ""
MC/DC0%0/3
defined $self->{"settings"}{"passwordReq"} and $self->{"settings"}{"passwordReq"} ne "" and $self->{"settings"}{"password"} ne $self->{"password"}
defined $self->{"settings"}{"passwordReq"}
$self->{"settings"}{"passwordReq"} ne ""
$self->{"settings"}{"password"} ne $self->{"password"}
Truth table25%1/4
A and B and C
A= defined $self->{"settings"}{"passwordReq"}B= $self->{"settings"}{"passwordReq"} ne ""C= $self->{"settings"}{"password"} ne $self->{"password"}
| |||||||||||||||||||||||||||||||||||||||||||
| 209 | && $self->{settings}{passwordReq} ne "" | ||||||||||||||||||||||||||||||||||||||||||
| 210 | && $self->{settings}{password} ne $self->{password} ) | ||||||||||||||||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | $self->_toppage( $self->{textGenerator}->{Error} ); | |||||||||||||||||||||||||||||||||||||||||
| 213 | printf "<br>\n<br/>\n" | ||||||||||||||||||||||||||||||||||||||||||
| 214 | . $self->{textGenerator}->{Sorry} | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | . "!<br><br>\n"; | |||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if ( $self->{settings}{password} eq "" ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | print $self->{textGenerator}->{Passwd_need}; | |||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||
| 219 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | print 'You have given the wrong password for these pages.'; | |||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | print "<br><form action=\"$self->{treeScript}\" method=\"GET\">", | |||||||||||||||||||||||||||||||||||||||||
| 224 | "<input type=\"hidden\" name=\"type\" value=\"$self->{pagetype}\">", | ||||||||||||||||||||||||||||||||||||||||||
| 225 | "<p><strong>$self->{settings}{passwordPrompt}</strong><br>", | ||||||||||||||||||||||||||||||||||||||||||
| 226 | '<input type="text" size="25" name="passwd">', | ||||||||||||||||||||||||||||||||||||||||||
| 227 | '<input type="submit" value="Go"></p>', | ||||||||||||||||||||||||||||||||||||||||||
| 228 | "</form>\n"; | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | $self->_endpage(); | |||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | exit 1; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | sub get_cell_class { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_cell_class: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | my ( $self, $person, $nr_of_man, $nr_of_woman ) = validate_pos( | |||||||||||||||||||||||||||||||||||||||||
| 236 | @_, | ||||||||||||||||||||||||||||||||||||||||||
| 237 | { type => HASHREF }, | ||||||||||||||||||||||||||||||||||||||||||
| 238 | { type => SCALARREF }, | ||||||||||||||||||||||||||||||||||||||||||
| 239 | { type => SCALARREF }, | ||||||||||||||||||||||||||||||||||||||||||
| 240 | { type => SCALARREF } | ||||||||||||||||||||||||||||||||||||||||||
| 241 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | if ( !defined $person->get_gender() ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | return 'unknown'; | |||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||
| 245 | elsif ( $person->get_gender() == 0 ) { | ||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | ++${$nr_of_man}; | |||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | return 'man'; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ++${$nr_of_woman}; | |||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | return 'woman'; | |||||||||||||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||
| 255 | 1 | ▶ | sub language_chooser { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
language_chooser: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | #I guess this function can be done simpler! | ||||||||||||||||||||||||||||||||||||||||||
| 258 | 1 | my ($self) = validate_pos( @_, { type => HASHREF } ); | |||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | my $anchor = $self->{cgi}->url( -relative => 0 ) . '?'; | |||||||||||||||||||||||||||||||||||||||||
| 260 | 1 | my %params = CGI::Vars(); | |||||||||||||||||||||||||||||||||||||||||
| 261 | 1 | ▶ | while ( my ( $key, $value ) = each %params ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | 5 | ▶ | if ( $key ne 'lang' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 263 | 4 | $anchor .= "$key=" . decode_utf8("$value") . ';'; | |||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||||
| 267 | print "\n", $self->{cgi}->start_table( { -cellpadding => '3' } ), "\n", | ||||||||||||||||||||||||||||||||||||||||||
| 268 | 1 | $self->{cgi}->start_Tr; | |||||||||||||||||||||||||||||||||||||||||
| 269 | 1 | my %lang_to_pict = Ftree::TextGeneratorFactory::getLangToPict(); | |||||||||||||||||||||||||||||||||||||||||
| 270 | 1 | ▶ | while ( my ( $lang, $pic ) = each %lang_to_pict ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | print $self->{cgi}->td( | ||||||||||||||||||||||||||||||||||||||||||
| 272 | { -align => 'center' }, | ||||||||||||||||||||||||||||||||||||||||||
| 273 | $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 274 | { | ||||||||||||||||||||||||||||||||||||||||||
| 275 | -href => "${anchor}lang=$pic", | ||||||||||||||||||||||||||||||||||||||||||
| 276 | -title => $self->{textGenerator}->{$lang} | ||||||||||||||||||||||||||||||||||||||||||
| 277 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 278 | $self->{cgi}->img( | ||||||||||||||||||||||||||||||||||||||||||
| 279 | { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | -width => 40, | ||||||||||||||||||||||||||||||||||||||||||
| 281 | -src => "$self->{graphicsUrl}/flags/${pic}.gif", | ||||||||||||||||||||||||||||||||||||||||||
| 282 | 8 | -alt => $self->{textGenerator}->{$lang} | |||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||
| 284 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 285 | ) | ||||||||||||||||||||||||||||||||||||||||||
| 286 | ), | ||||||||||||||||||||||||||||||||||||||||||
| 287 | "\n", | ||||||||||||||||||||||||||||||||||||||||||
| 288 | ; | ||||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||
| 290 | print $self->{cgi}->end_Tr, "\n", $self->{cgi}->end_table, | ||||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | $self->{cgi}->br, "\n"; | |||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||
| 293 | 1 | return; | |||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||
| 296 | 10 | ▶ | sub html_img { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
html_img: called CC=7 SCAR=19.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 10 | my ( $self, $person ) = | |||||||||||||||||||||||||||||||||||||||||
| 298 | validate_pos( @_, { type => HASHREF }, { type => SCALARREF } ); | ||||||||||||||||||||||||||||||||||||||||||
| 299 | 10 | ▶ | if ( !defined $person ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | return ""; | |||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||
| 302 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 303 | my $picture_file = | ||||||||||||||||||||||||||||||||||||||||||
| 304 | defined $person->get_default_picture() | ||||||||||||||||||||||||||||||||||||||||||
| 305 | ? $self->{photoUrl} . $person->get_default_picture()->get_file_name() | ||||||||||||||||||||||||||||||||||||||||||
| 306 | : $self->{graphicsUrl} | ||||||||||||||||||||||||||||||||||||||||||
| 307 | . ( | ||||||||||||||||||||||||||||||||||||||||||
| 308 | 10 | ▶ | defined $person->get_gender() | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 309 | ? $person->get_gender() == 0 | ||||||||||||||||||||||||||||||||||||||||||
| 310 | ? '/nophoto_m.jpg' | ||||||||||||||||||||||||||||||||||||||||||
| 311 | : '/nophoto_f.jpg' | ||||||||||||||||||||||||||||||||||||||||||
| 312 | : '/nophoto.gif' | ||||||||||||||||||||||||||||||||||||||||||
| 313 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | return $self->{cgi}->img( | ||||||||||||||||||||||||||||||||||||||||||
| 316 | { | ||||||||||||||||||||||||||||||||||||||||||
| 317 | -border => $self->{imgwidth} / 15, | ||||||||||||||||||||||||||||||||||||||||||
| 318 | -src => $picture_file, | ||||||||||||||||||||||||||||||||||||||||||
| 319 | -class => $person->get_is_living() ? 'alive' : 'dead', | ||||||||||||||||||||||||||||||||||||||||||
| 320 | -alt => ( defined $person->get_name() ) | ||||||||||||||||||||||||||||||||||||||||||
| 321 | ? $person->get_name()->get_full_name() | ||||||||||||||||||||||||||||||||||||||||||
| 322 | : 'UNKNOWN', | ||||||||||||||||||||||||||||||||||||||||||
| 323 | -width => $self->{imgwidth}, | ||||||||||||||||||||||||||||||||||||||||||
| 324 | -height => $self->{imgheight} | ||||||||||||||||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||||||||||||||||
| 326 | 10 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||
| 330 | 16 | ▶ | sub aref_tree { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
aref_tree: called CC=6 SCAR=18.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 331 | 16 | my ( $self, $to_ref, $person, $levels ) = validate_pos( | |||||||||||||||||||||||||||||||||||||||||
| 332 | @_, | ||||||||||||||||||||||||||||||||||||||||||
| 333 | { type => HASHREF }, | ||||||||||||||||||||||||||||||||||||||||||
| 334 | { type => SCALAR }, | ||||||||||||||||||||||||||||||||||||||||||
| 335 | { type => SCALARREF }, | ||||||||||||||||||||||||||||||||||||||||||
| 336 | { optional => 1, type => SCALAR } | ||||||||||||||||||||||||||||||||||||||||||
| 337 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 16 | ▶ | if ( !defined $levels ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | 14 | $levels = $self->{reqLevels}; | |||||||||||||||||||||||||||||||||||||||||
| 340 | 14 | ▶ | $person = $self->$self->{target_person} unless ( defined $person ); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||
| 342 | 16 | ▶ | if ( $levels > 0 ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||
| 344 | 16 | my $brief_info = $person->brief_info( $self->{textGenerator} ); | |||||||||||||||||||||||||||||||||||||||||
| 345 | 16 | ▶ | $brief_info = ( defined $brief_info ) ? $brief_info : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 346 | 16 | my $password = $self->{settings}{password}; | |||||||||||||||||||||||||||||||||||||||||
| 347 | 16 | ▶ | $password = ( defined $password ) ? $password : ""; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | return $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 349 | { | ||||||||||||||||||||||||||||||||||||||||||
| 350 | 16 | -href => "$self->{treeScript}?type=tree;" | |||||||||||||||||||||||||||||||||||||||||
| 351 | . 'target=' | ||||||||||||||||||||||||||||||||||||||||||
| 352 | . $person->get_id() | ||||||||||||||||||||||||||||||||||||||||||
| 353 | . ";levels=$levels;" | ||||||||||||||||||||||||||||||||||||||||||
| 354 | . "passwd=$password;lang=$self->{lang}", | ||||||||||||||||||||||||||||||||||||||||||
| 355 | -title => $brief_info, | ||||||||||||||||||||||||||||||||||||||||||
| 356 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 357 | $to_ref | ||||||||||||||||||||||||||||||||||||||||||
| 358 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||||||||||||
| 360 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 361 | return $self->{cgi}->a( | ||||||||||||||||||||||||||||||||||||||||||
| 362 | { | ||||||||||||||||||||||||||||||||||||||||||
| 363 | -href => "$self->{personScript}?target=" | ||||||||||||||||||||||||||||||||||||||||||
| 364 | . $person->get_id() | ||||||||||||||||||||||||||||||||||||||||||
| 365 | . ";passwd=$self->{settings}{password};lang=$self->{lang}", | ||||||||||||||||||||||||||||||||||||||||||
| 366 | -title => $person->brief_info( $self->{textGenerator} ) | ||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | }, | |||||||||||||||||||||||||||||||||||||||||
| 368 | $to_ref | ||||||||||||||||||||||||||||||||||||||||||
| 369 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||