本文整理汇总了PHP中DateUtil::getTimezones方法的典型用法代码示例。如果您正苦于以下问题:PHP DateUtil::getTimezones方法的具体用法?PHP DateUtil::getTimezones怎么用?PHP DateUtil::getTimezones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateUtil
的用法示例。
在下文中一共展示了DateUtil::getTimezones方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_timezoneselect
/**
* Template plugin to display timezone list.
*
* Example {timezoneselect selected='Timezone'}.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_View $view The Zikula_View.
*
* @see function.timezoneselect.php::smarty_function_timezoneselect().
*
* @return string The results of the module function.
*/
function smarty_function_timezoneselect($params, Zikula_View $view)
{
require_once $view->_get_plugin_filepath('function', 'html_options');
$timezones = DateUtil::getTimezones();
if (!isset($params['selected']) || empty($params['selected']) || !isset($timezones[$params['selected']])) {
$params['selected'] = System::getVar('timezone_offset');
}
return smarty_function_html_options(array('options' => $timezones, 'selected' => $params['selected'], 'print_result' => false), $view);
}
示例2: smarty_function_duditemmodify
//.........这里部分代码省略.........
$isRegistration = UserUtil::isRegistration($uid);
$uservalue = UserUtil::getVar($item['prop_attribute_name'], $uid, false, $isRegistration); // ($alias, $uid);
}
// try to get the DUD output if it's Third Party
if ($item['prop_dtype'] != 1) {
$output = ModUtil::apiFunc($item['prop_modname'], 'dud', 'edit',
array('item' => $item,
'uservalue' => $uservalue,
'class' => $class));
if ($output) {
return $output;
}
}
$render = $smarty;//Zikula_View::getInstance('Profile', false, null, true);
// assign the default values for the control
$render->assign('class', $class);
$render->assign('value', DataUtil::formatForDisplay($uservalue));
$render->assign('attributename', $item['prop_attribute_name']);
$render->assign('proplabeltext', $item['prop_label']);
$render->assign('note', $item['prop_note']);
$render->assign('required', (bool)$item['prop_required']);
$render->assign('error', isset($error) ? $error : '');
// Excluding Timezone of the generics
if ($item['prop_attribute_name'] == 'tzoffset') {
if (empty($uservalue)) {
$uservalue = UserUtil::getVar('tzoffset') ? UserUtil::getVar('tzoffset') : System::getVar('timezone_offset');
}
$tzinfo = DateUtil::getTimezones();
$render->assign('value', isset($tzinfo["$uservalue"]) ? "$uservalue" : null);
$render->assign('selectmultiple', '');
$render->assign('listoptions', array_keys($tzinfo));
$render->assign('listoutput', array_values($tzinfo));
return $render->fetch('profile_dudedit_select.tpl');
}
if ($item['prop_attribute_name'] == 'avatar') {
// detect if it's the registration form to skip this
if ($onregistrationform) {
return '';
}
// only shows a link to the Avatar module if available
if (ModUtil::available('Avatar')) {
// TODO Add a change-link to the admins
// only shows the link for the own user
if (UserUtil::getVar('uid') != $uid) {
return '';
}
$render->assign('linktext', __('Go to the Avatar manager', $dom));
$render->assign('linkurl', ModUtil::url('Avatar', 'user', 'main'));
$output = $render->fetch('profile_dudedit_link.tpl');
// add a hidden input if this is required
if ($item['prop_required']) {
$output .= $render->fetch('profile_dudedit_hidden.tpl');
}
return $output;
}