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


PHP Tinebase_DateTime::addMinute方法代码示例

本文整理汇总了PHP中Tinebase_DateTime::addMinute方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_DateTime::addMinute方法的具体用法?PHP Tinebase_DateTime::addMinute怎么用?PHP Tinebase_DateTime::addMinute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tinebase_DateTime的用法示例。


在下文中一共展示了Tinebase_DateTime::addMinute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getApplicationPreferenceDefaults

 /**
  * get preference defaults if no default is found in the database
  *
  * @param string $_preferenceName
  * @param string|Tinebase_Model_User $_accountId
  * @param string $_accountType
  * @return Tinebase_Model_Preference
  */
 public function getApplicationPreferenceDefaults($_preferenceName, $_accountId = NULL, $_accountType = Tinebase_Acl_Rights::ACCOUNT_TYPE_USER)
 {
     $preference = $this->_getDefaultBasePreference($_preferenceName);
     switch ($_preferenceName) {
         case self::DAYSVIEW_STARTTIME:
             $doc = new DomDocument('1.0');
             $options = $doc->createElement('options');
             $doc->appendChild($options);
             $time = new Tinebase_DateTime('@0');
             for ($i = 0; $i < 48; $i++) {
                 $time->addMinute($i ? 30 : 0);
                 $timeString = $time->format('H:i');
                 $value = $doc->createElement('value');
                 $value->appendChild($doc->createTextNode($timeString));
                 $label = $doc->createElement('label');
                 $label->appendChild($doc->createTextNode($timeString));
                 // @todo l10n
                 $option = $doc->createElement('option');
                 $option->appendChild($value);
                 $option->appendChild($label);
                 $options->appendChild($option);
             }
             $preference->value = '08:00';
             $preference->options = $doc->saveXML();
             break;
         case self::DEFAULTCALENDAR:
             $this->_getDefaultContainerPreferenceDefaults($preference, $_accountId);
             break;
         case self::DEFAULTPERSISTENTFILTER:
             $preference->value = Tinebase_PersistentFilter::getPreferenceValues('Calendar', $_accountId, "All my events");
             break;
         case self::NOTIFICATION_LEVEL:
             $translate = Tinebase_Translation::getTranslation($this->_application);
             // need to put the translations strings here because they were not found in the xml below :/
             // _('Never') _('On invitation and cancellation only') _('On time changes') _('On all updates but attendee responses') _('On attendee responses too')
             $preference->value = Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_RESCHEDULE;
             $preference->options = '<?xml version="1.0" encoding="UTF-8"?>
                 <options>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_NONE . '</value>
                         <label>' . $translate->_('Never') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_INVITE_CANCEL . '</value>
                         <label>' . $translate->_('On invitation and cancellation only') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_RESCHEDULE . '</value>
                         <label>' . $translate->_('On time changes') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_EVENT_UPDATE . '</value>
                         <label>' . $translate->_('On all updates but attendee responses') . '</label>
                     </option>
                     <option>
                         <value>' . Calendar_Controller_EventNotifications::NOTIFICATION_LEVEL_ATTENDEE_STATUS_UPDATE . '</value>
                         <label>' . $translate->_('On attendee responses too') . '</label>
                     </option>
                 </options>';
             break;
         case self::SEND_NOTIFICATION_OF_OWN_ACTIONS:
             $preference->value = 0;
             $preference->options = '<?xml version="1.0" encoding="UTF-8"?>
                 <options>
                     <special>' . Tinebase_Preference_Abstract::YES_NO_OPTIONS . '</special>
                 </options>';
             break;
         default:
             throw new Tinebase_Exception_NotFound('Default preference with name ' . $_preferenceName . ' not found.');
     }
     return $preference;
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:80,代码来源:Preference.php


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