1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
<?php
namespace Fisharebest\Webtrees;
/**
* webtrees: online genealogy
* Copyright (C) 2015 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use Fisharebest\Webtrees\Controller\PageController;
/**
* Defined in edit_interface.php
*
* @global PageController $controller
* @global Individual $person
*/
global $person, $controller;
?>
<style>
/* Outer border around nav elements */
.outer_nav {
border: 3px #808080 outset;
}
#media-links table.facts_table {
width: 270px;
}
/* top Search box */
input[type='text'] {
background: #fff;
color: #000;
border: 1px solid #000;
width: 120px;
}
/* "Head" button images */
.headimg {
margin-top: -4px;
border: 0;
}
/* Prevents clickable td for Search <td> */
td #srch a {
display: inline;
}
</style>
<div id="media-links">
<table class="facts_table center">
<tr>
<td class="topbottombar" colspan="1">
<b><?php echo $controller->getPageTitle(); ?></b>
</td>
</tr>
<tr>
<td valign="top">
<table class="outer_nav">
<tr>
<th class="descriptionbox"><?php echo I18N::translate('Search for individuals to add to add Links list.'); ?></th>
</tr>
<tr>
<td id="srch" class="optionbox center">
<script>
function findindi() {
var findInput = document.getElementById('personid');
var txt = findInput.value;
if (txt === "") {
alert("<?php echo I18N::translate('You must enter a name'); ?>");
} else {
window.open("module.php?mod=GEDFact_assistant&mod_action=media_find&callback=paste_id&action=filter&type=indi&multiple=&filter=" + txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=600, WIDTH=450 ").focus();
}
}
</script>
<input id="personid" type="text" value="">
<a type="submit" onclick="findindi();">
<?php echo I18N::translate('Search'); ?>
</a>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" class="fact_table" cellspacing="0" border="0">
<tr>
<td align="center" colspan=3 class="descriptionbox wrap">
<?php echo I18N::translate('Click %s to choose individual as head of family.', '<i class="headimg vmiddle icon-button_head"></i>'); ?>
<br><br>
<?php echo I18N::translate('Click name to add individual to add links list.'); ?>
</td>
</tr>
<?php
foreach ($person->getChildFamilies() as $family) {
echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
print_navigator_family($family, $person);
}
foreach ($person->getChildStepFamilies() as $family) {
echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
print_navigator_family($family, $person);
}
foreach ($person->getSpouseFamilies() as $family) {
echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
print_navigator_family($family, $person);
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
/**
* Display family members with clickable links
*
* @param Family $family
* @param Individual $individual
*/
function print_navigator_family(Family $family, Individual $individual) {
foreach ($family->getSpouses() as $spouse) {
?>
<tr class="fact_value">
<td class="facts_value">
<a href="edit_interface.php?action=addmedia_links&noteid=newnote&pid=<?php echo $spouse->getXref(); ?>&gedcom=<?php echo $spouse->getTree()->getNameUrl(); ?>">
<i class="headimg vmiddle icon-button_head"></i>
</a>
</td>
<td class="facts_value" >
<a href="#" onclick="opener.insertRowToTable('<?php echo $spouse->getXref(); ?>', '<?php echo Filter::escapeJs($spouse->getFullName()); ?>', '', '', '', '', '', '', '', '');">
<?php echo $spouse === $individual ? '<b>' : ''; ?>
<?php echo $spouse->getFullName(); ?> <?php echo $spouse->getLifeSpan(); ?>
<?php echo $spouse === $individual ? '</b>' : ''; ?>
</a>
</td>
<tr>
<?php
}
foreach ($family->getChildren() as $child) {
?>
<tr>
<td class="facts_value" >
<a href="edit_interface.php?action=addmedia_links&noteid=newnote&pid=<?php echo $child->getXref(); ?>&gedcom=<?php echo $child->getTree()->getNameUrl(); ?>">
<i class="headimg vmiddle icon-button_head"></i>
</a>
</td>
<td class="facts_value">
<a href="#" onclick="opener.insertRowToTable('<?php echo $child->getXref(); ?>', '<?php echo Filter::escapeJs($child->getFullName()); ?>', '', '', '', '', '', '', '', '');">
<?php echo $child === $individual ? '<b>' : ''; ?>
<?php echo $child->getFullName(); ?> <?php echo $child->getLifeSpan(); ?>
<?php echo $child === $individual ? '</b>' : ''; ?>
</a>
</td>
</tr>
<?php
}
}
|