本文整理汇总了PHP中CTimeHelper::getBeautifyTimezoneList方法的典型用法代码示例。如果您正苦于以下问题:PHP CTimeHelper::getBeautifyTimezoneList方法的具体用法?PHP CTimeHelper::getBeautifyTimezoneList怎么用?PHP CTimeHelper::getBeautifyTimezoneList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTimeHelper
的用法示例。
在下文中一共展示了CTimeHelper::getBeautifyTimezoneList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _displayForm
/**
* Method to display the create / edit event's form.
* Both views share the same template file.
* */
public function _displayForm($event)
{
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
$my = CFactory::getUser();
$config = CFactory::getConfig();
$model = CFactory::getModel('events');
$categories = $model->getCategories();
$now = JFactory::getDate();
$groupid = $jinput->get('groupid', '', 'INT');
//J1.6 returns timezone as string, not integer offset.
$systemOffset = new JDate('now', $mainframe->getCfg('offset'));
$systemOffset = $systemOffset->getOffsetFromGMT(true);
$editorType = $config->get('allowhtml') ? $config->get('htmleditor', 'none') : 'none';
$editor = new CEditor($editorType);
$totalEventCount = $model->getEventsCreationCount($my->id);
if ($event->catid == null) {
$event->catid = JRequest::getInt('categoryid', 0);
}
$event->startdatetime = $jinput->post->get('startdatetime', '00:01', 'NONE');
$event->enddatetime = $jinput->post->get('enddatetime', '23:59', 'NONE');
$timezones = CTimeHelper::getBeautifyTimezoneList();
$helper = CEventHelper::getHandler($event);
$startDate = $event->getStartDate(false);
$endDate = $event->getEndDate(false);
$repeatEndDate = $event->getRepeatEndDate();
$dateSelection = CEventHelper::getDateSelection($startDate, $endDate);
// Load category tree
$cTree = CCategoryHelper::getCategories($categories);
$lists['categoryid'] = CCategoryHelper::getSelectList('events', $cTree, $event->catid, true);
$app = CAppPlugins::getInstance();
$appFields = $app->triggerEvent('onFormDisplay', array('createEvent'));
$beforeFormDisplay = CFormElement::renderElements($appFields, 'before');
$afterFormDisplay = CFormElement::renderElements($appFields, 'after');
//to invite group members if this event creation belongs to a group and members is more than 1
$showGroupMemberInvitation = false;
if ($groupid) {
$group = JTable::getInstance('Group', 'CTable');
$group->load($groupid);
$showGroupMemberInvitation = $group->getMembersCount() > 1 ? true : false;
}
$tmpl = new CTemplate();
echo $tmpl->set('startDate', $startDate)->set('showGroupMemberInvitation', $showGroupMemberInvitation)->set('endDate', $endDate)->set('enableRepeat', $my->authorise('community.view', 'events.repeat'))->set('repeatEndDate', $repeatEndDate)->set('startHourSelect', $dateSelection->startHour)->set('endHourSelect', $dateSelection->endHour)->set('startMinSelect', $dateSelection->startMin)->set('endMinSelect', $dateSelection->endMin)->set('startAmPmSelect', $dateSelection->startAmPm)->set('endAmPmSelect', $dateSelection->endAmPm)->set('timezones', $timezones)->set('params', new CParameter($event->params))->set('config', $config)->set('systemOffset', $systemOffset)->set('lists', $lists)->set('categories', $categories)->set('event', $event)->set('editor', $editor)->set('helper', $helper)->set('now', $now->format('%Y-%m-%d'))->set('eventCreated', $totalEventCount)->set('eventcreatelimit', $config->get('eventcreatelimit'))->set('beforeFormDisplay', $beforeFormDisplay)->set('afterFormDisplay', $afterFormDisplay)->fetch('events.forms');
}