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