Inherits FacetFilterable.
Definition at line 227 of file calendar_view.inc.
◆ addFacetTaggingHandler()
CalendarView::addFacetTaggingHandler |
( |
|
$handler | ) |
|
Adds a row tagging handler.
This function will receive the data item for each row and can add custom attributes to the row tag.
Definition at line 315 of file calendar_view.inc.
317 $this->tagRowCallbacks[] =
$handler;
◆ addHandler()
CalendarView::addHandler |
( |
|
$class, |
|
|
|
$handler |
|
) |
| |
◆ calculateMonthRange()
CalendarView::calculateMonthRange |
( |
| ) |
|
Definition at line 364 of file calendar_view.inc.
366 if ($this->year < 2005 || $this->
year > 2038 || $this->month < 1 || $this->
month > 12)
368 die(
"Date out of range");
371 $this->startStr = sprintf(
"%d-%02d-01", $this->
year, $this->
month);
372 $this->start = strtotime($this->startStr);
374 $this->dayOfWeek = date(
"w", $this->start);
375 $this->daysInMonth = getMonthDays($this->
month, $this->
year);
377 $this->prevMonth = $this->
month - 1;
380 if ($this->prevMonth <= 0)
383 $this->prevMonth = 12;
386 $this->nextMonth = $this->
month + 1;
388 if ($this->nextMonth > 12)
391 $this->nextMonth = 1;
395 $this->endStr = sprintf(
"%d-%02d-01", $this->nextYear, $this->nextMonth);
rewriteQueryString($year, $month)
◆ CalendarView()
CalendarView::CalendarView |
( |
|
$events, |
|
|
|
$id = null |
|
) |
| |
Definition at line 244 of file calendar_view.inc.
248 $this->
month = date(
"n");
249 $this->
year = date(
"Y");
250 $this->tagRowCallbacks = array();
257 $this->maxEventsPerDay =
$max;
$id
The HTML tag id for the calendar view.
addHandler($class, $handler)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static getValue($component, $name)
Retrieve the value of the specified Setting.
◆ createEventDialog()
CalendarView::createEventDialog |
( |
| ) |
|
◆ details()
CalendarView::details |
( |
|
$event, |
|
|
|
$param = null |
|
) |
| |
◆ drawEventList()
CalendarView::drawEventList |
( |
| ) |
|
Definition at line 671 of file calendar_view.inc.
677 $this->
header(calendar_display);
679 if (count($this->events) > 0)
681 foreach($this->events as
$event)
692 <p><i>No events have been scheduled
for this month.</i></p>
header($alt=event_display)
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
◆ drawMiniCalendar()
CalendarView::drawMiniCalendar |
( |
| ) |
|
Definition at line 401 of file calendar_view.inc.
407 <script type=
"text/javascript" src=
"/components/calendar/js/calendar.js"></script>
415 <div
id=
"minicalendar">
418 <td
colspan=
"7" class=
"month"><a
class=
"calendar_nav" href=
"<?echo $this->prevLink?>"><</a>&
nbsp; <?echo date(
"F Y", $this->start)?>&
nbsp; <a
class=
"calendar_nav" href=
"<?echo $this->nextLink?>">></a> </td>
421 <th
width=
"14%">Su</th>
422 <th
width=
"14%">Mo</th>
423 <th
width=
"14%">Tu</th>
424 <th
width=
"14%">We</th>
425 <th
width=
"14%">Th</th>
426 <th
width=
"14%">Fr</th>
427 <th
width=
"14%">Sa</th>
431 for(
$c = 0;
$c < $this->dayOfWeek; ++
$c)
433 ?><td
class=
"empty">&
nbsp;</td><?
438 for($i = 1; $i <= $this->daysInMonth; ++$i)
441 $currentDay = sprintf(
"%d-%02d-%02d", $this->
year, $this->
month, $i);
442 $eventsToday = $this->
filterEvents($this->events, $currentDay);
444 if (count($eventsToday) > 0)
448 $eventBubbleID =
"event_bubble_".str_replace(
"-",
"_", $currentDay);
449 $dayTitle = date(
"F jS Y", strtotime($currentDay));
454 "<div id='$eventBubbleID' class='event_bubble'>
455 <div class='event_bubble_content'>
456 <h4>{$dayTitle}</h4>";
458 foreach($eventsToday as
$event)
466 <div class='event_bubble_bottom'> </div></div>";
470 $class = ((
$c % 7) == 0 || (
$c % 7) == 6) ?
"weekend" :
"weekday";
476 <td
class=
"<?echo $class ?>" ><?echo
$link ?></td>
479 if ((
$c % 7) == 0) echo
"</tr><tr>";
485 ?><td
class=
"empty">&
nbsp;</td>
formatEventListLink($link, $dLink, $currentDay, $eventBubbleID, $idx)
filterEvents($events, $currentDay)
if(!checkRole("admin")) $c
◆ drawMonth()
CalendarView::drawMonth |
( |
| ) |
|
Definition at line 501 of file calendar_view.inc.
507 <div
id=
"fullcalendar">
508 <table
id=<?php echo $this->
id ?>>
510 <td
class=
"month" colspan=
"7"><?echo date(
"F Y", $this->start)?> <a
class=
"calendar_nav" href=
"<?echo $this->prevLink?>"><img src=
"/components/calendar/images/calendar_arrow_l.png" alt=
"left" width=
"22" height=
"22" border=
"0"></a> <a
class=
"calendar_nav" href=
"<?echo $this->nextLink?>"><img src=
"/components/calendar/images/calendar_arrow_r.png" alt=
"right" width=
"22" height=
"22" border=
"0"></a> </td>
513 <th
width=
"14.28%">Su</th>
514 <th
width=
"14.28%">Mo</th>
515 <th
width=
"14.28%">Tu</th>
516 <th
width=
"14.28%">We</th>
517 <th
width=
"14.28%">Th</th>
518 <th
width=
"14.28%">Fr</th>
519 <th
width=
"14.28%">Sa</th>
523 for(
$c = 0;
$c < $this->dayOfWeek; ++
$c)
525 ?><td
class=
"empty">&
nbsp;</td><?
530 for($i = 1; $i <= $this->daysInMonth; ++$i)
533 $currentDay = sprintf(
"%d-%02d-%02d", $this->
year, $this->
month, $i);
534 $eventsToday = $this->
filterEvents($this->events, $currentDay);
537 if (count($eventsToday) > 0)
540 foreach($eventsToday as
$event)
550 $class = ((
$c % 7) == 0 || (
$c % 7) == 6) ?
"weekend" :
"weekday";
556 <td
class=
"<?echo $class ?>" data-day=
"<?php echo $i ?>"><?echo
$link ?><? echo
$content?></td>
559 if ((
$c % 7) == 0) echo
"</tr><tr>";
565 ?><td
class=
"empty">&
nbsp;</td>
◆ filterEvents()
CalendarView::filterEvents |
( |
|
$events, |
|
|
|
$currentDay |
|
) |
| |
◆ formatEventListLink()
CalendarView::formatEventListLink |
( |
|
$link, |
|
|
|
$dLink, |
|
|
|
$currentDay, |
|
|
|
$eventBubbleID, |
|
|
|
$idx |
|
) |
| |
Definition at line 647 of file calendar_view.inc.
651 $link .= (preg_match(
"/\?/",
$link)) ?
"&" :
"?";
652 $link .=
"date=$currentDay";
659 if(preg_match(
"/[\(.*?\)]$/", $dLink))
660 $dLink = preg_replace(
"/[\(.*?\)]$/",
", '$currentDay')", $dLink);
662 $dLink .=
"('$currentDay')";
663 $onclick =
"onclick=\"$dLink; return false;\"";
666 return "<a class='eventlink' href=\"{$link}\" $onclick;
667 onmouseover='showEventBubble(\"$eventBubbleID\", this);' onmouseout='hideEventBubble(\"$eventBubbleID\");'>{$idx}</a>";
◆ getHandler()
CalendarView::getHandler |
( |
|
$event | ) |
|
Definition at line 288 of file calendar_view.inc.
290 if(get_class(
$event) ==
"Event" &&
$event->composite_class)
292 $event_class =
$event->composite_class;
296 $event_class = get_class(
$event);
299 if(array_key_exists($event_class, $this->handlerMap))
301 $handler = $this->handlerMap[$event_class];
◆ getID()
◆ header()
CalendarView::header |
( |
|
$alt = event_display | ) |
|
Definition at line 601 of file calendar_view.inc.
604 $altTitle = ($alt == event_display) ?
"List of Events" :
"Calendar";
606 <table
style=
'width: 100%' class=
"layout">
608 <td><p><a href=
"<? echo $link ?>">View <? echo $altTitle ?></a></p></td>
610 <form method=
"get" action=
"">
612 $calendar_id = htmlSafe(checkNumeric($_GET[
"calendar_id"]));
615 echo
"<input id='calendar_id' type='hidden' name='calendar_id' value='$calendar_id'/>\n";
618 <select name=
"month">
620 for($i = 1; $i <= 12; ++$i)
622 $monthName = date(
"F", strtotime(
"$i/1/2007"));
623 option($i, $monthName, $i == $this->
month);
626 </select>&
nbsp;<select name=
"year">
628 $endYear = date(
"Y") + 2;
629 for($i = 2006; $i <= $endYear; ++$i)
631 option($i, $i, (
int)$this->
year);
635 <input type=
"submit" class=
"button" value=
" GO "/>
◆ rewriteQueryString()
CalendarView::rewriteQueryString |
( |
|
$year, |
|
|
|
$month |
|
) |
| |
Definition at line 347 of file calendar_view.inc.
351 $qs = $_SERVER[
'QUERY_STRING'];
357 $qs = preg_replace(
"/identifier=[\\w_]+&*/",
"",
$qs);
358 $qs = preg_replace(
"/{$this->yearParam}=\\d+&*/",
"",
$qs);
359 $qs = preg_replace(
"/{$this->monthParam}=\\d+&*/",
"",
$qs);
361 return "$identifier".appendToQueryString(
$qs,
"{$this->yearParam}=$year&{$this->monthParam}=$month");
◆ summary()
CalendarView::summary |
( |
|
$event | ) |
|
◆ writeScript()
CalendarView::writeScript |
( |
| ) |
|
Definition at line 576 of file calendar_view.inc.
578 if(!count($this->tagRowCallbacks) || !$this->maxEventsPerDay)
return;
581 if($this->maxEventsPerDay)
583 $options =
"{per_day: {$this->maxEventsPerDay}}";
588 <script type=
"text/javascript" src=
"/components/calendar/js/filtering_calendar.js"></script>
589 <script type=
"text/javascript">
590 window.addEvent(
'domready',
function()
592 var <?echo $this->
id?> =
new FilteringCalendar(
'<?echo $this->id ?>', <?php echo
$options ?>);
◆ $calendarLink
CalendarView::$calendarLink = "/calendar" |
◆ $current_day
CalendarView::$current_day |
◆ $detailLink
CalendarView::$detailLink = "/event_detail" |
◆ $events
◆ $handlerMap
CalendarView::$handlerMap = array() |
◆ $id
◆ $listDialog
CalendarView::$listDialog = "" |
◆ $listLink
CalendarView::$listLink = "/event_list" |
◆ $maxEventsPerDay
CalendarView::$maxEventsPerDay = null |
The maximum number of events to display per day on monthly view.
Definition at line 241 of file calendar_view.inc.
◆ $month
◆ $monthParam
CalendarView::$monthParam = "month" |
◆ $tagRowCallbacks
CalendarView::$tagRowCallbacks |
Array of callbacks for adding extra attributes to each row.
Definition at line 242 of file calendar_view.inc.
◆ $year
◆ $yearParam
CalendarView::$yearParam = "year" |
The documentation for this class was generated from the following file: