summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-06-21 08:49:21 +0100
committerGreg Roach <greg@subaqua.co.uk>2020-06-21 08:52:48 +0100
commit138139c24b30d9bfcf87bbf2c44e9b9c3dd5686d (patch)
tree1eb2eac5d1de3e4b389be0365cab2816e97652ef
parentc4ab77836f5d948a00afddbda0f57c43f9a94510 (diff)
downloadwebtrees-138139c24b30d9bfcf87bbf2c44e9b9c3dd5686d.tar.gz
webtrees-138139c24b30d9bfcf87bbf2c44e9b9c3dd5686d.tar.bz2
webtrees-138139c24b30d9bfcf87bbf2c44e9b9c3dd5686d.zip
Replace deprecated functions
-rw-r--r--app/Auth.php13
-rw-r--r--app/Functions/FunctionsEdit.php7
-rw-r--r--resources/views/admin/trees-privacy.phtml3
3 files changed, 15 insertions, 8 deletions
diff --git a/app/Auth.php b/app/Auth.php
index 81f3ffc6a8..8795f3e68d 100644
--- a/app/Auth.php
+++ b/app/Auth.php
@@ -481,4 +481,17 @@ class Auth
Auth::PRIV_HIDE => I18N::translate('Hide from everyone'),
];
}
+
+ /**
+ * @return array<string,string>
+ */
+ public static function privacyRuleNames(): array
+ {
+ return [
+ 'none' => I18N::translate('Show to visitors'),
+ 'privacy' => I18N::translate('Show to members'),
+ 'confidential' => I18N::translate('Show to managers'),
+ 'hidden' => I18N::translate('Hide from everyone'),
+ ];
+ }
}
diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php
index ea62b13475..b8c780e141 100644
--- a/app/Functions/FunctionsEdit.php
+++ b/app/Functions/FunctionsEdit.php
@@ -242,12 +242,7 @@ class FunctionsEdit
*/
public static function optionsRestrictionsRule(): array
{
- return [
- 'none' => I18N::translate('Show to visitors'),
- 'privacy' => I18N::translate('Show to members'),
- 'confidential' => I18N::translate('Show to managers'),
- 'hidden' => I18N::translate('Hide from everyone'),
- ];
+ return Auth::privacyRuleNames();
}
/**
diff --git a/resources/views/admin/trees-privacy.phtml b/resources/views/admin/trees-privacy.phtml
index 4f2ba2e4a7..449ec58293 100644
--- a/resources/views/admin/trees-privacy.phtml
+++ b/resources/views/admin/trees-privacy.phtml
@@ -1,7 +1,6 @@
<?php
use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\View;
@@ -265,7 +264,7 @@ use Fisharebest\Webtrees\View;
<?php endif ?>
</td>
<td>
- <?= FunctionsEdit::optionsRestrictionsRule()[$privacy_restriction->resn] ?>
+ <?= Auth::privacyRuleNames()[$privacy_restriction->resn] ?>
</td>
<td>
<label for="delete-<?= $privacy_restriction->default_resn_id ?>">