本文整理匯總了PHP中Kronolith::viewShowLocation方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kronolith::viewShowLocation方法的具體用法?PHP Kronolith::viewShowLocation怎麽用?PHP Kronolith::viewShowLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kronolith
的用法示例。
在下文中一共展示了Kronolith::viewShowLocation方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: html
public function html()
{
global $prefs;
if (!$this->_parsed) {
$this->parse();
}
$started = false;
$first_row = true;
$addLinks = Kronolith::getDefaultCalendar(Horde_Perms::EDIT) && ($GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('max_events') === true || $GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('max_events') > Kronolith::countEvents());
$showLocation = Kronolith::viewShowLocation();
$showTime = Kronolith::viewShowTime();
require KRONOLITH_TEMPLATES . '/day/head.inc';
if ($this->sidebyside) {
require KRONOLITH_TEMPLATES . '/day/head_side_by_side.inc';
}
echo '<tbody>';
if ($addLinks) {
$newEventUrl = Horde::url('new.php')->add(array('datetime' => sprintf($this->dateString() . '%02d%02d00', $this->slots[0]['hour'], $this->slots[0]['min']), 'allday' => 1, 'url' => $this->link(0, true)))->link(array('title' => _("Create a New Event"))) . _("All day") . '</a>';
} else {
$newEventUrl = _("All day");
}
$row = '<td colspan="' . $this->totalspan . '">';
foreach (array_keys($this->_currentCalendars) as $cid) {
foreach ($this->all_day_events[$cid] as $event) {
$row .= '<div class="kronolith-event"' . $event->getCSSColors() . '>' . $event->getLink($this, true, $this->link(0, true));
if (!$event->isPrivate() && $showLocation) {
$row .= '<span class="event-location">' . htmlspecialchars($event->getLocation()) . '</span>';
}
$row .= '</div>';
}
}
$row .= '</td>';
require KRONOLITH_TEMPLATES . '/day/all_day.inc';
$day_hour_force = $prefs->getValue('day_hour_force');
$day_hour_start = $prefs->getValue('day_hour_start') / 2 * $this->slotsPerHour;
$day_hour_end = $prefs->getValue('day_hour_end') / 2 * $this->slotsPerHour;
$rows = array();
$covered = array();
for ($i = 0; $i < $this->slotsPerDay; ++$i) {
if ($i >= $day_hour_end && $i > $this->_last) {
break;
}
if ($i < $this->_first && $i < $day_hour_start) {
continue;
}
$row = '';
if (!count($this->_currentCalendars)) {
$row .= '<td> </td>';
}
foreach (array_keys($this->_currentCalendars) as $cid) {
$hspan = 0;
foreach ($this->_event_matrix[$cid][$i] as $key) {
$event =& $this->events[$key];
// Since we've made sure that this event's overlap is a
// factor of the total span, we get this event's
// individual span by dividing the total span by this
// event's overlap.
$span = $this->span[$cid] / $event->overlap;
// Store the indent we're starting this event at
// for future use.
if (!isset($event->indent)) {
$event->indent = $hspan;
}
// If the first node that we would cover is
// already covered, we can assume that table
// rendering will take care of pushing the event
// over. However, if the first node _isn't_
// covered but any others that we would cover
// _are_, we only cover the available nodes.
if (!isset($covered[$i][$event->indent])) {
$collision = false;
$available = 0;
for ($y = $event->indent; $y < $span + $event->indent; ++$y) {
if (isset($covered[$i][$y])) {
$collision = true;
break;
}
$available++;
}
if ($collision) {
$span = $available;
}
}
$hspan += $span;
$start = new Horde_Date(array('hour' => floor($i / $this->slotsPerHour), 'min' => $i % $this->slotsPerHour * $this->slotLength, 'month' => $this->month, 'mday' => $this->mday, 'year' => $this->year));
$end_slot = new Horde_Date($start);
$end_slot->min += $this->slotLength;
if ((!$day_hour_force || $i >= $day_hour_start) && $event->start->compareDateTime($start) >= 0 && $event->start->compareDateTime($end_slot) < 0 || $start->compareDateTime($this) == 0 || $day_hour_force && $i == $day_hour_start && $event->start->compareDateTime($start) < 0) {
// Store the nodes that we're covering for
// this event in the coverage graph.
for ($x = $i; $x < $i + $event->rowspan; ++$x) {
for ($y = $event->indent; $y < $hspan; ++$y) {
$covered[$x][$y] = true;
}
}
$row .= '<td class="kronolith-event"' . $event->getCSSColors() . 'width="' . round(90 / count($this->_currentCalendars) * ($span / $this->span[$cid])) . '%" ' . 'valign="top" colspan="' . $span . '" rowspan="' . $event->rowspan . '">' . '<div class="kronolith-event-info">';
if ($showTime) {
$row .= '<span class="kronolith-time">' . htmlspecialchars($event->getTimeRange()) . '</span>';
}
$row .= $event->getLink($this, true, $this->link(0, true));
//.........這裏部分代碼省略.........
示例2: html
public function html()
{
global $prefs;
$more_timeslots = $prefs->getValue('time_between_days');
$include_all_events = !$prefs->getValue('show_shared_side_by_side');
$showLocation = Kronolith::viewShowLocation();
$showTime = Kronolith::viewShowTime();
if (!$this->parsed) {
$this->parse();
}
$slots = $this->days[$this->startDay]->slots;
$cid = 0;
require KRONOLITH_TEMPLATES . '/week/head.inc';
if ($this->sidebyside) {
require KRONOLITH_TEMPLATES . '/week/head_side_by_side.inc';
}
echo '</thead><tbody>';
$event_count = 0;
for ($j = $this->startDay; $j <= $this->endDay; ++$j) {
foreach (array_keys($this->_currentCalendars) as $cid) {
$event_count = max($event_count, count($this->days[$j]->all_day_events[$cid]));
reset($this->days[$j]->all_day_events[$cid]);
}
}
$row = '';
for ($j = $this->startDay; $j <= $this->endDay; ++$j) {
if ($more_timeslots) {
$row .= '<td class="kronolith-first-col"><span>' . _("All day") . '</span></td>';
}
$row .= '<td colspan="' . $this->days[$j]->totalspan . '" valign="top"';
if ($this->days[$j]->isToday()) {
$row .= ' class="kronolith-today"';
} elseif ($this->days[$j]->dayOfWeek() == 0 || $this->days[$j]->dayOfWeek() == 6) {
$row .= ' class="kronolith-weekend"';
}
$row .= '>';
foreach (array_keys($this->days[$j]->currentCalendars) as $cid) {
foreach ($this->days[$j]->all_day_events[$cid] as $event) {
$row .= '<div class="kronolith-event"' . $event->getCSSColors() . $event->getLink($this->days[$j], true, $this->link(0, true));
if (!$event->isPrivate() && $showLocation) {
$row .= '<span class="kronolith-location">' . htmlspecialchars($event->getLocation()) . '</span>';
}
$row .= '</div>';
}
}
$row .= '</td>';
}
$first_row = !$more_timeslots;
$newEventUrl = _("All day");
require KRONOLITH_TEMPLATES . '/day/all_day.inc';
$day_hour_force = $prefs->getValue('day_hour_force');
$day_hour_start = $prefs->getValue('day_hour_start') / 2 * $this->slotsPerHour;
$day_hour_end = $prefs->getValue('day_hour_end') / 2 * $this->slotsPerHour;
$rows = array();
$covered = array();
for ($i = 0; $i < $this->slotsPerDay; ++$i) {
if ($i >= $day_hour_end && $i > $this->last) {
break;
}
if ($i < $this->first && $i < $day_hour_start) {
continue;
}
$time = Kronolith_View_Day::prefHourFormat($slots[$i]['hour'], $i % $this->slotsPerHour * $this->slotLength);
$row = '';
for ($j = $this->startDay; $j <= $this->endDay; ++$j) {
// Add spacer between days, or timeslots.
if ($more_timeslots && $j != $this->startDay) {
$row .= '<td class="kronolith-first-col"><span>' . $time . '</span></td>';
}
if (!count($this->_currentCalendars)) {
$row .= '<td> </td>';
}
foreach (array_keys($this->_currentCalendars) as $cid) {
// Width (sum of colspans) of events for the current time
// slot.
$hspan = 0;
// $hspan + count of empty TDs in the current timeslot.
$current_indent = 0;
// $current_indent is initialized to the position of the
// first available cell of the day.
for (; isset($covered[$j][$i][$current_indent]); ++$current_indent) {
}
foreach ($this->days[$j]->event_matrix[$cid][$i] as $key) {
$event =& $this->days[$j]->events[$key];
if ($include_all_events || $event->calendar == $cid) {
// Since we've made sure that this event's
// overlap is a factor of the total span,
// we get this event's individual span by
// dividing the total span by this event's
// overlap.
$span = $this->days[$j]->span[$cid] / $event->overlap;
// Store the indent we're starting this event at
// for future use.
if (!isset($event->indent)) {
$event->indent = $current_indent;
}
// If $event->span is set this mean than we
// already calculated the width of the event.
if (!isset($event->span)) {
// If the first node that we would cover is
//.........這裏部分代碼省略.........
示例3: html
public function html()
{
global $prefs;
$sidebyside = $prefs->getValue('show_shared_side_by_side');
$twentyFour = $prefs->getValue('twentyFour');
$addLinks = Kronolith::getDefaultCalendar(Horde_Perms::EDIT) && ($GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('max_events') === true || $GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('max_events') > Kronolith::countEvents());
if ($sidebyside) {
require KRONOLITH_TEMPLATES . '/month/head_side_by_side.inc';
} else {
require KRONOLITH_TEMPLATES . '/month/head.inc';
}
$html = '';
if (!$sidebyside && count($this->_currentCalendars)) {
$html .= '<tr>';
}
$showLocation = Kronolith::viewShowLocation();
$showTime = Kronolith::viewShowTime();
$day_url = Horde::url('day.php');
$this_link = $this->link(0, true);
$new_url = Horde::url('new.php')->add('url', $this_link);
$new_img = Horde::img('new_small.png', '+');
foreach ($this->_currentCalendars as $id => $cal) {
if ($sidebyside) {
$html .= '<tr>';
}
$cell = 0;
for ($day = $this->_startOfView; $day < $this->_startOfView + $this->_daysInView; ++$day) {
$date = new Kronolith_Day($this->month, $day, $this->year);
$date->hour = $twentyFour ? 12 : 6;
$week = $date->weekOfYear();
if ($cell % 7 == 0) {
$weeklink = Horde::url('week.php')->add('date', $date->dateString())->link(array('class' => 'kronolith-weeklink')) . ($sidebyside ? sprintf(_("Week %d"), $week) : $week) . '</a>';
if ($sidebyside) {
$html .= sprintf('<td class="kronolith-first-col">%s<br />%s</td>', $weeklink, htmlspecialchars(Kronolith::getLabel($cal)));
} else {
if ($cell != 0) {
$html .= "</tr>\n<tr>";
}
$html .= '<td class="kronolith-first-col">' . $weeklink . '</td>';
}
}
if ($date->isToday()) {
$style = ' class="kronolith-today"';
} elseif ($date->month != $this->month) {
$style = ' class="kronolith-other-month"';
} elseif ($date->dayOfWeek() == 0 || $date->dayOfWeek() == 6) {
$style = ' class="kronolith-weekend"';
} else {
$style = '';
}
$html .= '<td' . $style . '><div class="kronolith-day">';
$html .= $day_url->add('date', $date->dateString())->link() . $date->mday . '</a>';
if ($addLinks) {
$new_url->add('date', $date->dateString());
if ($sidebyside) {
$new_url->add('calendar', $id);
}
$html .= $new_url->link(array('title' => _("Create a New Event"), 'class' => 'newEvent')) . $new_img . '</a>';
}
$html .= '</div>';
$date_stamp = $date->dateString();
if (!empty($this->_events[$date_stamp])) {
foreach ($this->_events[$date_stamp] as $event) {
if (!$sidebyside || $event->calendar == $id) {
$html .= '<div class="kronolith-event"' . $event->getCSSColors() . '>';
if ($showTime && !$event->isAllDay()) {
$html .= '<span class="kronolith-time">' . htmlspecialchars($event->getTimeRange()) . '</span>';
}
$html .= $event->getLink($date, true, $this_link);
if (!$event->isPrivate() && $showLocation) {
$html .= '<span class="kronolith-location">' . htmlspecialchars($event->getLocation()) . '</span>';
}
$html .= '</div>';
}
}
}
$html .= "</td>\n";
++$cell;
}
if ($sidebyside) {
$html .= '</tr>';
}
}
if (!$sidebyside && count($this->_currentCalendars)) {
$html .= '</tr>';
}
echo $html . '</tbody></table>';
}