当前位置: 首页>>代码示例>>PHP>>正文


PHP iaUtil::getFormattedTimezones方法代码示例

本文整理汇总了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;
 }
开发者ID:kamilklkn,项目名称:subrion,代码行数:55,代码来源:configuration.php

示例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);
 }
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:88,代码来源:configuration.php


注:本文中的iaUtil::getFormattedTimezones方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。