diff options
Diffstat (limited to 'app/Functions')
| -rw-r--r-- | app/Functions/FunctionsEdit.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/Functions/FunctionsEdit.php b/app/Functions/FunctionsEdit.php index 5f9300f8b8..8a23b1ea67 100644 --- a/app/Functions/FunctionsEdit.php +++ b/app/Functions/FunctionsEdit.php @@ -50,7 +50,7 @@ use Fisharebest\Webtrees\User; use Rhumsaa\Uuid\Uuid; /** - * Class FunctionsEdit - common functions + * Class FunctionsEdit - common functions for editing */ class FunctionsEdit { /** @@ -169,6 +169,24 @@ class FunctionsEdit { } /** + * A list of integers (e.g. for an edit control). + * + * @return string[] + */ + public static function numericOptions($integers) { + $array = []; + foreach ($integers as $integer) { + if ($integer === -1) { + $array[$integer] = I18N::translate('All'); + } else { + $array[$integer] = I18N::number($integer); + } + } + + return $array; + } + + /** * Function edit_language_checkboxes * * @param string $parameter_name |
