diff options
author | filip <filip.komar@gmail.com> | 2016-05-19 00:26:48 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2016-05-19 00:26:48 +0200 |
commit | e25e4fcb8927a2831e756baf119cfe5f467a00c8 (patch) | |
tree | 5d4ad13412057a0a8230b8372832bd7b57d2a548 /en/downloads/get/lib.php | |
parent | a07cdad7531caf3c046b30dae24b09a7b9be4b35 (diff) | |
download | www-e25e4fcb8927a2831e756baf119cfe5f467a00c8.tar www-e25e4fcb8927a2831e756baf119cfe5f467a00c8.tar.gz www-e25e4fcb8927a2831e756baf119cfe5f467a00c8.tar.bz2 www-e25e4fcb8927a2831e756baf119cfe5f467a00c8.tar.xz www-e25e4fcb8927a2831e756baf119cfe5f467a00c8.zip |
adding signature links + refresh i19n
Diffstat (limited to 'en/downloads/get/lib.php')
-rw-r--r-- | en/downloads/get/lib.php | 30 |
1 files changed, 29 insertions, 1 deletions
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; +} |