當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CTimeHelper::getBeautifyTimezoneList方法代碼示例

本文整理匯總了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');
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:48,代碼來源:view.html.php


注:本文中的CTimeHelper::getBeautifyTimezoneList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。