Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
CalendarView Class Reference
Collaboration diagram for CalendarView:
Collaboration graph

Public Member Functions

 __construct ($entries, $controller)
 setDays ($days)
 setHeight ($height)
 setRange ($start_hour, $end_hour)
 groupEntries ($grouped=true)
 getEntries ()
 getMatrix ()
 getContext ()
 getDays ()
 getRange ()
 isGrouped ()
 getHeight ()
 getOverallHeight ()
 setReadOnly ($readonly=true)
 isReadOnly ()

Detailed Description

Kind of bean class for the calendar view.

Since
2.0

Constructor & Destructor Documentation

__construct (   $entries,
  $controller 
)

You need to pass an instance of this class to the template. The constructor expects an array of entries of the following type:

array ( 'color' => the color in hex (css-like, without the #) 'start' => the (start hour * 100) + (start minute) 'end' => the (end hour * 100) + (end minute) 'day' => day of week (0 = Sunday, ... , 6 = Saturday) 'title' => the entry`s title 'content' => whatever shall be the content of the entry as a string )

Parameters
mixed$entriesan array of entries (see above)
string$controllerthe name of the controller. Used to create links.

Member Function Documentation

getContext ( )
Returns
mixed the context
getDays ( )
Returns
mixed the days
getEntries ( )

Returns an array of calendar-entries, grouped by day and additionally grouped by same start and end if groupEntries(true) has been called.

Returns
mixed the (double-)grouped entries

Here is the call graph for this function:

Here is the caller graph for this function:

getHeight ( )
Returns
mixed the height
getMatrix ( )

Returns an array where for each hour the number of concurrent entries is denoted. Used by the calendar to display the entries in parallel.

Returns
mixed concurrent entries at each hour

Here is the call graph for this function:

getOverallHeight ( )
Returns
mixed the overall height
getRange ( )
Returns
array an array consisting of the start and end hour
groupEntries (   $grouped = true)

Call this function th enable/disable the grouping of entries with the same start and end.

Parameters
bool$groupoptional, defaults to true
isGrouped ( )
Returns
bool true if grouped, false otherwise

Here is the caller graph for this function:

isReadOnly ( )
Returns
bool true if read only, false otherwise
setDays (   $days)

set the visible days for the calendar. Pass an array with at least one of the numbers 0-6, which represent the numerical phplike-days respectively.

Parameters
mixed$daysan array of at least one of the numbers 0-6
setHeight (   $height)

set the height for one hour. This value is used to calculate the whole height of the schedule.

Parameters
int$entry_heightthe height of one hour in the schedule
setRange (   $start_hour,
  $end_hour 
)

set the range of hours to be displayed. the start_hour has to be smaller than the end_hour

Parameters
int$start_hourthe hour to start displaying at
int$end_hourthe hour to stop displaying at
setReadOnly (   $readonly = true)
Parameters
booltrue to make it read only, false otherwise
Returns
void

The documentation for this class was generated from the following file: