blob: 12ccc8111aaddb69bc617dde03455bc04a07cc51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php
function &get_timezones($dir=null) {
global $S;
static $results;
if ($dir == null) {
if (isset($results))
return $results;
$results=array();
$dir=realpath($S['conf']['timezone_root']);
}
foreach (glob($dir.'/*') as $file) {
if (is_dir($file) && !is_link($file))
get_timezones($file);
else {
$file=substr($file, strlen($S['conf']['timezone_root'])+1);
if ($file != 'zone.tab')
$results[$file]=str_replace('_', ' ', $file);
}
}
if ($dir == $S['conf']['timezone_root']) {
natsort($results);
}
return $results;
}
?>
|