本文整理汇总了PHP中Kronolith::getUserName方法的典型用法代码示例。如果您正苦于以下问题:PHP Kronolith::getUserName方法的具体用法?PHP Kronolith::getUserName怎么用?PHP Kronolith::getUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kronolith
的用法示例。
在下文中一共展示了Kronolith::getUserName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
public function html($active = true)
{
if (!$this->_event) {
echo '<h3>' . _("Event not found") . '</h3>';
exit;
}
if (is_string($this->_event)) {
echo '<h3>' . $this->_event . '</h3>';
exit;
}
global $conf, $prefs;
$this->_event->loadHistory();
$creatorId = $this->_event->creator;
$description = $this->_event->description;
$location = $this->_event->location;
$eventurl = $this->_event->url;
$private = $this->_event->isPrivate();
$owner = Kronolith::getUserName($creatorId);
$status = Kronolith::statusToString($this->_event->status);
$attendees = $this->_event->attendees;
$resources = $this->_event->getResources();
if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$month = $datetime->month;
$year = $datetime->year;
} else {
$month = (int) Horde_Util::getFormData('month', date('n'));
$year = (int) Horde_Util::getFormData('year', date('Y'));
}
$dateFormat = $prefs->getValue('date_format');
$timeFormat = $prefs->getValue('twentyFour') ? 'G:i' : 'g:ia';
// Tags
$tags = implode(', ', $this->_event->tags);
echo '<div id="Event"' . ($active ? '' : ' style="display:none"') . '>';
require KRONOLITH_TEMPLATES . '/view/view.inc';
echo '</div>';
if ($active && $GLOBALS['browser']->hasFeature('dom')) {
/* We check for read permissions, because we can always save a
* copy if we can read the event. */
if ($this->_event->hasPermission(Horde_Perms::READ) && Kronolith::getDefaultCalendar(Horde_Perms::EDIT)) {
$edit = new Kronolith_View_EditEvent($this->_event);
$edit->html(false);
}
if ($this->_event->hasPermission(Horde_Perms::DELETE)) {
$delete = new Kronolith_View_DeleteEvent($this->_event);
$delete->html(false);
}
}
}
示例2: getTooltip
/**
* @return string A tooltip for quick descriptions of this event.
*/
public function getTooltip()
{
$tooltip = $this->getTimeRange() . "\n" . sprintf(_("Owner: %s"), $this->creator == $GLOBALS['registry']->getAuth() ? _("Me") : Kronolith::getUserName($this->creator));
if (!$this->isPrivate()) {
if ($this->location) {
$tooltip .= "\n" . _("Location") . ': ' . $this->location;
}
if ($this->description) {
$tooltip .= "\n\n" . Horde_String::wrap($this->description);
}
}
return $tooltip;
}
示例3: toKolab
/**
* Prepares this event to be saved to the backend.
*/
public function toKolab()
{
$event = array();
$event['uid'] = $this->uid;
$event['summary'] = $this->title;
$event['body'] = $this->description;
$event['location'] = $this->location;
$event['sensitivity'] = $this->private ? 'private' : 'public';
// Only set organizer if this is a new event
if ($this->_id == null) {
$organizer = array('display-name' => Kronolith::getUserName($this->creator), 'smtp-address' => Kronolith::getUserEmail($this->creator));
$event['organizer'] = $organizer;
}
if ($this->alarm != 0) {
$event['alarm'] = $this->alarm;
}
if ($this->methods !== null) {
$event['horde-alarm-methods'] = serialize($this->methods);
}
$event['start-date'] = $this->start->toDateTime();
$event['end-date'] = $this->end->toDateTime();
$event['_is_all_day'] = $this->isAllDay();
switch ($this->status) {
case Kronolith::STATUS_FREE:
case Kronolith::STATUS_CANCELLED:
$event['show-time-as'] = 'free';
break;
case Kronolith::STATUS_TENTATIVE:
$event['show-time-as'] = 'tentative';
break;
// No mapping for outofoffice
// No mapping for outofoffice
case Kronolith::STATUS_CONFIRMED:
default:
$event['show-time-as'] = 'busy';
}
// Recurrence
if ($this->recurs()) {
$event['recurrence'] = $this->recurrence->toKolab();
}
// Attendees
$event['attendee'] = array();
foreach ($this->attendees as $attendee) {
$new_attendee = array();
$new_attendee['display-name'] = $attendee->name;
// Attendee without an email address
if (strpos($attendee->email, '@') === false) {
$new_attendee['smtp-address'] = '';
} else {
$new_attendee['smtp-address'] = $attendee->email;
}
switch ($attendee->role) {
case Kronolith::PART_OPTIONAL:
$new_attendee['role'] = 'optional';
break;
case Kronolith::PART_NONE:
$new_attendee['role'] = 'resource';
break;
case Kronolith::PART_REQUIRED:
default:
$new_attendee['role'] = 'required';
break;
}
$new_attendee['request-response'] = 'false';
switch ($attendee->response) {
case Kronolith::RESPONSE_ACCEPTED:
$new_attendee['status'] = 'accepted';
break;
case Kronolith::RESPONSE_DECLINED:
$new_attendee['status'] = 'declined';
break;
case Kronolith::RESPONSE_TENTATIVE:
$new_attendee['status'] = 'tentative';
break;
case Kronolith::RESPONSE_NONE:
default:
$new_attendee['status'] = 'none';
break;
}
$event['attendee'][] = $new_attendee;
}
// Tags
if (!is_array($this->tags)) {
$this->tags = Kronolith::getTagger()->split($this->tags);
}
if ($this->tags) {
$event['categories'] = $this->tags;
}
return $event;
}