diff options
| author | Greg Roach <fisharebest@gmail.com> | 2017-01-12 23:04:25 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2017-01-12 23:04:25 +0000 |
| commit | 0d4fbeaea5cc982a07c00bc5c8fb2ea9f122c716 (patch) | |
| tree | b025cc2eb64c2d57b3c341f62f9162efe2a4676f /app/Functions | |
| parent | 0b6446e16b80d70a0f6b905f3d98d8752d3c452b (diff) | |
| download | webtrees-0d4fbeaea5cc982a07c00bc5c8fb2ea9f122c716.tar.gz webtrees-0d4fbeaea5cc982a07c00bc5c8fb2ea9f122c716.tar.bz2 webtrees-0d4fbeaea5cc982a07c00bc5c8fb2ea9f122c716.zip | |
Utility function
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 |
