本文整理汇总了PHP中timezone_identifiers_list函数的典型用法代码示例。如果您正苦于以下问题:PHP timezone_identifiers_list函数的具体用法?PHP timezone_identifiers_list怎么用?PHP timezone_identifiers_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了timezone_identifiers_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Returns a new TimeZone object.
*
* @param StringLiteral $name
*
* @throws InvalidTimeZoneException
*/
public function __construct(StringLiteral $name)
{
if (!in_array($name->toNative(), timezone_identifiers_list())) {
throw new InvalidTimeZoneException($name);
}
$this->name = $name;
}
开发者ID:embarknow,项目名称:value-objects,代码行数:14,代码来源:TimeZone.php
示例2: __generateTimezoneSelectOptions
static function __generateTimezoneSelectOptions($default_tz)
{
$timezone_identifiers = timezone_identifiers_list();
sort($timezone_identifiers);
$current_continent = "";
$options_list = "";
foreach ($timezone_identifiers as $timezone_identifier) {
list($continent, ) = explode("/", $timezone_identifier, 2);
if (in_array($continent, array("Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Australia", "Europe", "Indian", "Pacific"))) {
list(, $city) = explode("/", $timezone_identifier, 2);
if (strlen($current_continent) === 0) {
$options_list .= "<optgroup label=\"" . $continent . "\">";
// Start first continent optgroup
} elseif ($current_continent != $continent) {
$options_list .= "</optgroup><optgroup label=\"" . $continent . "\">";
// End old optgroup and start new continent optgroup
}
$options_list .= "<option" . ($timezone_identifier == $default_tz ? " selected=\"selected\"" : "") . " value=\"" . $timezone_identifier . "\">" . str_replace("_", " ", $city) . "</option>";
//Timezone
}
$current_continent = $continent;
}
$options_list .= "</optgroup>";
// End last continent optgroup
return $options_list;
}
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:26,代码来源:customFieldsInterface.php
示例3: isValidTimeZone
/**
* Check valid time zone
*
* @param string $time_zone
* @return bool
*/
protected function isValidTimeZone($time_zone)
{
if (in_array($time_zone, timezone_identifiers_list())) {
return true;
}
return false;
}
开发者ID:freeongoo,项目名称:timezone,代码行数:13,代码来源:TimeZone.php
示例4: getcontent
public function getcontent()
{
$merger = tlocalmerger::i();
$tabs = new tuitabs();
$html = $this->html;
$lang = tlocal::i('options');
$args = targs::i();
foreach ($merger->items as $section => $items) {
$tab = new tuitabs();
$tab->add($lang->files, $html->getinput('editor', $section . '_files', tadminhtml::specchars(implode("\n", $items['files'])), $lang->files));
$tabtext = new tuitabs();
foreach ($items['texts'] as $key => $text) {
$tabtext->add($key, $html->getinput('editor', $section . '_text_' . $key, tadminhtml::specchars($text), $key));
}
$tab->add($lang->text, $tabtext->get());
$tabs->add($section, $tab->get());
}
$tabs->add('HTML', $html->getinput('editor', 'adminhtml_files', tadminhtml::specchars(implode("\n", $merger->html)), $lang->files));
$args->formtitle = $lang->optionslocal;
$args->dateformat = litepublisher::$options->dateformat;
$dirs = tfiler::getdir(litepublisher::$paths->languages);
$args->language = tadminhtml::array2combo(array_combine($dirs, $dirs), litepublisher::$options->language);
$zones = timezone_identifiers_list();
$args->timezone = tadminhtml::array2combo(array_combine($zones, $zones), litepublisher::$options->timezone);
return $html->adminform('[text=dateformat]
[combo=language]
[combo=timezone]' . $tabs->get(), $args);
}
开发者ID:laiello,项目名称:litepublisher,代码行数:28,代码来源:admin.localmerger.class.php
示例5: timezone
/**
* Constructor, given a file to open
*
*
**/
function timezone($file)
{
$this->tz_file = $file;
/* some safe default */
$this->next_update = time() + DAY_IN_SECONDS * 30;
$this->valid_names = timezone_identifiers_list();
}
开发者ID:BackupTheBerlios,项目名称:qsf-svn,代码行数:12,代码来源:timezone.php
示例6: __construct
public function __construct(array $options)
{
if (isset($options['value'])) {
if (!isset($options['interval'])) {
$options['interval'] = $options['value'];
}
unset($options['value']);
}
if (!isset($options['interval'])) {
throw new \InvalidArgumentException(sprintf('CronJob exception: Interval not found in @CronJob'));
}
try {
new \DateInterval($options['interval']);
} catch (\Exception $e) {
throw new \InvalidArgumentException(sprintf('CronJob exception: %s', $e->getMessage()));
}
if (!isset($options['start'])) {
$now = new \DateTime();
$options['start'] = $now->format('Y-m-d H:i:s');
}
if (!isset($options['timezone']) || !in_array($options['timezone'], timezone_identifiers_list())) {
$options['timezone'] = date_default_timezone_get();
}
foreach ($options as $key => $value) {
if (!property_exists($this, $key)) {
throw new \InvalidArgumentException(sprintf('CronJob exception: Property "%s" does not exist', $key));
}
$this->{$key} = $value;
}
}
开发者ID:qooplmao,项目名称:CronBundle,代码行数:30,代码来源:CronJob.php
示例7: form_fuseau_horaire
function form_fuseau_horaire($defaut)
{
if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
$all_timezones = timezone_identifiers_list();
$liste_fuseau = array();
$cities = array();
foreach ($all_timezones as $tz) {
$spos = strpos($tz, '/');
if ($spos !== FALSE) {
$continent = substr($tz, 0, $spos);
$city = substr($tz, $spos + 1);
$liste_fuseau[$continent][] = array('tz_name' => $tz, 'city' => $city);
}
if ($tz == 'UTC') {
$liste_fuseau['UTC'][] = array('tz_name' => 'UTC', 'city' => 'UTC');
}
}
$form = '<label>' . $GLOBALS['lang']['pref_fuseau_horaire'] . '</label>' . "\n";
$form .= '<select name="fuseau_horaire">' . "\n";
foreach ($liste_fuseau as $continent => $zone) {
$form .= "\t" . '<optgroup label="' . ucfirst(strtolower($continent)) . '">' . "\n";
foreach ($zone as $fuseau) {
$form .= "\t\t" . '<option value="' . htmlentities($fuseau['tz_name']) . '"';
$form .= $defaut == $fuseau['tz_name'] ? ' selected="selected"' : '';
$timeoffset = date_offset_get(date_create('now', timezone_open($fuseau['tz_name'])));
$formated_toffset = '(UTC' . ($timeoffset < 0 ? '–' : '+') . str2(floor(abs($timeoffset) / 3600)) . ':' . str2(floor(abs($timeoffset) % 3600 / 60)) . ') ';
$form .= '>' . $formated_toffset . ' ' . htmlentities($fuseau['city']) . '</option>' . "\n";
}
$form .= "\t" . '</optgroup>' . "\n";
}
$form .= '</select>' . "\n";
return $form;
}
}
开发者ID:wazari972,项目名称:blogotext,代码行数:34,代码来源:form.php
示例8: render
public function render($tpl = null)
{
//authenticate the current user to make sure they are an admin
UsersHelper::authenticateAdmin();
//display toolbar
$this->toolbar = new Toolbar();
$this->toolbar->save();
//document
$document = JFactory::getDocument();
$document->addScript(JURI::base() . "/src/Cobalt/media/js/cobalt-admin.js");
/* Menu Links **/
$menu = MenuHelper::getMenuModules();
$this->menu = $menu;
//get model
$model = new ConfigModel();
$layout = $this->getLayout();
$model->set("_layout", $layout);
//get config
$config = $model->getConfig();
//generate timezones
$list = timezone_identifiers_list();
$timezones = array();
foreach ($list as $zone) {
$timezones[$zone] = $zone;
}
//view references
$this->imap_found = function_exists('imap_open') ? TRUE : FALSE;
$this->config = $config;
$this->timezones = $timezones;
$this->time_formats = DateHelper::getTimeFormats();
$this->languages = ConfigHelper::getLanguages();
$this->language = ConfigHelper::getLanguage();
//display
return parent::render();
}
开发者ID:houzhenggang,项目名称:cobalt,代码行数:35,代码来源:Html.php
示例9: getSql
static function getSql($schema = 'Myisam')
{
if(!Piwik::isTimezoneSupportEnabled())
{
return array();
}
// @see http://bugs.php.net/46111
$timezones = timezone_identifiers_list();
$brokenTZ = array();
foreach ($timezones as $timezone) {
$testDate = "2008-08-19 13:00:00 " . $timezone;
if (!strtotime($testDate)) {
$brokenTZ[] = $timezone;
}
}
$timezoneList = '"'. implode('","', $brokenTZ) . '"';
return array(
'UPDATE '. Piwik_Common::prefixTable('site') .'
SET timezone = "UTC"
WHERE timezone IN ('. $timezoneList .')' => false,
'UPDATE `'. Piwik_Common::prefixTable('option') .'`
SET option_value = "UTC"
WHERE option_name = "SitesManager_DefaultTimezone"
AND option_value IN ('. $timezoneList .')' => false,
);
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:30,代码来源:0.9.1.php
示例10: timezonechoice
function timezonechoice($selectedzone)
{
$all = timezone_identifiers_list();
$i = 0;
foreach ($all as $zone) {
$zone = explode('/', $zone);
$zonen[$i]['continent'] = $zone[0];
$zonen[$i]['city'] = $zone[1];
$i++;
}
asort($zonen);
foreach ($zonen as $zone) {
extract($zone);
if ($continent == 'Africa' or $continent == 'America' or $continent == 'Antarctica' or $continent == 'Arctic' or $continent == 'Asia' or $continent == 'Atlantic' or $continent == 'Australia' or $continent == 'Europe' or $continent == 'Indian' or $continent == 'Pacific') {
if (!isset($letztercontinent)) {
$structure .= '
<optgroup label="' . $continent . '">';
} elseif ($letztercontinent != $continent) {
$structure .= '</optgroup>
<optgroup label="' . $continent . '">';
}
// continent
if ($city != '') {
$structure .= "\r\n<option " . ($continent . '/' . $city == $selectedzone ? 'selected="selected "' : '') . " value=\"" . ($continent . '/' . $city) . "\">" . str_replace('_', ' ', $city) . "</option>";
} else {
$structure .= "\r\n<option " . ($continent == $selectedzone ? 'selected="selected "' : '') . " value=\"" . $continent . "\">" . $continent . "</option>";
}
//Timezone
$letztercontinent = $continent;
}
}
$structure .= '
</optgroup>';
return $structure;
}
开发者ID:laiello,项目名称:mixexperiments,代码行数:35,代码来源:list.php
示例11: form
public function form()
{
$timezoneList = timezone_identifiers_list();
sort($timezoneList);
$timezoneList = array_combine($timezoneList, $timezoneList);
return array('elements' => array('login' => array('type' => 'text'), 'displayname' => array('type' => 'text'), 'email' => array('type' => 'text'), 'password' => array('type' => 'password', 'value' => '', 'hint' => !Yii::app()->user->isGuest ? Yii::t('cms', 'Enter your password only if you want to replace it') : ''), 'password_repeat' => array('type' => 'password'), 'active' => array('type' => 'checkbox'), 'captcha' => array('type' => 'text', 'label' => Yii::t('cms', 'Verify code') . Yii::app()->controller->widget("CCaptcha", array('captchaAction' => 'site/captcha', 'clickableImage' => true), true), 'hint' => Yii::t('cms', 'Enter the symbols from the image')), 'agreed' => array('type' => 'radio'), 'askfill' => array('type' => 'checkbox'), 'show_email' => array('type' => 'dropdownlist', 'items' => Role::builtInRoles()), 'send_message' => array('type' => 'dropdownlist', 'items' => Role::builtInRoles()), 'timezone' => array('type' => 'dropdownlist', 'items' => $timezoneList), 'extra_fields' => array('type' => 'Fields', 'config' => User::extraFields()), '_roles' => array('type' => 'Select2', 'related' => '_roles', 'showAttribute' => 'title')));
}
开发者ID:rosko,项目名称:Tempo-CMS,代码行数:7,代码来源:User.php
示例12: buildForm
public function buildForm(FormBuilderInterface $builder, array $options)
{
$timeZones = array();
array_walk(timezone_identifiers_list(), function ($timeZone) use(&$timeZones) {
$timeZoneGroup = strpos($timeZone, '/') !== false ? substr($timeZone, 0, strpos($timeZone, '/')) : $timeZone;
$value = strpos($timeZone, '/') !== false ? substr($timeZone, strpos($timeZone, '/') + 1) : $timeZone;
$value = str_replace('_', ' ', $value);
$value = str_replace('/', ' - ', $value);
$timeZones[$timeZoneGroup][$timeZone] = $value;
});
$availableCacheEngines = $options['cacheService']->getAvailableCacheEngines();
$availableTemplateCacheHandlers = \CampTemplateCache::availableHandlers();
$cacheEngines = array();
$cacheTemplate = array();
foreach ($availableCacheEngines as $cacheEngineName => $engineValue) {
$cacheEngines[$engineValue] = $cacheEngineName;
}
foreach ($availableTemplateCacheHandlers as $handler => $value) {
$cacheTemplate[$handler] = $handler;
}
$cacheLifetime = array();
foreach (array(0 => 'newscoop.preferences.label.disabled', 30 => '30 Seconds', 60 => '1 Minute', 300 => '5 Minutes', 900 => '15 Minutes', 1800 => '30 Minutes', 3600 => '1 Hour', 3600 * 24 => '1 Day', 3600 * 24 * 2 => '2 Days', 3600 * 24 * 3 => '3 Days', 3600 * 24 * 4 => '4 Days', 3600 * 24 * 5 => '5 Days', 3600 * 24 * 6 => '6 Days', 3600 * 24 * 7 => '1 Week', 3600 * 24 * 14 => '2 Weeks', 3600 * 24 * 21 => '3 Weeks', 3600 * 24 * 31 => '1 Month', 3600 * 24 * 61 => '2 Months', 3600 * 24 * 91 => '3 Months', 3600 * 24 * 183 => '6 Months', 3600 * 24 * 365 => '1 Year', -1 => 'Infinite') as $k => $v) {
$cacheLifetime[$k] = $v;
}
$language_codes_639_1 = \Language::Get6391List();
asort($language_codes_639_1);
$languages = array();
foreach ($language_codes_639_1 as $geo_lang_code => $geo_lang_name) {
$languages[$geo_lang_code] = $geo_lang_name;
}
$builder->add('siteonline', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('title', null, array('attr' => array('size' => '64'), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 100)))))->add('meta_keywords', null, array('attr' => array('size' => '64'), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 100)))))->add('meta_description', null, array('attr' => array('size' => '64'), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 100)))))->add('timezone', 'choice', array('choices' => $timeZones, 'placeholder' => 'newscoop.preferences.label.disabled', 'required' => false))->add('cache_engine', 'choice', array('choices' => $cacheEngines, 'placeholder' => 'Array', 'required' => false))->add('cache_engine_host', 'text', array('error_bubbling' => true, 'required' => false))->add('cache_engine_port', 'text', array('error_bubbling' => true, 'required' => false))->add('cache_template', 'choice', array('choices' => $cacheTemplate, 'placeholder' => 'newscoop.preferences.label.disabled', 'required' => false))->add('cache_image', 'choice', array('choices' => $cacheLifetime, 'constraints' => array(new Assert\NotBlank())))->add('allow_recovery', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('secret_key', null, array('attr' => array('size' => '64'), 'constraints' => array(new Assert\Length(array('max' => 32)))))->add('session_lifetime', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 86400)))))->add('separator', null, array('attr' => array('size' => '5'), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 2)))))->add('captcha', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 99)))))->add('max_upload_size', null, array('attr' => array('size' => '5'), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 12)))))->add('automatic_collection', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('smtp_host', null, array('attr' => array('size' => 64), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 100)))))->add('smtp_port', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 1, 'max' => 999999)))))->add('email_from', 'email', array('attr' => array('size' => 64), 'constraints' => array(new Assert\NotBlank(), new Assert\Email(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 100)))))->add('image_ratio', 'integer', array('attr' => array('max' => 100, 'min' => 1), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 1, 'max' => 100)))))->add('image_width', 'integer', array('constraints' => array(new Assert\Range(array('min' => 0, 'max' => 999999)))))->add('image_height', 'integer', array('constraints' => array(new Assert\Range(array('min' => 0, 'max' => 999999)))))->add('zoom', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('mediaRichTextCaptions', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('mediaCaptionLength', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999999)))))->add('use_replication', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('use_replication_host', null, array('attr' => array('size' => 30), 'constraints' => array(new Assert\Length(array('max' => 60)))))->add('use_replication_user', null, array('attr' => array('size' => 30), 'constraints' => array(new Assert\Length(array('max' => 20)))))->add('use_replication_password', null, array('attr' => array('size' => 30), 'constraints' => array(new Assert\Length(array('max' => 20)))))->add('use_replication_port', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999999)))))->add('template_filter', 'text', array('attr' => array('size' => 30), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 50)))))->add('mysql_client_command_path', 'text', array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('center_latitude_default', 'number', array('attr' => array('size' => 10), 'precision' => 6, 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'float')))))->add('center_longitude_default', 'number', array('attr' => array('size' => 10), 'precision' => 6, 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'float')))))->add('map_display_resolution_default', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 99)))))->add('map_view_width_default', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_view_height_default', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_auto_cSS_file', null, array('attr' => array('size' => 50), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 80)))))->add('map_auto_focus_default', 'checkbox')->add('map_auto_focus_max_zoom', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 18)))))->add('map_auto_focus_border', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => -99, 'max' => 999)))))->add('map_provider_available_google_v3', 'checkbox')->add('map_provider_available_map_quest', 'checkbox')->add('map_provider_available_oSM', 'checkbox')->add('map_provider_default', 'choice', array('choices' => array('GoogleV3' => 'Google Maps', 'MapQuest' => 'MapQuest Open', 'OSM' => 'OpenStreetMap'), 'constraints' => array(new Assert\NotBlank())))->add('geo_search_local_geonames', 'checkbox', array('required' => false))->add('geo_search_mapquest_nominatim', 'checkbox', array('required' => false))->add('geo_search_preferred_language', 'choice', array('choices' => $languages, 'constraints' => array(new Assert\NotBlank())))->add('map_marker_directory', null, array('attr' => array('size' => 50), 'constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'string')), new Assert\Length(array('max' => 80)))))->add('map_marker_source_default', null, array())->add('map_popup_width_min', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_popup_height_min', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_width_you_tube', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_height_you_tube', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_width_vimeo', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_height_vimeo', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_width_flash', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('map_video_height_flash', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 0, 'max' => 999)))))->add('geo_flash_server', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 80)))))->add('geo_flash_directory', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('facebook_appid', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('facebook_appsecret', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('recaptchaPublicKey', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('recaptchaPrivateKey', null, array('attr' => array('size' => 40), 'constraints' => array(new Assert\Length(array('max' => 200)))))->add('recaptchaSecure', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'data' => 'N', 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('userGarbageActive', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('userGarbageDays', 'integer', array('constraints' => array(new Assert\NotBlank(), new Assert\Type(array('type' => 'integer')), new Assert\Range(array('min' => 1, 'max' => 999)))))->add('smartyUseProtocol', 'choice', array('choices' => array('Y' => 'newscoop.preferences.label.yesoption', 'N' => 'newscoop.preferences.label.nooption'), 'multiple' => false, 'expanded' => true, 'constraints' => array(new Assert\NotBlank())))->add('cronJobNotificationEmail', 'email', array('attr' => array('size' => 64), 'constraints' => array(new Assert\NotBlank(), new Assert\Email(), new Assert\Length(array('max' => 255)))))->add('cronJobSmtpSender', 'email', array('attr' => array('size' => 64), 'constraints' => array(new Assert\Email(), new Assert\Length(array('max' => 255)))))->add('cronJobSmtpSenderName', null, array('attr' => array('size' => '64'), 'constraints' => array(new Assert\Length(array('max' => 100)))));
}
开发者ID:sourcefabric,项目名称:newscoop,代码行数:32,代码来源:PreferencesType.php
示例13: user_settings_submit
function user_settings_submit()
{
global $phpcid, $vars, $phpcdb, $phpc_user_tz, $phpc_user_lang, $phpc_prefix, $phpc_user, $phpc_script;
verify_token();
// If we have a timezone, make sure it's valid
if (!empty($vars["timezone"]) && !in_array($vars['timezone'], timezone_identifiers_list())) {
soft_error(__("Invalid timezone."));
}
// Expire 20 years in the future, give or take.
$expiration_time = time() + 20 * 365 * 24 * 60 * 60;
// One hour in the past
$past_time = time() - 3600;
if (!empty($vars["timezone"])) {
setcookie("{$phpc_prefix}tz", $vars['timezone'], $expiration_time);
} else {
setcookie("{$phpc_prefix}tz", '', $past_time);
}
if (!empty($vars["language"])) {
setcookie("{$phpc_prefix}lang", $vars['language'], $expiration_time);
} else {
setcookie("{$phpc_prefix}lang", '', $past_time);
}
if (is_user()) {
$uid = $phpc_user->get_uid();
$phpcdb->set_user_default_cid($uid, $vars['default_cid']);
$phpcdb->set_timezone($uid, $vars['timezone']);
$phpcdb->set_language($uid, $vars['language']);
$phpc_user_tz = $vars["timezone"];
$phpc_user_lang = $vars["language"];
}
return message_redirect(__('Settings updated.'), "{$phpc_script}?action=user_settings&phpcid={$phpcid}");
}
开发者ID:hubandbob,项目名称:php-calendar,代码行数:32,代码来源:user_settings_submit.php
示例14: getFromList
public function getFromList(&$list)
{
//$list = array();
if (!function_exists("timezone_identifiers_list")) {
return;
}
$zones = timezone_identifiers_list();
foreach ($zones as $zone) {
$zone = explode('/', $zone);
// 0 => Continent, 1 => City
// Only use "friendly" continent names
if ($zone[0] == 'Africa' || $zone[0] == 'America' || $zone[0] == 'Antarctica' || $zone[0] == 'Arctic' || $zone[0] == 'Asia' || $zone[0] == 'Atlantic' || $zone[0] == 'Australia' || $zone[0] == 'Europe' || $zone[0] == 'Indian' || $zone[0] == 'Pacific') {
if (isset($zone[1]) != '') {
$locations[$zone[0]][$zone[0] . '/' . $zone[1]] = str_replace('_', ' ', $zone[1]);
// Creates array(DateTimeZone => 'Friendly name')
}
}
}
$continent = $this->getContinent();
if ($continent) {
$continent_list = $locations[$continent];
} else {
$continent_list = $locations['Africa'];
}
foreach ($continent_list as $name => $value) {
array_push($list, array("val" => $name, "txt" => $name, "pic" => ""));
}
//return $list;
}
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:29,代码来源:TimezoneSelector.php
示例15: getDatabaseObject
/**
* Returns the database object.
*
* If none was created before, or if {link $newInstance} is true,
* creates a new database object first.
* In case of an error, the reference argument $errorMsg is set
* to the error message.
* @author Comvation Development Team <[email protected]>
* @access public
* @version 1.0.0
* @param string $errorMsg Error message
* @param boolean $newInstance Force new instance
* @global array Language array
* @global array Database configuration
* @global integer ADODB fetch mode
* @return boolean True on success, false on failure
*/
function getDatabaseObject(&$errorMsg, $newInstance = false)
{
global $_DBCONFIG, $ADODB_FETCH_MODE, $_CONFIG;
static $objDatabase;
if (is_object($objDatabase) && !$newInstance) {
return $objDatabase;
} else {
// open db connection
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$objDb = ADONewConnection($_DBCONFIG['dbType']);
@$objDb->Connect($_DBCONFIG['host'], $_DBCONFIG['user'], $_DBCONFIG['password'], $_DBCONFIG['database']);
$errorNo = $objDb->ErrorNo();
if ($errorNo != 0) {
if ($errorNo == 1049) {
$errorMsg = 'The database is unavailable';
} else {
$errorMsg = $objDb->ErrorMsg() . "<br />";
}
unset($objDb);
return false;
}
if (!empty($_CONFIG['timezone'])) {
if (!$objDb->Execute('SET TIME_ZONE="' . $_CONFIG['timezone'] . '"') && array_search($_CONFIG['timezone'], timezone_identifiers_list())) {
//calculate and set the timezone offset if the mysql timezone tables aren't loaded
$objDateTimeZone = new DateTimeZone($_CONFIG['timezone']);
$objDateTime = new DateTime('now', $objDateTimeZone);
$offset = $objDateTimeZone->getOffset($objDateTime);
$offsetHours = round(abs($offset) / 3600);
$offsetMinutes = round((abs($offset) - $offsetHours * 3600) / 60);
$offsetString = ($offset > 0 ? '+' : '-') . ($offsetHours < 10 ? '0' : '') . $offsetHours . ':' . ($offsetMinutes < 10 ? '0' : '') . $offsetMinutes;
$objDb->Execute('SET TIME_ZONE="' . $offsetString . '"');
}
}
// Disable STRICT_TRANS_TABLES mode:
$res = $objDb->Execute('SELECT @@sql_mode');
if ($res->EOF) {
$errorMsg = 'Database mode error';
return;
}
$sqlModes = explode(',', $res->fields['@@sql_mode']);
array_walk($sqlModes, 'trim');
if (($index = array_search('STRICT_TRANS_TABLES', $sqlModes)) !== false) {
unset($sqlModes[$index]);
}
$objDb->Execute('SET sql_mode = \'' . implode(',', $sqlModes) . '\'');
if (empty($_DBCONFIG['charset']) || $objDb->Execute('SET NAMES ' . $_DBCONFIG['charset']) && $objDb) {
if ($newInstance) {
return $objDb;
} else {
$objDatabase = $objDb;
return $objDb;
}
} else {
$errorMsg = 'Cannot connect to database server<i> (' . $objDb->ErrorMsg() . ')</i>';
unset($objDb);
}
return false;
}
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:76,代码来源:database.php
示例16: isValidTimeZone
protected function isValidTimeZone($timezone)
{
if (!is_null($timezone)) {
return in_array($timezone, timezone_identifiers_list());
} else {
return false;
}
}
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:8,代码来源:TimeZoneFix.php
示例17: index
public function index()
{
requireadmin();
$ipBlock = $this->siteinfo->config('blocked_ips');
$ipWhite = $this->siteinfo->config('allowed_ips');
$defaults = array('site_name' => $this->siteinfo->config('site_name'), 'site_address' => $this->siteinfo->config('site_address'), 'site_copy' => $this->siteinfo->config('site_copy'), 'site_email' => $this->siteinfo->config('site_email'), 'timezones' => timezone_identifiers_list(), 'site_tz' => $this->siteinfo->config('timezone'), 'ip_blocklist' => unserialize($ipBlock), 'ip_whitelist' => unserialize($ipWhite));
generate_json(array('status' => 1, 'defaults' => $defaults));
}
开发者ID:rodino25,项目名称:tsv2,代码行数:8,代码来源:Site_settings.php
示例18: getTimeZoneList
public function getTimeZoneList()
{
$locations = array();
$zones = timezone_identifiers_list();
foreach ($zones as $zone) {
$locations[] = array('value' => $zone, 'name' => str_replace('_', ' ', $zone));
}
return $locations;
}
开发者ID:nhom5UET,项目名称:tichhophethong,代码行数:9,代码来源:CombosData.php
示例19: getconf_TimeZone_Identifiers
function getconf_TimeZone_Identifiers($name)
{
$tlist = timezone_identifiers_list();
$result = array();
foreach ($tlist as $timezone) {
$result[] = array($timezone, $timezone);
}
return $result;
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:9,代码来源:index.php
示例20: validate
/**
* @inheritdoc
*/
public function validate($value, Context $context)
{
$identifiers = timezone_identifiers_list();
if (in_array($value, $identifiers)) {
return true;
}
$context->message_args['suggestion'] = $this->find_best_match($value, $identifiers);
return false;
}
开发者ID:ICanBoogie,项目名称:Validate,代码行数:12,代码来源:TimeZone.php
注:本文中的timezone_identifiers_list函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论