From e25e4fcb8927a2831e756baf119cfe5f467a00c8 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 19 May 2016 00:26:48 +0200 Subject: adding signature links + refresh i19n --- en/downloads/get/lib.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'en/downloads/get/lib.php') diff --git a/en/downloads/get/lib.php b/en/downloads/get/lib.php index 65baa10a3..cb15c423d 100644 --- a/en/downloads/get/lib.php +++ b/en/downloads/get/lib.php @@ -162,4 +162,32 @@ function get_download_link($product, $torrent_preferred = false) } return '$MIRROR/' . $path; -} \ No newline at end of file +} + +/** + * Builds human readable list from array with l10n option + * + * @param array $array to build the string from + * @param string $last_separator flexible (l10n) last separator + * @param string $nonlast_separator flexible (l10n) other than last separators + * + * @return string +*/ +function array_to_list($array, $last_separator = ' and ', $nonlast_separator = ', ') +{ + $num_of_values = count($array); + $output_string = ''; + $separator = $nonlast_separator; + foreach ($array as $value) { + $output_string .= $value; + if ($num_of_values == 2) { + $separator = $last_separator; + } else if ($num_of_values == 1) { + $separator = ''; + } + $output_string .= $separator; + $num_of_values--; + } + + return $output_string; +} -- cgit v1.2.1