本文整理汇总了PHP中cmsCore::getTimeZonesOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::getTimeZonesOptions方法的具体用法?PHP cmsCore::getTimeZonesOptions怎么用?PHP cmsCore::getTimeZonesOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::getTimeZonesOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applet_config
function applet_config()
{
// получаем оригинальный конфиг
$config = cmsConfig::getDefaultConfig();
global $_LANG;
global $adminAccess;
if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
cpAccessDenied();
}
cmsCore::c('page')->setTitle($_LANG['AD_SITE_SETTING']);
cpAddPathway($_LANG['AD_SITE_SETTING'], 'index.php?view=config');
$do = cmsCore::request('do', 'str', 'list');
if ($do == 'save') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
$newCFG = cmsCore::getArrayFromRequest(array('scheme' => array('scheme', array('http', 'https'), ''), 'sitename' => array('sitename', 'str', ''), 'title_and_sitename' => array('title_and_sitename', 'int', 0), 'title_and_page' => array('title_and_page', 'int', 0), 'hometitle' => array('hometitle', 'str', ''), 'homecom' => array('homecom', 'str', ''), 'com_without_name_in_url' => array('com_without_name_in_url', 'str', ''), 'siteoff' => array('siteoff', 'int', 0), 'only_authorized' => array('only_authorized', 'int', 0), 'debug' => array('debug', 'int', 0), 'offtext' => array('offtext', 'str', ''), 'keywords' => array('keywords', 'str', ''), 'metadesc' => array('metadesc', 'str', ''), 'seourl' => array('seourl', 'int', 0), 'lang' => array('lang', 'str', 'ru'), 'is_change_lang' => array('is_change_lang', 'int', 0), 'sitemail' => array('sitemail', 'str', ''), 'sitemail_name' => array('sitemail_name', 'str', ''), 'wmark' => array('wmark', 'str', ''), 'template' => array('template', 'str', ''), 'admin_template' => array('admin_template', 'str', ''), 'cache' => array('cache', 'int', 0), 'cache_type' => array('cache_type', array('file', 'memcached'), ''), 'memcached_host' => array('memcached_host', 'str', ''), 'memcached_port' => array('memcached_port', 'int', 0), 'combine_css_enable' => array('combine_css_enable', 'int', 0), 'combine_css' => array('combine_css', 'html', ''), 'combine_js_enable' => array('combine_js_enable', 'int', 0), 'combine_js' => array('combine_js', 'html', ''), 'splash' => array('splash', 'int', 0), 'slight' => array('slight', 'int', 0), 'show_pw' => array('show_pw', 'int', 0), 'last_item_pw' => array('last_item_pw', 'int', 0), 'index_pw' => array('index_pw', 'int', 0), 'fastcfg' => array('fastcfg', 'int', 0), 'mailer' => array('mailer', 'str', ''), 'smtpsecure' => array('smtpsecure', 'str', ''), 'smtpauth' => array('smtpauth', 'int', 0), 'smtpuser' => array('smtpuser', 'str', $config['smtpuser']), 'smtppass' => array('smtppass', 'str', $config['smtppass']), 'smtphost' => array('smtphost', 'str', ''), 'smtpport' => array('smtpport', 'int', '25'), 'timezone' => array('timezone', 'str', $config['timezone']), 'user_stats' => array('user_stats', 'int', 0), 'seo_url_count' => array('seo_url_count', 'int', 0), 'max_pagebar_links' => array('max_pagebar_links', 'int', 0), 'allow_ip' => array('allow_ip', 'str', ''), 'iframe_enable' => array('iframe_enable', 'int', 0), 'vk_enable' => array('vk_enable', 'int', 0), 'vk_id' => array('vk_id', 'str', ''), 'vk_private_key' => array('vk_private_key', 'str', '')));
$newCFG['sitename'] = stripslashes($newCFG['sitename']);
$newCFG['hometitle'] = stripslashes($newCFG['hometitle']);
$newCFG['offtext'] = htmlspecialchars($newCFG['offtext'], ENT_QUOTES);
$newCFG['db_host'] = $config['db_host'];
$newCFG['db_base'] = $config['db_base'];
$newCFG['db_user'] = $config['db_user'];
$newCFG['db_pass'] = $config['db_pass'];
$newCFG['db_prefix'] = $config['db_prefix'];
if (cmsConfig::saveToFile($newCFG)) {
cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
} else {
cmsCore::addSessionMessage($_LANG['AD_CONFIG_SITE_ERROR'], 'error');
}
cmsCore::clearCache();
cmsCore::redirect('index.php?view=config');
}
cpCheckWritable('/includes/config/config.inc.json');
$result = cmsCore::c('db')->query("SELECT (sum(data_length)+sum(index_length))/1024/1024 as size FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '" . $config['db_base'] . "'", true);
if (!cmsCore::c('db')->error()) {
$s = cmsCore::c('db')->fetch_assoc($result);
} else {
$s['size'] = 0;
}
cmsCore::c('page')->initTemplate('applets', 'config')->assign('config', $config)->assign('timezone_opt', cmsCore::getTimeZonesOptions($config['timezone']))->assign('admin_templates', cmsCore::getDirsList('/templates/admin'))->assign('templates', cmsCore::getDirsList('/templates'))->assign('tpl_info', cmsCore::c('page')->getTplInfo(cmsCore::c('page')->template))->assign('components_opt', cmsCore::getListItems('cms_components', $config['com_without_name_in_url'], 'title', 'ASC', 'internal=0', 'link'))->assign('homecom_opt', cmsCore::getListItems('cms_components', $config['homecom'], 'title', 'ASC', 'internal=0', 'link'))->assign('langs', cmsCore::getDirsList('/languages'))->assign('db_size', round($s['size'], 2))->display();
}
示例2: users
//.........这里部分代码省略.........
$usr = $model->getUser($id);
if (!$usr) {
cmsCore::error404();
}
$opt = cmsCore::request('opt', 'str', 'edit');
// главного админа может редактировать только он сам
if ($id == 1 && $inUser->id != $id) {
cmsCore::error404();
}
// показываем форму
if ($opt == 'edit') {
$inPage->setTitle($_LANG['CONFIG_PROFILE'].' - '.$usr['nickname']);
$inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login']));
$inPage->addPathway($_LANG['CONFIG_PROFILE']);
$private_forms = array();
if (isset($model->config['privforms'])) {
if (is_array($model->config['privforms'])) {
foreach ($model->config['privforms'] as $form_id) {
$private_forms = array_merge($private_forms, cmsForm::getFieldsHtml($form_id, $usr['formsdata']));
}
}
}
cmsPage::initTemplate('components', 'com_users_edit_profile')->
assign('opt', $opt)->
assign('usr', $usr)->
assign('private_forms', $private_forms)->
assign('cfg_forum', $inCore->loadComponentConfig('forum'))->
assign('cfg', $model->config)->
assign('timezones_opt', cmsCore::getTimeZonesOptions(!empty($usr['timezone']) ? $usr['timezone'] : cmsCore::c('config')->timezone))->
display();
return;
}
// Если сохраняем профиль
if ($opt == 'save'){
$errors = false;
$users['nickname'] = cmsCore::request('nickname', 'str');
$users['timezone'] = cmsCore::request('timezone', cmsCore::getTimeZones(), cmsCore::c('config')->timezone);
if (mb_strlen($users['nickname'])<2) { cmsCore::addSessionMessage($_LANG['SHORT_NICKNAME'], 'error'); $errors = true; }
cmsCore::loadModel('registration');
$modreg = new cms_model_registration();
if (!$inUser->is_admin){
if($modreg->getBadNickname($users['nickname'])) { cmsCore::addSessionMessage($_LANG['ERR_NICK_EXISTS'], 'error'); $errors = true; }
}
$profiles['gender'] = cmsCore::request('gender', 'str');
$profiles['city'] = cmsCore::request('city', 'str');
if (mb_strlen($profiles['city'])>50) { cmsCore::addSessionMessage($_LANG['LONG_CITY_NAME'], 'error'); $errors = true; }
$users['email'] = cmsCore::request('email', 'email');
if (!$users['email']) { cmsCore::addSessionMessage($_LANG['REALY_ADRESS_EMAIL'], 'error'); $errors = true; }
if($usr['email'] != $users['email']){
$is_set_email = $inDB->get_field('cms_users', "email='{$users['email']}'", 'id');
if ($is_set_email) {
cmsCore::addSessionMessage($_LANG['ADRESS_EMAIL_IS_BUSY'], 'error'); $errors = true;
}else{
// формируем токен
示例3: applet_config
//.........这里部分代码省略.........
?>
<form class="form-horizontal" role="form" action="/admin/index.php?view=config" method="post" name="CFGform" target="_self" id="CFGform" style="margin-bottom:30px">
<input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
<div class="uitabs">
<ul id="tabs">
<li><a href="#basic"><span><?php echo $_LANG['AD_SITE']; ?></span></a></li>
<li><a href="#home"><span><?php echo $_LANG['AD_MAIN']; ?></span></a></li>
<li><a href="#cache"><span><?php echo $_LANG['AD_CACHE']; ?></span></a></li>
<li><a href="#database"><span><?php echo $_LANG['AD_DB'] ; ?></span></a></li>
<li><a href="#mail"><span><?php echo $_LANG['AD_POST']; ?></span></a></li>
<li><a href="#other"><span><?php echo $_LANG['AD_PATHWAY']; ?></span></a></li>
<li><a href="#seq"><span><?php echo $_LANG['AD_SECURITY']; ?></span></a></li>
<li><a href="#soc_apps"><span><?php echo $_LANG['AD_SOC_APPS']; ?></span></a></li>
</ul>
<div id="basic">
<div style="width:750px;">
<div class="form-group">
<label class="col-sm-5 control-label"><?php echo $_LANG['AD_SCHEME_TYPE']; ?></label>
<div class="col-sm-7">
<select id="scheme" class="form-control" name="scheme">
<option value=""><?php echo $_LANG['AD_SCHEME_ANY']; ?></option>
<option value="http" <?php if ($config['scheme'] == 'http') { echo 'selected="selected"'; } ?>><?php echo $_LANG['AD_SCHEME_http']; ?></option>
<option value="https" <?php if ($config['scheme'] == 'https') { echo 'selected="selected"'; } ?>><?php echo $_LANG['AD_SCHEME_https']; ?></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label"><?php echo $_LANG['AD_TIME_ARREA']; ?></label>
<div class="col-sm-7">
<select id="timezone" class="form-control" name="timezone">
<?php echo cmsCore::getTimeZonesOptions($config['timezone']); ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label"><?php echo $_LANG['AD_SITENAME']; ?></label>
<div class="col-sm-7">
<input type="text" class="form-control" name="sitename" value="<?php echo htmlspecialchars($config['sitename']);?>" />
<div class="help-block"><?php echo $_LANG['AD_USE_HEADER']; ?></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label"><?php echo $_LANG['TEMPLATE']; ?></label>
<div class="col-sm-7">
<select id="template" class="form-control" name="template" onchange="document.CFGform.submit();">
<?php
$templates = cmsCore::getDirsList('/templates');
foreach ($templates as $template) {
if ($template == 'admin') { continue; }
echo '<option value="'. $template .'" '. ($config['template'] == $template ? 'selected="selected"' : '') .'>'. $template .'</option>';
}
$tpl_info = cmsCore::c('page')->getCurrentTplInfo();
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label"><?php echo $_LANG['AD_SEARCH_RESULT']; ?></label>
<div class="col-sm-7 btn-group" data-toggle="buttons">