|
Stud.IP
2.4 Revision 48548
|


Public Member Functions | |
| __construct ($entries=array()) | |
| setHeight ($height) | |
| setRange ($start_hour, $end_hour) | |
| addColumn ($title, $url="", $id=null) | |
| addEntry ($entry_array) | |
| groupEntries ($grouped=true) | |
| setInsertFunction ($js_function_object) | |
| render ($params=array()) | |
| getEntries () | |
| getMatrix () | |
| getRange () | |
| isGrouped () | |
| getHeight () | |
| getOverallHeight () | |
| getInsertFunction () | |
| getColumns () | |
Protected Member Functions | |
| checkEntries ($entries) | |
Protected Attributes | |
| $entries = array() | |
| $entry_columns = array() | |
| $height = 40 | |
| $grouped = false | |
| $start_hour = 8 | |
| $end_hour = 21 | |
| $insertFunction = "" | |
| $templates = array() | |
| $view_id | |
Static Protected Attributes | |
| static | $number_of_instances = 1 |
Kind of bean class for the calendar view.
Example of use:
// create a calendar-view and add a column $plan = new CalendarView(); $plan->addColumn(_('Spalte 1')) ->addEntry(array( 'id' => 1, 'color' => '#5C2D64', 'start' => '0930', 'end' => '1100', 'title' => 'Mathe 2', 'content' => 'Die Mathematiker kreiden sich mal wieder was an.' ) );
// display the calendar (containing one column) print $plan->render();
| __construct | ( | $entries = array() | ) |
You need to pass an instance of this class to the template. The constructor expects an array of entries of the following type: array( $day_number => array(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 ) ...) ... )
| mixed | $entries | an array of entries (see above) |
| string | $controller | the name of the controller. Used to create links. |

| addColumn | ( | $title, | |
$url = "", |
|||
$id = null |
|||
| ) |
adds a new column to this view. All entries created with addEntry will be added to this column.
| string | $title | like "monday" to be displayed on top of the column |
| string | $url | to be called when clicked on the title of the column |
| string | $id | any kind of id of the column |

| addEntry | ( | $entry_array | ) |
adds a new entry to the last current column. The entry needs to be an associative array with parameters as follows:
| array | $entry_array,: | associative 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 ) |
|
protected |
does some plausability checks on an array of calendar-entries
| mixed | $entries | an array of calendar-entries |

| getColumns | ( | ) |
returns all columns of the calendar-view
Reimplemented in CalendarWeekView.

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

| getHeight | ( | ) |
returns the previously set height for one hour

| getInsertFunction | ( | ) |
returns the previously set javasscript insert-function
Reimplemented in CalendarWeekView.
| 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.

| getOverallHeight | ( | ) |
returns the overall height of the calendar

| getRange | ( | ) |
returns the previously set start- and end-hour, denoting the range of entries to be displayed in the current calendar-view
| groupEntries | ( | $grouped = true | ) |
Call this function to enable/disable the grouping of entries with the same start and end.
| bool | $group | optional, defaults to true |
Reimplemented in CalendarWeekView.

| isGrouped | ( | ) |
the calendar can be used in two modes. Use this function to check, if the grouping-mode is enabled for the current calendar-view
| render | ( | $params = array() | ) |
outputs the CalendarView with all (grouped) dates in columns.
| array | $params | you can pass some additional variables to the templates |

| setHeight | ( | $height | ) |
set the height for one hour. This value is used to calculate the whole height of the schedule.
| int | $entry_height | the height of one hour in the schedule |
| setInsertFunction | ( | $js_function_object | ) |
When a column is clicked at no entry this function is called. First the templates generates a new entry at the clicked time. Then this js-function is called which gets the parameters "function (new_entry_dom_object, column_id, hour) { ... }" with new_entry_dom_object: a real dom-object of the div of the entry column_id: id of the column hour: integer number from 0 to 23 If js_function_object is an empty string, nothing will be done.
| string | $js_function_object | name of js-function or anonymous js-function |
| setRange | ( | $start_hour, | |
| $end_hour | |||
| ) |
set the range of hours to be displayed. the start_hour has to be smaller than the end_hour
| int | $start_hour | the hour to start displaying at |
| int | $end_hour | the hour to stop displaying at |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |