summaryrefslogtreecommitdiff
path: root/app/Module/GoogleMapsModule.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Module/GoogleMapsModule.php')
-rw-r--r--app/Module/GoogleMapsModule.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/app/Module/GoogleMapsModule.php b/app/Module/GoogleMapsModule.php
index 790c36d6a1..d6d2793269 100644
--- a/app/Module/GoogleMapsModule.php
+++ b/app/Module/GoogleMapsModule.php
@@ -28,6 +28,7 @@ use Fisharebest\Webtrees\FontAwesome;
use Fisharebest\Webtrees\Functions\Functions;
use Fisharebest\Webtrees\Functions\FunctionsCharts;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
+use Fisharebest\Webtrees\Html;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Log;
@@ -408,7 +409,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?= I18N::translate('Use Google Maps™ for the place hierarchy') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('GM_PLACE_HIERARCHY', [I18N::translate('no'), I18N::translate('yes')], $this->getPreference('GM_PLACE_HIERARCHY'), true) ?>
+ <?= Bootstrap4::radioButtons('GM_PLACE_HIERARCHY', [I18N::translate('no'), I18N::translate('yes')], $this->getPreference('GM_PLACE_HIERARCHY', '0'), true) ?>
</div>
</div>
</fieldset>
@@ -1323,7 +1324,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
echo '<a href="#" onclick="return openInfowindow(\'', $index, '\')">', $event['fact_label'], '</a></td>';
echo '<td class="', $event['class'], '">';
if ($event['info']) {
- echo '<div><span class="field">', Filter::escapeHtml($event['info']), '</span></div>';
+ echo '<div><span class="field">', Html::escape($event['info']), '</span></div>';
}
if ($event['name']) {
echo '<div>', $event['name'], '</div>';
@@ -2157,7 +2158,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?php
foreach ($placefiles as $p => $placefile) {
unset($placefiles[$p]);
- $p = Filter::escapeHtml($placefile);
+ $p = Html::escape($placefile);
if (substr($placefile, 0, 1) == '/') {
$placefiles[$p] = substr($placefile, 1);
} else {
@@ -2585,7 +2586,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
[0 => I18N::translate('Geographic data')] +
$this->placeIdToHierarchy($place_id === 0 ? $parent_id : $place_id);
foreach ($hierarchy as $id => $name) {
- $breadcrumbs += ['module.php?mod=googlemap&mod_action=admin_places&parent_id=' . $id .'&inactive=' . $inactive => Filter::escapeHtml($name)];
+ $breadcrumbs += ['module.php?mod=googlemap&mod_action=admin_places&parent_id=' . $id .'&inactive=' . $inactive => Html::escape($name)];
}
echo Bootstrap4::breadcrumbs($breadcrumbs, $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit'));
@@ -2982,7 +2983,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?= I18N::translate('Place') ?>
</label>
<div class="col-sm-6">
- <input type="text" id="new_pl_name" name="NEW_PLACE_NAME" value="<?= Filter::escapeHtml($record->pl_place) ?>" class="form-control" required>
+ <input type="text" id="new_pl_name" name="NEW_PLACE_NAME" value="<?= Html::escape($record->pl_place) ?>" class="form-control" required>
<label for="new_pl_name">
<a href="#" onclick="showLocation_all(document.getElementById('new_pl_name').value); return false">
@@ -3091,7 +3092,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
[0 => I18N::translate('Geographic data')] +
$this->placeIdToHierarchy($parent_id);
foreach (array_slice($hierarchy, 0, -1, true) as $id => $name) {
- $breadcrumbs += ['module.php?mod=googlemap&mod_action=admin_places&parent_id=' . $id .'&inactive=' . $inactive => Filter::escapeHtml($name)];
+ $breadcrumbs += ['module.php?mod=googlemap&mod_action=admin_places&parent_id=' . $id .'&inactive=' . $inactive => Html::escape($name)];
}
echo Bootstrap4::breadcrumbs($breadcrumbs, end($hierarchy));
@@ -3193,7 +3194,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$highestIndex++;
Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_zoom) VALUES (?, ?, ?, ?, ?)")
->execute([$highestIndex, $parent_id, $i, $escparent, $default_zoom_level[$i]]);
- echo Filter::escapeHtml($escparent), '<br>';
+ echo Html::escape($escparent), '<br>';
$parent_id = $highestIndex;
} else {
$parent_id = $row->pl_id;
@@ -3204,12 +3205,12 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
$highestIndex++;
Database::prepare("INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place, pl_long, pl_lati, pl_zoom) VALUES (?, ?, ?, ?, ?, ?, ?)")
->execute([$highestIndex, $parent_id, $i, $escparent, $place['long'], $place['lati'], $default_zoom_level[$i]]);
- echo Filter::escapeHtml($escparent), '<br>';
+ echo Html::escape($escparent), '<br>';
} else {
if (empty($row->pl_long) && empty($row->pl_lati) && $place['lati'] != '0' && $place['long'] != '0') {
Database::prepare("UPDATE `##placelocation` SET pl_lati=?, pl_long=? WHERE pl_id=?")
->execute([$place['lati'], $place['long'], $row->pl_id]);
- echo Filter::escapeHtml($escparent), '<br>';
+ echo Html::escape($escparent), '<br>';
}
}
}
@@ -3253,7 +3254,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
<?php if ($place['place'] === 'Unknown'): ?>
<?= I18N::translate('unknown') ?>
<?php else: ?>
- <?= Filter::escapeHtml($place['place']) ?>
+ <?= Html::escape($place['place']) ?>
<?php endif ?>
<?php if ($place['missing'] > 0): ?>
<span class="badge badge-pill badge-warning">
@@ -3277,7 +3278,7 @@ class GoogleMapsModule extends AbstractModule implements ModuleConfigInterface,
</td>
<td>
<?php if ($place['icon']): ?>
- <img src="<?= WT_STATIC_URL ?><?= WT_MODULES_DIR ?>googlemap/places/flags/<?= Filter::escapeHtml($place['icon']) ?>" width="25" height="15" title="<?= Filter::escapeHtml($place['icon']) ?>" alt="<?= I18N::translate('Flag') ?>">
+ <img src="<?= WT_STATIC_URL ?><?= WT_MODULES_DIR ?>googlemap/places/flags/<?= Html::escape($place['icon']) ?>" width="25" height="15" title="<?= Html::escape($place['icon']) ?>" alt="<?= I18N::translate('Flag') ?>">
<?php else: ?>
<img src="<?= WT_STATIC_URL ?><?= WT_MODULES_DIR ?>googlemap/images/mm_20_red.png">
<?php endif ?>