1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id$ 7 8function prefs_server_list($partial = false) 9{ 10 11 // Skipping the getTimeZoneList() from tikidate which just emulates the pear date format 12 // Generating it is extremely costly in terms of memory. 13 if (class_exists('DateTimeZone')) { 14 $timezones = DateTimeZone::listIdentifiers(); 15 } elseif (class_exists('DateTime')) { 16 $timezones = array_keys(DateTime::getTimeZoneList()); 17 } else { 18 $timezones = TikiDate::getTimeZoneList(); 19 $timezones = array_keys($timezones); 20 } 21 22 sort($timezones); 23 24 $tikidate = TikiLib::lib('tikidate'); 25 26 return [ 27 'server_timezone' => [ 28 'name' => tra('Time zone'), 29 'description' => tra('Indicates the default time zone to use for the server.'), 30 'type' => 'list', 31 'options' => array_combine($timezones, $timezones), 32 'default' => isset($tikidate) ? $tikidate->getTimezoneId() : 'UTC', 33 'tags' => ['basic'], 34 ], 35 ]; 36} 37