Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
CalendarColumn Class Reference

Public Member Functions

 __construct ($id=null)
 
 getId ()
 
 setId ($id)
 
 setTitle ($new_title)
 
 getTitle ()
 
 setURL ($new_url)
 
 getURL ()
 
 addEntry ($entry_array)
 
 addEntries ($entries_array=[])
 
 getEntries ()
 
 eraseEntries ()
 
 getGroupedEntries ()
 
 sortAndGroupEntries ()
 
 sortEntries ()
 
 getMatrix ()
 
 isGrouped ()
 
 groupEntries ($grouped=true)
 

Static Public Member Functions

static create ($id=null)
 

Data Fields

 $entries = []
 

Protected Attributes

 $title = ""
 
 $id = ""
 
 $url = ""
 
 $grouped = false
 
 $sorted_entries = null
 

Static Protected Attributes

static $number = 0
 

Constructor & Destructor Documentation

__construct (   $id = null)

constructor

Parameters
string$idnecessary if you want JavaScript enabled for this column

Member Function Documentation

addEntries (   $entries_array = [])

adds many entries to the column. For the syntax of an entry see addEntry()

Parameters
array$entries_array
Returns
CalendarColumn
addEntry (   $entry_array)

adds a new entry in the column. The entry needs to be an associative array with parameters as follows:

Parameters
array$entry_arrayassociative array for an entry in the column like array ( 'color' => the color in hex (css-like, without the #) 'start' => the (start hour * 100) + (start minute) 'end' => the (end hour * 100) + (end minute) 'title' => the entry`s title 'content' => whatever shall be the content of the entry as a string )
static create (   $id = null)
static

creates instance of type CalendarColumn

Parameters
string$idnecessary if you want JavaScript enabled for this calendar
Returns
CalendarColumn
eraseEntries ( )

deletes all entries of this column. So the only way to edit an entry is getting all entries with getEntries, edit this entry, eraseEntries() and addEntries(). Not very short, but at least it works.

Returns
CalendarColumn
getEntries ( )

returns all entries of this column

Returns
array of arrays like array ( 'color' => the color in hex (css-like, without the #) 'start' => the (start hour * 100) + (start minute) 'end' => the (end hour * 100) + (end minute) 'title' => the entry`s title 'content' => whatever shall be the content of the entry as a string )
getGroupedEntries ( )

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
getId ( )

returns the id of the column

Returns
string
getMatrix ( )

returns a matrix that tells the number of entries for a given timeslot

Returns
array
getTitle ( )

returns the title of this column like "monday"

Returns
string title of column
getURL ( )

returns the URL of the column (see setURL)

Returns
string an url
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
Returns
void
isGrouped ( )

check, if a grouped view of the entries is requested

Returns
bool true if grouped, false otherwise
setId (   $id)

sets the id for this column, which is only necessary if you want Javascript to be enabled for this calendar

Parameters
string$idnew id for this column
Returns
CalendarColumn
setTitle (   $new_title)

sets a title like "monday" for this column, which will be displayed in the calendar

Parameters
string$new_titlenew title
Returns
CalendarColumn
setURL (   $new_url)

sets the url to be directed to when clicking on the title of the column. Usually this is a single-day-view of the calendar.

Parameters
string$new_urlan url
Returns
CalendarColumn
sortAndGroupEntries ( )

sorts and groups entries and returns them only used by columns with grouped entries like instituteschedules

Returns
array
sortEntries ( )

sorts entries and returns them

Returns
array

Field Documentation

$entries = []
$grouped = false
protected
$id = ""
protected
$number = 0
staticprotected
$sorted_entries = null
protected
$title = ""
protected
$url = ""
protected

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