@@ -82,7 +82,8 @@ discard block |
||
82 | 82 | <?php if ($ancestors_only === '1'): ?> |
83 | 83 | <input type="hidden" name="ancestors" value="1"> |
84 | 84 | <?= I18N::translate('Find relationships via ancestors') ?> |
85 | - <?php else: ?> |
|
85 | + <?php else { |
|
86 | + : ?> |
|
86 | 87 | <?= Bootstrap4::radioButtons('ancestors', ['0' => I18N::translate('Find any relationship'), '1' => I18N::translate('Find relationships via ancestors')], $ancestors, false) ?> |
87 | 88 | <?php endif ?> |
88 | 89 | </div> |
@@ -116,6 +117,7 @@ discard block |
||
116 | 117 | if ($person1 && $person2) { |
117 | 118 | if (I18N::direction() === 'ltr') { |
118 | 119 | $diagonal1 = Theme::theme()->parameter('image-dline'); |
120 | +} |
|
119 | 121 | $diagonal2 = Theme::theme()->parameter('image-dline2'); |
120 | 122 | } else { |
121 | 123 | $diagonal1 = Theme::theme()->parameter('image-dline2'); |
@@ -146,39 +146,39 @@ |
||
146 | 146 | foreach ($path as $n => $xref) { |
147 | 147 | if ($n % 2 === 1) { |
148 | 148 | switch ($relationships[$n]) { |
149 | - case 'hus': |
|
150 | - case 'wif': |
|
151 | - case 'spo': |
|
152 | - case 'bro': |
|
153 | - case 'sis': |
|
154 | - case 'sib': |
|
155 | - $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px;">' . FontAwesome::decorativeIcon('arrow-end') . '</div></div>'; |
|
156 | - $x += 2; |
|
157 | - break; |
|
158 | - case 'son': |
|
159 | - case 'dau': |
|
160 | - case 'chi': |
|
161 | - if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
162 | - $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: start;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
149 | + case 'hus': |
|
150 | + case 'wif': |
|
151 | + case 'spo': |
|
152 | + case 'bro': |
|
153 | + case 'sis': |
|
154 | + case 'sib': |
|
155 | + $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px;">' . FontAwesome::decorativeIcon('arrow-end') . '</div></div>'; |
|
163 | 156 | $x += 2; |
164 | - } else { |
|
165 | - $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
166 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
167 | - } |
|
168 | - $y -= 2; |
|
169 | - break; |
|
170 | - case 'fat': |
|
171 | - case 'mot': |
|
172 | - case 'par': |
|
173 | - if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
174 | - $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: end;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
175 | - $x += 2; |
|
176 | - } else { |
|
177 | - $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
178 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . FontAwesome::decorativeIcon('arrow-up') . '</div></div>'; |
|
179 | - } |
|
180 | - $y += 2; |
|
181 | - break; |
|
157 | + break; |
|
158 | + case 'son': |
|
159 | + case 'dau': |
|
160 | + case 'chi': |
|
161 | + if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
162 | + $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: start;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
163 | + $x += 2; |
|
164 | + } else { |
|
165 | + $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
166 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
167 | + } |
|
168 | + $y -= 2; |
|
169 | + break; |
|
170 | + case 'fat': |
|
171 | + case 'mot': |
|
172 | + case 'par': |
|
173 | + if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
174 | + $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: end;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
175 | + $x += 2; |
|
176 | + } else { |
|
177 | + $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
178 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . FontAwesome::decorativeIcon('arrow-up') . '</div></div>'; |
|
179 | + } |
|
180 | + $y += 2; |
|
181 | + break; |
|
182 | 182 | } |
183 | 183 | $max_x = max($max_x, $x); |
184 | 184 | $min_y = min($min_y, $y); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | return [ |
66 | 66 | 'data-language' => json_encode($language), |
67 | - 'data-length-menu' => json_encode([array_keys($length_menu), array_values($length_menu)]) |
|
67 | + 'data-length-menu' => json_encode([array_keys($length_menu), array_values($length_menu)]) |
|
68 | 68 | ]; |
69 | 69 | } |
70 | 70 |
@@ -101,9 +101,9 @@ |
||
101 | 101 | 'info' => 'fa fa-info-circle', |
102 | 102 | 'warning' => 'fa fa-exclamation-circle', |
103 | 103 | |
104 | - // Icons for file types |
|
105 | - 'mime-application-pdf' => '', |
|
106 | - 'mime-text-html' => '', |
|
104 | + // Icons for file types |
|
105 | + 'mime-application-pdf' => '', |
|
106 | + 'mime-text-html' => '', |
|
107 | 107 | |
108 | 108 | // Other icons |
109 | 109 | 'mail' => 'fa fa-envelope-o', |
@@ -329,12 +329,12 @@ discard block |
||
329 | 329 | $method = $user->getPreference('contactmethod'); |
330 | 330 | |
331 | 331 | switch ($method) { |
332 | - case 'none': |
|
333 | - return ''; |
|
334 | - case 'mailto': |
|
335 | - return '<a href="mailto:' . Html::escape($user->getEmail()) . '">' . $user->getRealNameHtml() . '</a>'; |
|
336 | - default: |
|
337 | - return '<a href="message.php?to=' . rawurlencode($user->getUserName()) . '&ged=' . $this->tree->getNameUrl() . '&url=' . Html::escape(Functions::getQueryUrl()) . '">' . $user->getRealNameHtml() . '</a>'; |
|
332 | + case 'none': |
|
333 | + return ''; |
|
334 | + case 'mailto': |
|
335 | + return '<a href="mailto:' . Html::escape($user->getEmail()) . '">' . $user->getRealNameHtml() . '</a>'; |
|
336 | + default: |
|
337 | + return '<a href="message.php?to=' . rawurlencode($user->getUserName()) . '&ged=' . $this->tree->getNameUrl() . '&url=' . Html::escape(Functions::getQueryUrl()) . '">' . $user->getRealNameHtml() . '</a>'; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
@@ -1413,20 +1413,20 @@ discard block |
||
1413 | 1413 | $records = []; |
1414 | 1414 | foreach ($favorites as $favorite) { |
1415 | 1415 | switch ($favorite['type']) { |
1416 | - case 'URL': |
|
1417 | - $submenus[] = new Menu($favorite['title'], $favorite['url']); |
|
1418 | - break; |
|
1419 | - case 'INDI': |
|
1420 | - case 'FAM': |
|
1421 | - case 'SOUR': |
|
1422 | - case 'OBJE': |
|
1423 | - case 'NOTE': |
|
1424 | - $record = GedcomRecord::getInstance($favorite['gid'], $this->tree); |
|
1425 | - if ($record && $record->canShowName()) { |
|
1426 | - $submenus[] = new Menu($record->getFullName(), $record->getHtmlUrl()); |
|
1427 | - $records[] = $record; |
|
1428 | - } |
|
1429 | - break; |
|
1416 | + case 'URL': |
|
1417 | + $submenus[] = new Menu($favorite['title'], $favorite['url']); |
|
1418 | + break; |
|
1419 | + case 'INDI': |
|
1420 | + case 'FAM': |
|
1421 | + case 'SOUR': |
|
1422 | + case 'OBJE': |
|
1423 | + case 'NOTE': |
|
1424 | + $record = GedcomRecord::getInstance($favorite['gid'], $this->tree); |
|
1425 | + if ($record && $record->canShowName()) { |
|
1426 | + $submenus[] = new Menu($record->getFullName(), $record->getHtmlUrl()); |
|
1427 | + $records[] = $record; |
|
1428 | + } |
|
1429 | + break; |
|
1430 | 1430 | } |
1431 | 1431 | } |
1432 | 1432 |
@@ -123,7 +123,8 @@ discard block |
||
123 | 123 | <div class="form-control"><?= Html::escape(Auth::user()->getRealName()) ?></div> |
124 | 124 | </div> |
125 | 125 | </div> |
126 | - <?php else: ?> |
|
126 | + <?php else { |
|
127 | + : ?> |
|
127 | 128 | <div class="form-group row"> |
128 | 129 | <label class="col-sm-3 col-form-label" for="from-name"> |
129 | 130 | <?= I18N::translate('Your name') ?> |
@@ -181,6 +182,7 @@ discard block |
||
181 | 182 | function recipients($to) { |
182 | 183 | if ($to === 'all') { |
183 | 184 | $recipients = User::all(); |
185 | +} |
|
184 | 186 | } elseif ($to === 'last_6mo') { |
185 | 187 | $recipients = array_filter(User::all(), function(User $user) { |
186 | 188 | return $user->getPreference('sessiontime') > 0 && WT_TIMESTAMP - $user->getPreference('sessiontime') > 60 * 60 * 24 * 30 * 6; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $controller->restrictAccess(!in_array($to, ['all', 'never_logged', 'last_6mo']) || Auth::isAdmin()); |
96 | 96 | $controller->pageHeader(); |
97 | 97 | |
98 | -$to_names = implode(I18N::$list_separator, array_map(function(User $user) { |
|
98 | +$to_names = implode(I18N::$list_separator, array_map(function (User $user) { |
|
99 | 99 | return $user->getRealName(); |
100 | 100 | }, recipients($to))); |
101 | 101 | |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | if ($to === 'all') { |
185 | 185 | $recipients = User::all(); |
186 | 186 | } elseif ($to === 'last_6mo') { |
187 | - $recipients = array_filter(User::all(), function(User $user) { |
|
187 | + $recipients = array_filter(User::all(), function (User $user) { |
|
188 | 188 | return $user->getPreference('sessiontime') > 0 && WT_TIMESTAMP - $user->getPreference('sessiontime') > 60 * 60 * 24 * 30 * 6; |
189 | 189 | }); |
190 | 190 | } elseif ($to === 'never_logged') { |
191 | - $recipients = array_filter(User::all(), function(User $user) { |
|
191 | + $recipients = array_filter(User::all(), function (User $user) { |
|
192 | 192 | return $user->getPreference('verified_by_admin') && $user->getPreference('reg_timestamp') > $user->getPreference('sessiontime'); |
193 | 193 | }); |
194 | 194 | } else { |
@@ -68,7 +68,7 @@ |
||
68 | 68 | // Caution - $media_dir may contain relative paths: ../../ |
69 | 69 | $source_dir = new Filesystem(new Local(WT_DATA_DIR . $media_dir)); |
70 | 70 | $cache_dir = new Filesystem(new Local(WT_DATA_DIR . 'thumbnail-cache/' . md5($media_dir))); |
71 | - $assets_dir = new Filesystem(new Local( 'assets')); |
|
71 | + $assets_dir = new Filesystem(new Local('assets')); |
|
72 | 72 | |
73 | 73 | $server = ServerFactory::create([ |
74 | 74 | 'driver' => $driver, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function getTabs() { |
98 | 98 | $active_tabs = Module::getActiveTabs($this->record->getTree()); |
99 | 99 | |
100 | - return array_filter($active_tabs, function(ModuleTabInterface $tab) { |
|
100 | + return array_filter($active_tabs, function (ModuleTabInterface $tab) { |
|
101 | 101 | return $tab->hasTabContent(); |
102 | 102 | }); |
103 | 103 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | if ($individual->canEdit() && !$fact->isPendingDeletion()) { |
250 | - $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $individual->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $individual->getTree()->getNameHtml() ]); |
|
250 | + $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), ['class' => 'btn btn-link', 'href' => 'edit_interface.php?action=edit&xref=' . $individual->getXref() . '&fact_id=' . $fact->getFactId() . '&ged=' . $individual->getTree()->getNameHtml()]); |
|
251 | 251 | } else { |
252 | 252 | $edit_links = ''; |
253 | 253 | } |
@@ -166,23 +166,23 @@ discard block |
||
166 | 166 | $name = str_replace('/', '', $name); |
167 | 167 | $name = preg_replace('/(\S*)\*/', '<span class="starredname">\\1</span>', $name); |
168 | 168 | switch ($tag) { |
169 | - case 'TYPE': |
|
170 | - echo GedcomCodeName::getValue($name, $this->record); |
|
171 | - break; |
|
172 | - case 'SURN': |
|
173 | - // The SURN field is not necessarily the surname. |
|
174 | - // Where it is not a substring of the real surname, show it after the real surname. |
|
175 | - $surname = Html::escape($dummy->getAllNames()[0]['surname']); |
|
176 | - $surns = preg_replace('/, */', ' ', $nmatch[$i][2]); |
|
177 | - if (strpos($dummy->getAllNames()[0]['surname'], $surns) !== false) { |
|
178 | - echo '<span dir="auto">' . $surname . '</span>'; |
|
179 | - } else { |
|
180 | - echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>'); |
|
181 | - } |
|
182 | - break; |
|
183 | - default: |
|
184 | - echo '<span dir="auto">' . $name . '</span>'; |
|
185 | - break; |
|
169 | + case 'TYPE': |
|
170 | + echo GedcomCodeName::getValue($name, $this->record); |
|
171 | + break; |
|
172 | + case 'SURN': |
|
173 | + // The SURN field is not necessarily the surname. |
|
174 | + // Where it is not a substring of the real surname, show it after the real surname. |
|
175 | + $surname = Html::escape($dummy->getAllNames()[0]['surname']); |
|
176 | + $surns = preg_replace('/, */', ' ', $nmatch[$i][2]); |
|
177 | + if (strpos($dummy->getAllNames()[0]['surname'], $surns) !== false) { |
|
178 | + echo '<span dir="auto">' . $surname . '</span>'; |
|
179 | + } else { |
|
180 | + echo I18N::translate('%1$s (%2$s)', '<span dir="auto">' . $surname . '</span>', '<span dir="auto">' . $name . '</span>'); |
|
181 | + } |
|
182 | + break; |
|
183 | + default: |
|
184 | + echo '<span dir="auto">' . $name . '</span>'; |
|
185 | + break; |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 | echo '</dd>'; |
@@ -228,15 +228,15 @@ discard block |
||
228 | 228 | $individual = $fact->getParent(); |
229 | 229 | |
230 | 230 | switch ($fact->getValue()) { |
231 | - case 'M': |
|
232 | - $sex = I18N::translate('Male'); |
|
233 | - break; |
|
234 | - case 'F': |
|
235 | - $sex = I18N::translate('Female'); |
|
236 | - break; |
|
237 | - default: |
|
238 | - $sex = I18N::translateContext('unknown gender', 'Unknown'); |
|
239 | - break; |
|
231 | + case 'M': |
|
232 | + $sex = I18N::translate('Male'); |
|
233 | + break; |
|
234 | + case 'F': |
|
235 | + $sex = I18N::translate('Female'); |
|
236 | + break; |
|
237 | + default: |
|
238 | + $sex = I18N::translateContext('unknown gender', 'Unknown'); |
|
239 | + break; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | $container_class = 'card'; |
@@ -296,15 +296,15 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function getPersonStyle($person) { |
298 | 298 | switch ($person->getSex()) { |
299 | - case 'M': |
|
300 | - $class = 'person_box'; |
|
301 | - break; |
|
302 | - case 'F': |
|
303 | - $class = 'person_boxF'; |
|
304 | - break; |
|
305 | - default: |
|
306 | - $class = 'person_boxNN'; |
|
307 | - break; |
|
299 | + case 'M': |
|
300 | + $class = 'person_box'; |
|
301 | + break; |
|
302 | + case 'F': |
|
303 | + $class = 'person_boxF'; |
|
304 | + break; |
|
305 | + default: |
|
306 | + $class = 'person_boxNN'; |
|
307 | + break; |
|
308 | 308 | } |
309 | 309 | if ($person->isPendingDeletion()) { |
310 | 310 | $class .= ' old'; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @return string |
63 | 63 | */ |
64 | 64 | public static function getFilenameForView($view_name) { |
65 | - $view_file = $view_name . '.php'; |
|
65 | + $view_file = $view_name . '.php'; |
|
66 | 66 | //$theme_view = WT_THEMES_DIR . Theme::theme()->themeId() . '/resources/views/' . $view_file; |
67 | 67 | |
68 | 68 | //if (file_exists($theme_view)) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * You should have received a copy of the GNU General Public License |
14 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 | */ |
16 | -declare(strict_types=1); |
|
16 | +declare(strict_types = 1); |
|
17 | 17 | |
18 | 18 | namespace Fisharebest\Webtrees; |
19 | 19 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * You should have received a copy of the GNU General Public License |
14 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 | */ |
16 | -declare(strict_types=1); |
|
16 | +declare(strict_types = 1); |
|
17 | 17 | |
18 | 18 | namespace Fisharebest\Webtrees; |
19 | 19 |