本文整理汇总了PHP中iaUtil::getFormattedTimezones方法的典型用法代码示例。如果您正苦于以下问题:PHP iaUtil::getFormattedTimezones方法的具体用法?PHP iaUtil::getFormattedTimezones怎么用?PHP iaUtil::getFormattedTimezones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaUtil
的用法示例。
在下文中一共展示了iaUtil::getFormattedTimezones方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getParams
private function _getParams($groupName)
{
$where = "`config_group` = '{$groupName}' AND `type` != 'hidden' " . ($this->_type ? 'AND `custom` = 1' : '') . ' ORDER BY `order`';
$params = $this->_iaDb->all(iaDb::ALL_COLUMNS_SELECTION, $where, null, null, iaCore::getConfigTable());
if ($this->_type) {
$custom = 'user' == $this->_type ? $this->_iaCore->getCustomConfig($this->_typeId) : $this->_iaCore->getCustomConfig(null, $this->_typeId);
$custom2 = 'user' == $this->_type ? $this->_getUsersSpecificConfig() : array();
}
$iaItem = $this->_iaCore->factory('item');
$itemsList = $iaItem->getItems();
foreach ($params as &$entry) {
$className = 'default';
if ($this->_type) {
$className = 'custom';
if (self::TYPE_DIVIDER != $entry['type']) {
if (isset($custom2[$entry['name']])) {
$entry['default'] = $custom2[$entry['name']];
$entry['value'] = $custom2[$entry['name']];
} else {
$entry['default'] = $this->_iaCore->get($entry['name']);
}
if (isset($custom[$entry['name']])) {
$className = 'common';
$entry['value'] = $custom[$entry['name']];
}
}
}
if ('itemscheckbox' == $entry['type']) {
$array = $this->_iaCore->get($entry['extras'] . '_items_implemented');
$array = $array ? explode(',', $array) : array();
$array = array_values(array_intersect($array, $itemsList));
if ($array) {
$enabledItems = $iaItem->getEnabledItemsForPlugin($entry['extras']);
for ($i = 0; $i < count($array); $i++) {
$array[$i] = trim($array[$i]);
$entry['items'][] = array('name' => $array[$i], 'title' => iaLanguage::get($array[$i]), 'checked' => (int) in_array($array[$i], $enabledItems));
}
}
}
if (self::TYPE_SELECT == $entry['type']) {
switch ($entry['name']) {
case 'timezone':
$entry['values'] = iaUtil::getFormattedTimezones();
break;
case 'lang':
$entry['values'] = $this->_iaCore->languages;
break;
default:
$entry['values'] = explode(',', $entry['multiple_values']);
}
}
$entry['class'] = $className;
}
return $params;
}
示例2: _indexPage
protected function _indexPage(&$iaView)
{
$type = null;
$customEntryId = false;
if (isset($_GET['group'])) {
$type = 'group';
$customEntryId = (int) $_GET['group'];
iaBreadcrumb::preEnd(iaLanguage::get('usergroups'), IA_ADMIN_URL . 'usergroups/');
} elseif (isset($_GET['user'])) {
$type = 'user';
$customEntryId = (int) $_GET['user'];
iaBreadcrumb::preEnd(iaLanguage::get('members'), IA_ADMIN_URL . 'members/');
}
if (isset($_POST['save'])) {
$this->_save($iaView, $type, $customEntryId);
}
$iaItem = $this->_iaCore->factory('item');
$groupName = isset($this->_iaCore->requestPath[0]) ? $this->_iaCore->requestPath[0] : 'general';
$groupData = $this->_iaDb->row_bind(iaDb::ALL_COLUMNS_SELECTION, '`name` = :name', array('name' => $groupName), iaCore::getConfigGroupsTable());
if (empty($groupData)) {
return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
$this->_setGroup($iaView, $iaItem, $groupData);
$where = "`config_group` = '{$groupName}' AND `type` != 'hidden' " . ($type ? 'AND `custom` = 1' : '') . ' ORDER BY `order`';
$params = $this->_iaDb->all(iaDb::ALL_COLUMNS_SELECTION, $where, null, null, iaCore::getConfigTable());
if ($type) {
$custom = 'user' == $type ? $this->_iaCore->getCustomConfig($customEntryId) : $this->_iaCore->getCustomConfig(false, $customEntryId);
$custom2 = array();
if ('user' == $type) {
$custom2 = $this->_iaDb->getKeyValue('SELECT d.`name`, d.`value` ' . "FROM `{$this->_iaCore->iaDb->prefix}config_custom` d, `{$this->_iaCore->iaDb->prefix}members` a " . "WHERE d.`type` = 'group' AND d.`type_id` = a.`usergroup_id` AND a.`id` = '{$customEntryId}'");
}
}
$itemsList = $iaItem->getItems();
foreach ($params as $index => $item) {
$className = 'default';
if ($type) {
$className = 'custom';
if (self::TYPE_DIVIDER != $item['type']) {
if (isset($custom2[$item['name']])) {
$params[$index]['dtype'] = 'usergroup';
$params[$index]['default'] = $custom2[$item['name']];
$params[$index]['value'] = $custom2[$item['name']];
} else {
$params[$index]['dtype'] = 'core';
$params[$index]['default'] = $this->_iaCore->get($item['name']);
}
if (isset($custom[$item['name']])) {
$className = 'common';
$params[$index]['value'] = $custom[$item['name']];
}
}
}
if ('itemscheckbox' == $item['type']) {
$array = $this->_iaCore->get($item['extras'] . '_items_implemented');
$array = $array ? explode(',', $array) : array();
$array = array_values(array_intersect($array, $itemsList));
if ($array) {
$enabledItems = $iaItem->getEnabledItemsForPlugin($item['extras']);
for ($i = 0; $i < count($array); $i++) {
$array[$i] = trim($array[$i]);
$params[$index]['items'][] = array('name' => $array[$i], 'title' => iaLanguage::get($array[$i]), 'checked' => (int) in_array($array[$i], $enabledItems));
}
}
}
if ('select' == $item['type']) {
switch ($item['name']) {
case 'timezone':
$params[$index]['values'] = iaUtil::getFormattedTimezones();
break;
case 'lang':
$params[$index]['values'] = $this->_iaCore->languages;
break;
default:
$params[$index]['values'] = explode(',', $item['multiple_values']);
}
}
$params[$index]['classname'] = $className;
}
$customUrl = '';
if ($type) {
$customUrl = isset($_GET['user']) ? '?user=' . $_GET['user'] : '?group=' . $_GET['group'];
$customUrl = iaSanitize::html($customUrl);
}
$iaView->assign('group', $groupData);
$iaView->assign('params', $params);
$iaView->assign('tooltips', iaLanguage::getTooltips());
$iaView->assign('url_custom', $customUrl);
}