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


PHP UTIL_DateTime::getTimezones方法代碼示例

本文整理匯總了PHP中UTIL_DateTime::getTimezones方法的典型用法代碼示例。如果您正苦於以下問題:PHP UTIL_DateTime::getTimezones方法的具體用法?PHP UTIL_DateTime::getTimezones怎麽用?PHP UTIL_DateTime::getTimezones使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UTIL_DateTime的用法示例。


在下文中一共展示了UTIL_DateTime::getTimezones方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onPreferenceAddFormElement

 public function onPreferenceAddFormElement(BASE_CLASS_EventCollector $event)
 {
     $language = OW::getLanguage();
     $params = $event->getParams();
     $values = $params['values'];
     $fromElementList = array();
     $fromElement = new CheckboxField('mass_mailing_subscribe');
     $fromElement->setLabel($language->text('base', 'preference_mass_mailing_subscribe_label'));
     $fromElement->setDescription($language->text('base', 'preference_mass_mailing_subscribe_description'));
     if (isset($values['mass_mailing_subscribe'])) {
         $fromElement->setValue($values['mass_mailing_subscribe']);
     }
     $timeZoneSelect = new Selectbox("timeZoneSelect");
     $timeZoneSelect->setLabel($language->text('admin', 'timezone'));
     $timeZoneSelect->addOptions(UTIL_DateTime::getTimezones());
     $timeZoneSelect->setValue($values['timeZoneSelect']);
     $fromElementList[] = $timeZoneSelect;
     $fromElementList[] = $fromElement;
     $event->add($fromElementList);
 }
開發者ID:ZyXelP,項目名稱:oxwall,代碼行數:20,代碼來源:event_handler.php

示例2: __construct

 /**
  * Class constructor
  *
  */
 public function __construct()
 {
     parent::__construct('configSaveForm');
     $language = OW::getLanguage();
     $siteTitleField = new TextField('siteTitle');
     $siteTitleField->setRequired(true);
     $this->addElement($siteTitleField);
     $siteEmailField = new TextField('siteEmail');
     $siteEmailField->setRequired(true);
     $siteEmailField->addValidator(new EmailValidator());
     $this->addElement($siteEmailField);
     $taglineField = new TextField('tagline');
     $taglineField->setRequired(true);
     $this->addElement($taglineField);
     $descriptionField = new Textarea('description');
     $descriptionField->setRequired(true);
     $this->addElement($descriptionField);
     $dispalyCaptcha = new CheckboxField('enableCaptcha');
     $this->addElement($dispalyCaptcha);
     $timezoneField = new Selectbox('timezone');
     $timezoneField->setRequired(true);
     $timezoneField->setOptions(UTIL_DateTime::getTimezones());
     $this->addElement($timezoneField);
     $relativeTimeField = new CheckboxField('relativeTime');
     $this->addElement($relativeTimeField);
     $militaryTimeField = new CheckboxField('militaryTime');
     $this->addElement($militaryTimeField);
     // -- date format --
     $dateFieldFormat = new Selectbox("dateFieldFormat");
     $dateFieldFormat->setLabel($language->text('base', 'questions_config_date_field_format_label'));
     $dateFormatValue = OW::getConfig()->getValue('base', 'date_field_format');
     $dateFormatArray = array(BOL_QuestionService::DATE_FIELD_FORMAT_MONTH_DAY_YEAR, BOL_QuestionService::DATE_FIELD_FORMAT_DAY_MONTH_YEAR);
     $options = array();
     foreach ($dateFormatArray as $key) {
         $options[$key] = $language->text('base', 'questions_config_date_field_format_' . $key);
     }
     $dateFieldFormat->setOptions($options);
     $dateFieldFormat->setHasInvitation(false);
     $dateFieldFormat->setValue($dateFormatValue);
     $dateFieldFormat->setRequired();
     $this->addElement($dateFieldFormat);
     // -- date format --
     $currencyField = new Selectbox('currency');
     $currList = BOL_BillingService::getInstance()->getCurrencies();
     foreach ($currList as $key => $cur) {
         $currList[$key] = $key . ' (' . $cur . ')';
     }
     $currencyField->setOptions($currList);
     $currencyField->setLabel($language->text('admin', 'currency'));
     $currencyField->setRequired(true);
     $this->addElement($currencyField);
     //        $imagesAllowPicUpload = new CheckboxField('tf-allow-pic-upload');
     //
     //        $imagesAllowPicUpload->setLabel(OW::getLanguage()->text('base', 'tf_allow_pics'))
     //            ->setValue(OW::getConfig()->getValue('base', 'tf_allow_pic_upload'));
     //
     //        $this->addElement($imagesAllowPicUpload);
     //
     //        $imageMaxSizeField = new TextField('tf-max-image-size');
     //
     //        $imageMaxSizeField->setValue(OW::getConfig()->getValue('base', 'tf_max_pic_size'))
     //            ->setLabel(OW::getLanguage()->text('base', 'tf_max_img_size'))
     //            ->addValidator(new IntValidator())->setRequired();
     //
     //        $this->addElement($imageMaxSizeField);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'save_btn_label'));
     $this->addElement($submit);
 }
開發者ID:ZyXelP,項目名稱:oxwall,代碼行數:74,代碼來源:settings.php


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