本文整理汇总了PHP中Horde_Date::strftime方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Date::strftime方法的具体用法?PHP Horde_Date::strftime怎么用?PHP Horde_Date::strftime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Date
的用法示例。
在下文中一共展示了Horde_Date::strftime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTile
/**
* Outputs the html for a DateGallery tile.
*
* @param Ansel_Gallery_Decorator_Date $dgallery The Ansel_Gallery_Date we are
* displaying.
* @param Ansel_Style $style A style object.
* @param boolean $mini Force the use of a mini thumbail?
* @param array $params An array containing additional parameters.
* Currently, gallery_view_url and image_view_url
* are used to override the respective urls.
* %g and %i are replaced with image id and
* gallery id, respectively.
*
* @return string The HTML for the tile.
*/
public function getTile(Ansel_Gallery_Decorator_Date $dgallery, Ansel_Style $style = null, $mini = false, array $params = array())
{
$view = $GLOBALS['injector']->createInstance('Horde_View');
$view->addTemplatePath(ANSEL_TEMPLATES . '/tile');
// User's preferred date format
$date_format = $GLOBALS['prefs']->getValue('date_format');
$date_array = $dgallery->getDate();
if (empty($date_array['month'])) {
$date_array['month'] = 1;
}
if (empty($date_array['day'])) {
$date_array['day'] = 1;
}
$full_date = new Horde_Date($date_array);
// Need the unaltered date part array
$date_array = $dgallery->getDate();
// Figure out the needed link for the next drill down level. We *must*
// have at least a year since we are in a date tile.
if (empty($date_array['month'])) {
// unit == year
$view->caption = $full_date->strftime('%Y');
$next_date = array('year' => (int) $view->caption);
} elseif (empty($date_array['day'])) {
// unit == month
$view->caption = $full_date->strftime('%B %Y');
$next_date = array('year' => date('Y', $full_date->timestamp()), 'month' => date('n', $full_date->timestamp()));
} else {
// unit == day
$view->caption = $full_date->strftime($date_format);
$next_date = array('year' => date('Y', $full_date->timestamp()), 'month' => date('n', $full_date->timestamp()), 'day' => date('j', $full_date->timestamp()));
}
// Check permissions on the gallery and get appropriate tile image
if ($dgallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
if (is_null($style)) {
$style = $dgallery->getStyle();
}
$thumbstyle = $mini ? 'mini' : 'thumb';
$view->gallery_image = Ansel::getImageUrl($dgallery->getKeyImage(), $thumbstyle, true, $style);
} else {
$view->gallery_image = Horde_Themes::img('thumb-error.png');
}
/* Check for being called via the api and generate correct view links */
if (!isset($params['gallery_view_url'])) {
if (empty($params['style'])) {
$gstyle = $dgallery->getStyle();
} else {
$gstyle = $params['style'];
}
$params = array('gallery' => $dgallery->id, 'view' => 'Gallery', 'slug' => $dgallery->get('slug'));
$view->view_link = Ansel::getUrlFor('view', array_merge($params, $next_date));
} else {
$view->view_link = new Horde_Url(str_replace(array('%g', '%s'), array($dgallery->id, $dgallery->get('slug')), urldecode($params['gallery_view_url'])));
$view->view_link->add($next_date);
}
$view->gallery_count = $dgallery->countImages(true);
return $view->render('dategallery');
}
示例2: display
/**
*/
public function display(Horde_Core_Prefs_Ui $ui)
{
global $browser, $injector, $page_output, $prefs;
$page_output->addScriptPackage('IMP_Script_Package_Imp');
$p_css = new Horde_Themes_Element('prefs.css');
$page_output->addStylesheet($p_css->fs, $p_css->uri);
$view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/prefs'));
$view->addHelper('Horde_Core_View_Helper_Help');
if (!Horde::isConnectionSecure()) {
$view->notsecure = true;
return $view->render('smimeprivatekey');
}
$smime_url = IMP_Basic_Smime::url();
$view->has_key = $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key');
$view->has_sign_key = $prefs->getValue('smime_public_sign_key') && $prefs->getValue('smime_private_sign_key');
if ($browser->allowFileUploads()) {
$view->import = true;
$page_output->addInlineScript(array('$("import_smime_personal").observe("click", function(e) { ' . Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_certs', 'reload' => base64_encode($ui->selfUrl()->setRaw(true))), 'height' => 450, 'width' => 750, 'urlencode' => true)) . '; e.stop(); })'), true);
}
if (!$view->has_key) {
return $view->render('smimeprivatekey');
}
$smime = $injector->getInstance('IMP_Smime');
foreach (array('' => false, '_sign' => true) as $suffix => $secondary) {
if ($secondary && !$view->has_sign_key) {
continue;
}
$cert = $smime->parseCert($smime->getPersonalPublicKey($secondary));
if (!empty($cert['validity']['notafter'])) {
$expired = new Horde_Date($cert['validity']['notafter']);
if ($expired->before(time())) {
$view->{'expiredate' . $suffix} = $expired->strftime($prefs->getValue('date_format'));
$view->{'expiretime' . $suffix} = $expired->strftime($prefs->getValue('time_format'));
}
}
$view->{'viewpublic' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_public' . $suffix . '_key')->link(array('title' => $secondary ? _("View Secondary Personal Public Certificate") : _("View Personal Public Certificate"), 'target' => 'view_key')) . _("View") . '</a>';
$view->{'infopublic' . $suffix} = $smime_url->copy()->add('actionID', 'info_personal_public' . $suffix . '_key')->link(array('title' => _("Information on Personal Public Certificate"), 'target' => 'info_key')) . _("Details") . '</a>';
if ($smime->getPassphrase($secondary)) {
$view->{'passphrase' . $suffix} = $ui->selfUrl(array('special' => true, 'token' => true))->add('unset_smime' . $suffix . '_passphrase', 1)->link(array('title' => _("Unload Passphrase"))) . _("Unload Passphrase") . '</a>';
} else {
$imple = $injector->getInstance('Horde_Core_Factory_Imple')->create('IMP_Ajax_Imple_PassphraseDialog', array('params' => array('reload' => $ui->selfUrl()->setRaw(true), 'secondary' => intval($secondary)), 'type' => 'smimePersonal'));
$view->{'passphrase' . $suffix} = Horde::link('#', _("Enter Passphrase"), null, null, null, null, null, array('id' => $imple->getDomId())) . _("Enter Passphrase");
}
$view->{'viewprivate' . $suffix} = $smime_url->copy()->add('actionID', 'view_personal_private' . $suffix . '_key')->link(array('title' => _("View Secondary Personal Private Key"), 'target' => 'view_key')) . _("View") . '</a>';
$page_output->addInlineScript(array('$("delete_smime_personal' . $suffix . '").observe("click", function(e) { if (!window.confirm(' . json_encode(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")) . ')) { e.stop(); } })'), true);
}
return $view->render('smimeprivatekey');
}
示例3: getGalleryCrumbData
/**
* Get an array describing where this gallery is in a breadcrumb trail.
*
* @return array An array of 'title' and 'navdata' hashes with the [0]
* element being the deepest part.
*/
public function getGalleryCrumbData()
{
$year = !empty($this->_date['year']) ? $this->_date['year'] : 0;
$month = !empty($this->_date['month']) ? $this->_date['month'] : 0;
$day = !empty($this->_date['day']) ? $this->_date['day'] : 0;
$trail = array();
// Do we have any date parts?
if (!empty($year)) {
if (!empty($day)) {
$date = new Horde_Date($this->_date);
$text = $date->strftime('%e');
$navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug'), 'year' => $year, 'month' => $month, 'day' => $day);
$trail[] = array('title' => $text, 'navdata' => $navdata);
}
if (!empty($month)) {
$date = new Horde_Date(array('year' => $year, 'month' => $month, 'day' => 1));
$text = $date->strftime('%B');
$navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug'), 'year' => $year, 'month' => $month);
$trail[] = array('title' => $text, 'navdata' => $navdata);
}
$navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug'), 'year' => $year);
$trail[] = array('title' => $year, 'navdata' => $navdata);
} else {
// This is the first level of a date mode gallery.
$navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug'));
$trail[] = array('title' => _("All dates"), 'navdata' => $navdata);
}
$text = htmlspecialchars($this->_gallery->get('name'));
$navdata = array('view' => 'Gallery', 'gallery' => $this->_gallery->id, 'slug' => $this->_gallery->get('slug'));
$trail[] = array('title' => $text, 'navdata' => $navdata);
return $trail;
}
示例4: _hours
protected function _hours()
{
global $prefs;
$hours_html = '';
$dayWidth = round(100 / $this->_days);
$span = floor(($this->_endHour - $this->_startHour) / 3);
if (($this->_endHour - $this->_startHour) % 3) {
$span++;
}
$date_format = $prefs->getValue('date_format');
for ($i = 0; $i < $this->_days; $i++) {
$t = new Horde_Date(array('month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$day_label = Horde::url('#')->link(array('onclick' => 'return switchDateView(\'Day\',' . $t->dateString() . ');')) . $t->strftime($date_format) . '</a>';
$hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>', $span, $dayWidth, $day_label);
}
$hours_html .= '</tr><tr><td width="100" class="label"> </td>';
$width = round(100 / ($span * $this->_days));
for ($i = 0; $i < $this->_days; $i++) {
for ($h = $this->_startHour; $h < $this->_endHour; $h += 3) {
$start = new Horde_Date(array('hour' => $h, 'month' => $this->_start->month, 'mday' => $this->_start->mday + $i, 'year' => $this->_start->year));
$end = new Horde_Date($start);
$end->hour += 2;
$end->min = 59;
$this->_timeBlocks[] = array($start, $end);
$hour = $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00');
$hours_html .= sprintf('<th width="%d%%">%s</th>', $width, $hour);
}
}
return $hours_html;
}
示例5: _hours
protected function _hours()
{
global $prefs;
$hours_html = '';
$width = round(100 / ($this->_endHour - $this->_startHour + 1));
$start = new Horde_Date($this->_start);
$end = new Horde_Date($this->_start);
$end->min = 59;
for ($i = $this->_startHour; $i < $this->_endHour; $i++) {
$start->hour = $end->hour = $i;
$this->_timeBlocks[] = array(clone $start, clone $end);
$hours_html .= '<th width="' . $width . '%">' . $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00') . '</th>';
}
return $hours_html;
}
示例6: _title
/**
*/
protected function _title()
{
$title = _("All Calendars");
$url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
$calendars = Kronolith::listCalendars();
if (isset($calendars[$this->_params['calendar']])) {
$title = htmlspecialchars($calendars[$this->_params['calendar']]->name());
} else {
$title = _("Calendar not found");
}
$url->add('display_cal', $this->_params['calendar']);
}
$date = new Horde_Date(time());
return $title . ', ' . $url->link() . $date->strftime('%B, %Y') . '</a>';
}
示例7: _prepareWrite
protected function _prepareWrite($attributes, $blob_fields, $date_fields)
{
$fields = $values = array();
foreach ($attributes as $field => $value) {
$fields[] = $field;
if (!empty($value) && isset($blob_fields[$field])) {
$values[] = new Horde_Db_Value_Binary($value);
} elseif (!empty($value) && isset($date_fields[$field])) {
$d = new Horde_Date($value);
$values[] = $d->strftime('%Y-%m-%d');
} else {
$values[] = $this->_convertToDriver($value);
}
}
return array($fields, $values);
}
示例8: toJson
/**
* Returns a simple object suitable for json transport representing this
* task.
*
* @param boolean $full Whether to return all task details.
* @param string $time_format The date() format to use for time formatting.
*
* @return object A simple object.
*/
public function toJson($full = false, $time_format = 'H:i')
{
$json = new stdClass();
$json->l = $this->tasklist;
$json->p = $this->parent_id;
$json->i = $this->indent;
$json->n = $this->name;
if ($this->desc) {
//TODO: Get the proper amount of characters, and cut by last
//whitespace
$json->sd = Horde_String::substr($this->desc, 0, 80);
}
$json->cp = (bool) $this->completed;
if ($this->due && ($due = $this->getNextDue())) {
$json->du = $due->toJson();
}
if ($this->start && ($start = $this->getNextStart())) {
$json->s = $start->toJson();
}
$json->pr = (int) $this->priority;
if ($this->recurs()) {
$json->r = $this->recurrence->getRecurType();
}
$json->t = array_values($this->tags);
if ($full) {
// @todo: do we really need all this?
$json->id = $this->id;
$json->de = $this->desc;
if ($this->due) {
$date = new Horde_Date($this->due);
$json->dd = $date->strftime('%x');
$json->dt = $date->format($time_format);
}
$json->as = $this->assignee;
if ($this->estimate) {
$json->e = $this->estimate;
}
/*
$json->o = $this->owner;
if ($this->completed_date) {
$date = new Horde_Date($this->completed_date);
$json->cd = $date->toJson();
}
*/
$json->a = (int) $this->alarm;
$json->m = $this->methods;
//$json->pv = (boolean)$this->private;
if ($this->recurs()) {
$json->r = $this->recurrence->toJson();
}
if ($this->tasklist == '**EXTERNAL**') {
$json->vl = (string) $this->view_link;
$json->cl = (string) $this->complete_link;
$json->pe = $json->pd = false;
} else {
try {
$share = $GLOBALS['nag_shares']->getShare($this->tasklist);
} catch (Horde_Share_Exception $e) {
Horde::log($e->getMessage(), 'ERR');
throw new Nag_Exception($e);
}
$json->pe = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT);
$json->pd = $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE);
}
}
return $json;
}
示例9: _renderInline
/**
* Return the rendered inline version of the Horde_Mime_Part object.
*
* @return array See parent::render().
*/
protected function _renderInline()
{
$browser = $this->getConfigParam('browser');
$notification = $this->getConfigParam('notification');
$prefs = $this->getConfigParam('prefs');
$registry = $this->getConfigParam('registry');
$data = $this->_mimepart->getContents();
$html = '';
$title = Horde_Core_Translation::t("vCard");
$iCal = new Horde_Icalendar();
if (!$iCal->parsevCalendar($data, 'VCALENDAR', $this->_mimepart->getCharset())) {
$notification->push(Horde_Core_Translation::t("There was an error reading the contact data."), 'horde.error');
}
if (Horde_Util::getFormData('import') && Horde_Util::getFormData('source') && $registry->hasMethod('contacts/import')) {
$source = Horde_Util::getFormData('source');
$count = 0;
foreach ($iCal->getComponents() as $c) {
if ($c->getType() == 'vcard') {
try {
$registry->call('contacts/import', array($c, null, $source));
++$count;
} catch (Horde_Exception $e) {
$notification->push(Horde_Core_Translation::t("There was an error importing the contact data:") . ' ' . $e->getMessage(), 'horde.error');
}
}
}
$notification->push(sprintf(Horde_Core_Translation::ngettext("%d contact was successfully added to your address book.", "%d contacts were successfully added to your address book.", $count), $count), 'horde.success');
}
$html .= '<table class="horde-table" style="width:100%">';
foreach ($iCal->getComponents() as $i => $vc) {
if ($i > 0) {
$html .= '<tr><td colspan="2"> </td></tr>';
}
$addresses = $vc->getAllAttributes('EMAIL');
$html .= '<tr><td colspan="2" class="header">';
if (($fullname = $vc->getAttributeDefault('FN', false)) === false) {
$fullname = count($addresses) ? $addresses[0]['value'] : Horde_Core_Translation::t("[No Label]");
}
$html .= htmlspecialchars($fullname) . '</td></tr>';
$n = $vc->printableName();
if (!empty($n)) {
$html .= $this->_row(Horde_Core_Translation::t("Name"), $n);
}
try {
$html .= $this->_row(Horde_Core_Translation::t("Alias"), implode("\n", $vc->getAttributeValues('ALIAS')));
} catch (Horde_Icalendar_Exception $e) {
}
try {
$birthdays = $vc->getAttributeValues('BDAY');
$birthday = new Horde_Date($birthdays[0]);
$html .= $this->_row(Horde_Core_Translation::t("Birthday"), $birthday->strftime($prefs->getValue('date_format')));
} catch (Horde_Icalendar_Exception $e) {
}
$photos = $vc->getAllAttributes('PHOTO');
foreach ($photos as $p => $photo) {
if (isset($photo['params']['VALUE']) && Horde_String::upper($photo['params']['VALUE']) == 'URI') {
$html .= $this->_row(Horde_Core_Translation::t("Photo"), '<img src="' . htmlspecialchars($photo['value']) . '" />', false);
} elseif (isset($photo['params']['ENCODING']) && Horde_String::upper($photo['params']['ENCODING']) == 'B' && isset($photo['params']['TYPE'])) {
if ($browser->hasFeature('datauri') === true || $browser->hasFeature('datauri') >= strlen($photo['value'])) {
$html .= $this->_row(Horde_Core_Translation::t("Photo"), '<img src="' . Horde_Url_Data::create($photo['params']['TYPE'], base64_decode($photo['value'])) . '" />', false);
} elseif ($this->_imageUrl) {
$html .= $this->_row(Horde_Core_Translation::t("Photo"), '<img src="' . $this->_imageUrl->add(array('c' => $i, 'p' => $p)) . '" />', false);
}
}
}
$labels = $vc->getAllAttributes('LABEL');
foreach ($labels as $label) {
if (isset($label['params']['TYPE'])) {
if (!is_array($label['params']['TYPE'])) {
$label['params']['TYPE'] = array($label['params']['TYPE']);
}
} else {
$label['params']['TYPE'] = array_keys($label['params']);
}
$types = array();
foreach ($label['params']['TYPE'] as $type) {
switch (Horde_String::upper($type)) {
case 'HOME':
$types[] = Horde_Core_Translation::t("Home Address");
break;
case 'WORK':
$types[] = Horde_Core_Translation::t("Work Address");
break;
case 'DOM':
$types[] = Horde_Core_Translation::t("Domestic Address");
break;
case 'INTL':
$types[] = Horde_Core_Translation::t("International Address");
break;
case 'POSTAL':
$types[] = Horde_Core_Translation::t("Postal Address");
break;
case 'PARCEL':
$types[] = Horde_Core_Translation::t("Parcel Address");
break;
//.........这里部分代码省略.........
示例10: relativeDateTime
/**
* Returns a relative, natural language representation of a timestamp
*
* @todo Wider range of values ... maybe future time as well?
* @todo Support minimum resolution parameter.
*
* @param mixed $time The time. Any format accepted by Horde_Date.
* @param string $date_format Format to display date if timestamp is
* more then 1 day old.
* @param string $time_format Format to display time if timestamp is 1
* day old.
*
* @return string The relative time (i.e. 2 minutes ago)
*/
public static function relativeDateTime($time, $date_format = '%x', $time_format = '%X')
{
$date = new Horde_Date($time);
$delta = time() - $date->timestamp();
if ($delta < 60) {
return sprintf(Horde_Date_Translation::ngettext("%d second ago", "%d seconds ago", $delta), $delta);
}
$delta = round($delta / 60);
if ($delta < 60) {
return sprintf(Horde_Date_Translation::ngettext("%d minute ago", "%d minutes ago", $delta), $delta);
}
$delta = round($delta / 60);
if ($delta < 24) {
return sprintf(Horde_Date_Translation::ngettext("%d hour ago", "%d hours ago", $delta), $delta);
}
if ($delta > 24 && $delta < 48) {
$date = new Horde_Date($time);
return sprintf(Horde_Date_Translation::t("yesterday at %s"), $date->strftime($time_format));
}
$delta = round($delta / 24);
if ($delta < 7) {
return sprintf(Horde_Date_Translation::t("%d days ago"), $delta);
}
if (round($delta / 7) < 5) {
$delta = round($delta / 7);
return sprintf(Horde_Date_Translation::ngettext("%d week ago", "%d weeks ago", $delta), $delta);
}
// Default to the user specified date format.
return $date->strftime($date_format);
}
示例11: _copyEvent
/**
* Creates a new event that represents an exception to a recurring event.
*
* @param Kronolith_Event $event The original recurring event.
* @param Kronolith_Event $copy If present, contains a copy of $event, but
* with changes from edited event form.
* @param stdClass $attributes The attributes passed from the client.
* Expected to contain rstart and rend or
* rday that represents the original
* starting/ending date of the instance.
*
* @return Kronolith_Event The event representing the exception
*/
protected function _copyEvent(Kronolith_Event $event, Kronolith_Event $copy = null, $attributes = null)
{
if (empty($copy)) {
$copy = clone $event;
}
if ($attributes->rstart) {
$rstart = new Horde_Date($attributes->rstart);
$rstart->setTimezone($event->start->timezone);
$rend = new Horde_Date($attributes->rend);
$rend->setTimezone($event->end->timezone);
} else {
$rstart = new Horde_Date($attributes->rday);
$rstart->setTimezone($event->start->timezone);
$rstart->hour = $event->start->hour;
$rstart->min = $event->start->min;
$rend = $rstart->add($event->getDuration);
$rend->setTimezone($event->end->timezone);
$rend->hour = $event->end->hour;
$rend->min = $event->end->min;
}
$uid = $event->uid;
$otime = $event->start->strftime('%T');
// Create new event for the exception
$nevent = $event->getDriver()->getEvent();
$nevent->baseid = $uid;
$nevent->exceptionoriginaldate = new Horde_Date($rstart->strftime('%Y-%m-%d') . 'T' . $otime);
$nevent->exceptionoriginaldate->setTimezone($event->start->timezone);
$nevent->creator = $event->creator;
$nevent->title = $copy->title;
$nevent->description = $copy->description;
$nevent->location = $copy->location;
$nevent->private = $copy->private;
$nevent->url = $copy->url;
$nevent->status = $copy->status;
$nevent->attendees = $copy->attendees;
$nevent->setResources($copy->getResources());
$nevent->start = $rstart;
$nevent->end = $rend;
$nevent->initialized = true;
return $nevent;
}
示例12: getTime
public function getTime($format, $offset = 0)
{
$date = new Horde_Date(array('month' => $this->month, 'mday' => $this->mday + $offset, 'year' => $this->year));
return $date->strftime($format);
}
示例13: stopTimer
/**
* Stop a timer. Expects the following in $this->vars:
* - t: The timer id.
* - restart:
*
* @return array An array describing the current timer state. Contains:
* - h: The total number of hours elapsed so far.
* - n: A note to apply to the description field of a time slice.
* - t: The new timer title, if restarting.
*/
public function stopTimer()
{
global $prefs, $notification;
try {
$timer = Hermes::getTimer($this->vars->t);
} catch (Horde_Exception_NotFound $e) {
$notification->push(_("Invalid timer requested"), 'horde.error');
return false;
}
$results = $timer;
$tname = $timer['name'];
$elapsed = (!$timer['paused'] ? time() - $timer['time'] : 0) + $timer['elapsed'];
$results['h'] = round((double) $elapsed / 3600, 2);
$started = new Horde_Date($this->vars->t, 'UTC');
$started->setTimezone(date_default_timezone_get());
$now = new Horde_Date(time(), 'UTC');
$now->setTimezone(date_default_timezone_get());
if ($prefs->getValue('add_description')) {
$results['n'] = sprintf(_("Using the \"%s\" stop watch from %s %s to %s %s"), $tname, $started->strftime($prefs->getValue('date_format_mini')), $started->strftime($prefs->getValue('time_format')), $now->strftime($prefs->getValue('date_format_mini')), $now->strftime($prefs->getValue('time_format')));
} else {
$results['n'] = '';
}
$notification->push(sprintf(_("The stop watch \"%s\" has been stopped."), $tname), 'horde.success');
Hermes::clearTimer($this->vars->t);
if ($this->vars->restart == 'true') {
$now = time();
$timer['elapsed'] = 0;
$timer['paused'] = $results['paused'] = true;
$timer['time'] = $now;
Hermes::updateTimer($this->vars->t, $timer);
}
return $results;
}
示例14:
?>
"><?php
echo $this->h($tag);
?>
</a></li>
<?php
}
?>
</ul>
</div>
</td>
<td class="trean-bookmarks-date">
<?php
if ($bookmark->dt) {
$dt = new Horde_Date($bookmark->dt);
echo $dt->strftime($GLOBALS['prefs']->getValue('date_format'));
}
?>
</td>
<td class="trean-bookmarks-clicks">
<?php
echo $bookmark->clicks;
?>
</td>
<td class="trean-bookmarks-actions">
<a href="<?php
echo Horde::url('edit.php')->add('bookmark', (int) $bookmark->id);
?>
"><?php
echo Horde::img('edit.png', _("Edit"));
?>
示例15: _formatExceptionDate
/**
* Returns a correcty formatted exception date for recurring events.
*
* @param string $date Exception in the format Ymd.
* @param string $format The format to display in.
*
* @return string The formatted date and delete link.
* @since 2.1.0
*/
protected function _formatExceptionDate($date, $format)
{
if (!preg_match('/(\\d{4})(\\d{2})(\\d{2})/', $date, $match)) {
return '';
}
$horde_date = new Horde_Date(array('year' => $match[1], 'month' => $match[2], 'mday' => $match[3]));
return $horde_date->strftime($format);
}