Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Files | |
file | action.php |
Class representing an action a user should take. | |
file | action_event.php |
Calendar action event class. | |
file | action_event_interface.php |
Calendar action event interface. | |
file | action_factory.php |
Action factory. | |
file | action_factory_interface.php |
Action factory interface. | |
file | action_interface.php |
Action interface. | |
file | api.php |
Contains class containing the internal calendar API. | |
file | behat_calendar.php |
Behat calendar-related steps definitions. | |
file | calendar_day_exporter.php |
Contains event class for displaying the day view. | |
file | calendar_event_exporter.php |
Contains event class for displaying a calendar event. | |
file | calendar_upcoming_exporter.php |
Contains event class for displaying the upcoming view. | |
file | calendartype_test_example.php |
Handles calendar functions for the test calendar. | |
file | cm_info_proxy.php |
Course module cm_info proxy. | |
file | container.php |
Core container for calendar events. | |
file | coursecat_proxy.php |
Course category proxy. | |
file | create.php |
The mform for creating a calendar event. | |
file | create_update_form_mapper.php |
Event create form and update form mapper. | |
file | create_update_form_mapper_interface.php |
Create update form mapper interface. | |
file | date_exporter.php |
Class for normalising the date data. | |
file | day_exporter.php |
Contains event class for displaying the day view. | |
file | day_name_exporter.php |
Contains event class for displaying the day name. | |
file | description_interface.php |
Description value object interface. | |
file | event.php |
Calendar event class. | |
file | event_abstract_factory.php |
Abstract event factory. | |
file | event_action_exporter.php |
Contains event class for displaying a calendar event's action. | |
file | event_collection_interface.php |
Interface for an event collection class. | |
file | event_description.php |
Description value object. | |
file | event_exporter.php |
Contains event class for displaying a calendar event. | |
file | event_exporter_base.php |
Contains event class for displaying a calendar event. | |
file | event_factory.php |
Event factory class. | |
file | event_factory_interface.php |
Event factory interface. | |
file | event_icon_exporter.php |
Contains event class for displaying a calendar event's icon. | |
file | event_interface.php |
Calendar event interface. | |
file | event_mapper.php |
Event mapper. | |
file | event_mapper_interface.php |
Event mapper interface. | |
file | event_subscription_exporter.php |
Contains event class for displaying a calendar event's subscription. | |
file | event_times.php |
Event times class. | |
file | event_vault.php |
Event vault class. | |
file | event_vault_interface.php |
Event vault interface. | |
file | events_exporter.php |
Contains event class for displaying a list of calendar events. | |
file | events_grouped_by_course_exporter.php |
Contains event class for displaying a list of calendar events grouped by course id. | |
file | events_related_objects_cache.php |
Contains event class for providing the related objects when exporting a list of calendar events. | |
file | events_same_course_exporter.php |
Contains event class for displaying a list of calendar events for a single course. | |
file | eventtype.php |
The trait for adding eventtype fields to a form. | |
file | export_form.php |
The mform for exporting calendar events. | |
file | externallib.php |
External calendar API. | |
file | footer_options_exporter.php |
Class for exporting calendar footer view options data. | |
file | helpers.php |
This file contains helper classes and functions for testing. | |
file | invalid_callback_exception.php |
Invalid callback exception. | |
file | invalid_parameter_exception.php |
General invalid parameter exception. | |
file | lib.php |
Calendar extension. | |
file | limit_invalid_parameter_exception.php |
Invalid limit parameter exception. | |
file | member_does_not_exist_exception.php |
Member does not exist exception. | |
file | month_exporter.php |
Contains event class for displaying the month view. | |
file | provider.php |
Privacy class for requesting user data. | |
file | proxy_interface.php |
Proxy interface. | |
file | raw_event_retrieval_strategy.php |
Raw event retrieval strategy. | |
file | raw_event_retrieval_strategy_interface.php |
Raw event strategy retrieval interface. | |
file | repeat_event_collection.php |
Event collection class. | |
file | rrule_manager.php |
Defines calendar class to manage recurrence rule (rrule) during ical imports. | |
file | std_proxy.php |
std_proxy class. | |
file | times_interface.php |
Times interface. | |
file | timesort_invalid_parameter_exception.php |
Invalid timesort parameter exception. | |
file | type_base.php |
Defines functions used by calendar type plugins. | |
file | type_factory.php |
Class core_calendar\type_factory. | |
file | update.php |
The mform for updating a calendar event. | |
file | week_day_exporter.php |
Contains event class for displaying the day on month view. | |
file | week_exporter.php |
Contains event class for displaying the week view. | |
Functions | |
calendar_add_event_allowed ($event) | |
Check wether the current user is permitted to add events. More... | |
calendar_add_event_metadata ($event) | |
Add calendar event metadata. More... | |
calendar_add_icalendar_event ($event, $unused=null, $subscriptionid, $timezone='UTC') | |
Add an iCalendar event to the Moodle calendar. More... | |
calendar_add_month ($month, $year) | |
Get the next following month. More... | |
calendar_add_subscription ($sub) | |
Add an iCalendar subscription to the database. More... | |
calendar_can_edit_subscription ($subscriptionorid) | |
Checks to see if the user can edit a given subscription feed. More... | |
calendar_day_representation ($tstamp, $now=false, $usecommonwords=true) | |
Return the representation day. More... | |
calendar_days_in_month ($month, $year) | |
Return the number of days in month. More... | |
calendar_delete_event_allowed ($event) | |
Return the capability for deleting a calendar event. More... | |
calendar_delete_subscription ($subscription) | |
Delete subscription and all related events. More... | |
calendar_edit_event_allowed ($event, $manualedit=false) | |
Return the capability for editing calendar event. More... | |
calendar_events_by_day ($events, $month, $year, &$eventsbyday, &$durationbyday, &$typesbyday, &$courses) | |
Get per-day basis events. More... | |
calendar_format_event_time ($event, $now, $linkparams=null, $usecommonwords=true, $showtime=0) | |
Get event format time. More... | |
calendar_get_allowed_event_types (int $courseid=null) | |
Get event types the user can create event based on categories, courses and groups the logged in user belongs to. More... | |
calendar_get_allowed_types (&$allowed, $course=null, $groups=null, $category=null) | |
Get calendar's allowed types. More... | |
calendar_get_calendar_context ($subscription) | |
Helper function to determine the context of a calendar subscription. More... | |
calendar_get_course_cached (&$coursecache, $courseid) | |
Get current course cache. More... | |
calendar_get_courselink ($course) | |
Get a HTML link to a course. More... | |
calendar_get_days () | |
Return the days of the week. More... | |
calendar_get_default_courses ($courseid=null, $fields=' *', $canmanage=false, int $userid=null) | |
Returns the default courses to display on the calendar when there isn't a specific course to display. More... | |
calendar_get_events ($tstart, $tend, $users, $groups, $courses, $withduration=true, $ignorehidden=true, $categories=[]) | |
Get calendar events. More... | |
calendar_get_events_by_id ($eventids) | |
Get calendar events by id. More... | |
calendar_get_eventtype_choices ($courseid) | |
Returns option list of available options for the calendar event type, given the current user and course. More... | |
calendar_get_filter_types () | |
Get the list of potential calendar filter types as a type => name combination. More... | |
calendar_get_footer_options ($calendar) | |
Get the calendar footer options. More... | |
calendar_get_group_cached ($groupid) | |
Get group from groupid for calendar display. More... | |
calendar_get_icalendar ($url) | |
From a URL, fetch the calendar and return an iCalendar object. More... | |
calendar_get_legacy_events ($tstart, $tend, $users, $groups, $courses, $withduration=true, $ignorehidden=true, $categories=[], $limitnum=0) | |
Get legacy calendar events. More... | |
calendar_get_link_href ($linkbase, $d, $m, $y, $time=0) | |
Adds day, month, year arguments to a URL and returns a moodle_url object. More... | |
calendar_get_link_next ($text, $linkbase, $d, $m, $y, $accesshide=false, $time=0) | |
Build and return a next month HTML link, with an arrow. More... | |
calendar_get_link_previous ($text, $linkbase, $d, $m, $y, $accesshide=false, $time=0) | |
Build and return a previous month HTML link, with an arrow. More... | |
calendar_get_module_cached (&$modulecache, $modulename, $instance) | |
Get current module cache. More... | |
calendar_get_pollinterval_choices () | |
Returns option list for the poll interval setting. More... | |
calendar_get_starting_weekday () | |
Gets the first day of the week. More... | |
calendar_get_subscription ($id) | |
Get the subscription from a given id. More... | |
calendar_get_timestamp ($d, $m, $y, $time=0) | |
Calculate the timestamp from the supplied Gregorian Year, Month, and Day. More... | |
calendar_get_view (\calendar_information $calendar, $view, $includenavigation=true, bool $skipevents=false, ?int $lookahead=null) | |
Get the calendar view output. More... | |
calendar_import_icalendar_events ($ical, $unused=null, $subscriptionid=null) | |
Import events from an iCalendar object into a course calendar. More... | |
calendar_internal_update_course_and_group_permission (int $courseid, context $context, array &$types) | |
Given a course id, and context, updates the permission types array to add the 'course' or 'group' permission if it is relevant for that course. More... | |
calendar_is_valid_eventtype ($type) | |
Check whether the specified event type is valid. More... | |
calendar_output_fragment_event_form ($args) | |
Request and render event form fragment. More... | |
calendar_process_subscription_row ($subscriptionid, $pollinterval, $action) | |
Update a subscription from the form data in one of the rows in the existing subscriptions table. More... | |
calendar_set_event_type_display ($type, $display=null, $user=null) | |
Sets the display of the event type given $display. More... | |
calendar_set_filters (array $courseeventsfrom, $ignorefilters=false, stdClass $user=null) | |
Returns the courses to load events for. More... | |
calendar_show_event_type ($type, $user=null) | |
Checks to see if the requested type of event should be shown for the given user. More... | |
calendar_sub_month ($month, $year) | |
Get the previous month. More... | |
calendar_time_representation ($time) | |
return the formatted representation time. More... | |
calendar_top_controls ($type, $data) | |
Get control options for calendar. More... | |
calendar_update_subscription ($subscription) | |
Update a calendar subscription. More... | |
calendar_update_subscription_events ($subscriptionid) | |
Fetch a calendar subscription and update the events in the calendar. More... | |
calendar_user_can_add_event ($course) | |
See if user can add calendar entries at all used to print the "New Event" button. More... | |
calendar_view_event_allowed (calendar_event $event) | |
Return the capability for viewing a calendar event. More... | |
core_calendar_user_preferences () | |
Implements callback user_preferences, whitelists preferences that users are allowed to update directly. More... | |
create_event ($properties) | |
Create a calendar event with the given properties. More... | |
Variables | |
global | $CFG |
const | CALENDAR_DEFAULT_STARTING_WEEKDAY 1 |
CALENDAR_DEFAULT_STARTING_WEEKDAY - default value to display the starting weekday. | |
const | CALENDAR_DEFAULT_UPCOMING_LOOKAHEAD (!defined('MOODLE_INTERNAL')) 21 |
These are read by the administration component to provide default values. More... | |
const | CALENDAR_DEFAULT_UPCOMING_MAXEVENTS 10 |
CALENDAR_DEFAULT_UPCOMING_MAXEVENTS - default value to display the maximum number of upcoming event. | |
const | CALENDAR_DEFAULT_WEEKEND 65 |
CALENDAR_DEFAULT_WEEKEND - default value for weekend (Saturday & Sunday) | |
const | CALENDAR_EVENT_COURSE 2 |
CALENDAR_EVENT_COURSE - Course calendar event types. | |
const | CALENDAR_EVENT_COURSECAT 16 |
CALENDAR_EVENT_COURSECAT - Course category calendar event types. | |
const | CALENDAR_EVENT_GLOBAL 1 |
CALENDAR_EVENT_GLOBAL - Site calendar event types. More... | |
const | CALENDAR_EVENT_GROUP 4 |
CALENDAR_EVENT_GROUP - group calendar event types. | |
const | CALENDAR_EVENT_SITE 1 |
CALENDAR_EVENT_SITE - Site calendar event types. | |
const | CALENDAR_EVENT_TYPE_ACTION 1 |
CALENDAR_EVENT_TYPE_ACTION - Action events. | |
const | CALENDAR_EVENT_TYPE_STANDARD 0 |
CALENDAR_EVENT_TYPE_STANDARD - Standard events. | |
const | CALENDAR_EVENT_USER 8 |
CALENDAR_EVENT_USER - user calendar event types. | |
const | CALENDAR_EVENT_USER_OVERRIDE_PRIORITY 0 |
CALENDAR_EVENT_USER_OVERRIDE_PRIORITY - Constant for the user override priority. | |
const | CALENDAR_IMPORT_EVENT_INSERTED 2 |
CALENDAR_IMPORT_EVENT_INSERTED - imported event was added by insert. | |
const | CALENDAR_IMPORT_EVENT_SKIPPED -1 |
CALENDAR_IMPORT_EVENT_UPDATED_SKIPPED - imported event was skipped. | |
const | CALENDAR_IMPORT_EVENT_UPDATED 1 |
CALENDAR_IMPORT_EVENT_UPDATED - imported event was updated. | |
const | CALENDAR_IMPORT_FROM_FILE 0 |
CALENDAR_IMPORT_FROM_FILE - import the calendar from a file. | |
const | CALENDAR_IMPORT_FROM_URL 1 |
CALENDAR_IMPORT_FROM_URL - import the calendar from a URL. | |
const | CALENDAR_SUBSCRIPTION_REMOVE 2 |
CALENDAR_SUBSCRIPTION_REMOVE - Used to represent remove action for subscriptions in various forms. | |
const | CALENDAR_SUBSCRIPTION_UPDATE 1 |
CALENDAR_SUBSCRIPTION_UPDATE - Used to represent update action for subscriptions in various forms. | |
const | CALENDAR_TF_12 '%I:%M %p' |
CALENDAR_TF_12 - Calendar time in 12 hours format. | |
const | CALENDAR_TF_24 '%H:%M' |
CALENDAR_TF_24 - Calendar time in 24 hours format. | |
const | CALENDAR_URL $CFG->wwwroot.'/calendar/' |
CALENDAR_URL - path to calendar's folder. | |
if (!defined( 'MOODLE_INTERNAL')) | |
calendar_add_event_allowed | ( | $event | ) |
Check wether the current user is permitted to add events.
stdClass | $event | object of event |
bool | has the capability to add event |
calendar_add_event_metadata | ( | $event | ) |
Add calendar event metadata.
stdClass | $event | event info |
stdClass::$event | metadata |
calendar_add_icalendar_event | ( | $event, | |
$unused = null , |
|||
$subscriptionid, | |||
$timezone = 'UTC' |
|||
) |
Add an iCalendar event to the Moodle calendar.
stdClass | $event | The RFC-2445 iCalendar event |
int | $unused | Deprecated |
int | $subscriptionid | The iCalendar subscription ID |
string | $timezone | The X-WR-TIMEZONE iCalendar property if provided |
dml_exception | A DML specific exception is thrown for invalid subscriptionids. |
int | Code: CALENDAR_IMPORT_EVENT_UPDATED = updated, CALENDAR_IMPORT_EVENT_INSERTED = inserted, 0 = error |
calendar_add_month | ( | $month, | |
$year | |||
) |
Get the next following month.
int | $month | the number of the month. |
int | $year | the number of the year. |
array | the following month |
calendar_add_subscription | ( | $sub | ) |
Add an iCalendar subscription to the database.
stdClass | $sub | The subscription object (e.g. from the form) |
int | The insert ID, if any. |
calendar_can_edit_subscription | ( | $subscriptionorid | ) |
Checks to see if the user can edit a given subscription feed.
mixed | $subscriptionorid | Subscription object or id |
bool | true if current user can edit the subscription else false |
calendar_day_representation | ( | $tstamp, | |
$now = false , |
|||
$usecommonwords = true |
|||
) |
Return the representation day.
int | $tstamp | Timestamp in GMT |
int | bool | $now | current Unix timestamp |
bool | $usecommonwords |
string | the formatted date/time |
calendar_days_in_month | ( | $month, | |
$year | |||
) |
Return the number of days in month.
int | $month | the number of the month. |
int | $year | the number of the year |
int |
calendar_delete_event_allowed | ( | $event | ) |
Return the capability for deleting a calendar event.
calendar_event | $event | The event object |
bool | Whether the user has permission to delete the event or not. |
calendar_delete_subscription | ( | $subscription | ) |
Delete subscription and all related events.
int | stdClass | $subscription | subscription or it's id, which needs to be deleted. |
calendar_edit_event_allowed | ( | $event, | |
$manualedit = false |
|||
) |
Return the capability for editing calendar event.
calendar_event | $event | event object |
bool | $manualedit | is the event being edited manually by the user |
bool | capability to edit event |
calendar_events_by_day | ( | $events, | |
$month, | |||
$year, | |||
& | $eventsbyday, | ||
& | $durationbyday, | ||
& | $typesbyday, | ||
& | $courses | ||
) |
Get per-day basis events.
array | $events | list of events |
int | $month | the number of the month |
int | $year | the number of the year |
array | $eventsbyday | event on specific day |
array | $durationbyday | duration of the event in days |
array | $typesbyday | event type (eg: site, course, user, or group) |
array | $courses | list of courses |
void |
calendar_format_event_time | ( | $event, | |
$now, | |||
$linkparams = null , |
|||
$usecommonwords = true , |
|||
$showtime = 0 |
|||
) |
Get event format time.
calendar_event | $event | event object |
int | $now | current time in gmt |
array | $linkparams | list of params for event link |
bool | $usecommonwords | the words as formatted date/time. |
int | $showtime | determine the show time GMT timestamp |
string::$eventtime | link/string for event time |
calendar_get_allowed_event_types | ( | int | $courseid = null | ) |
Get event types the user can create event based on categories, courses and groups the logged in user belongs to.
int | null | $courseid | The course id. |
array | The array of allowed types. |
calendar_get_allowed_types | ( | & | $allowed, |
$course = null , |
|||
$groups = null , |
|||
$category = null |
|||
) |
Get calendar's allowed types.
stdClass | $allowed | list of allowed edit for event type |
stdClass | int | $course | object of a course or course id |
array | $groups | array of groups for the given course |
stdClass | int | $category | object of a category |
calendar_get_calendar_context | ( | $subscription | ) |
Helper function to determine the context of a calendar subscription.
Subscriptions can be created in two contexts COURSE, or USER.
stdClass | $subscription |
context | instance |
calendar_get_course_cached | ( | & | $coursecache, |
$courseid | |||
) |
Get current course cache.
array | $coursecache | list of course cache |
int | $courseid | id of the course |
stdClass::$coursecache,[$courseid] | return the specific course cache |
calendar_get_courselink | ( | $course | ) |
Get a HTML link to a course.
int | stdClass | $course | the course id or course object |
string | a link to the course (as HTML); empty if the course id is invalid |
calendar_get_days | ( | ) |
Return the days of the week.
array | array of days |
calendar_get_default_courses | ( | $courseid = null , |
|
$fields = '*' , |
|||
$canmanage = false , |
|||
int | $userid = null |
||
) |
Returns the default courses to display on the calendar when there isn't a specific course to display.
int | $courseid | (optional) If passed, an additional course can be returned for admins (the current course). |
string | $fields | Comma separated list of course fields to return. |
bool | $canmanage | If true, this will return the list of courses the user can create events in, rather than the list of courses they see events from (an admin can always add events in a course calendar, even if they are not enrolled in the course). |
int | $userid | (optional) The user which this function returns the default courses for. By default the current user. |
array::$courses | Array of courses to display |
calendar_get_events | ( | $tstart, | |
$tend, | |||
$users, | |||
$groups, | |||
$courses, | |||
$withduration = true , |
|||
$ignorehidden = true , |
|||
$categories = [] |
|||
) |
Get calendar events.
int | $tstart | Start time of time range for events |
int | $tend | End time of time range for events |
array | int | boolean | $users | array of users, user id or boolean for all/no user events |
array | int | boolean | $groups | array of groups, group id or boolean for all/no group events |
array | int | boolean | $courses | array of courses, course id or boolean for all/no course events |
boolean | $withduration | whether only events starting within time range selected or events in progress/already started selected as well |
boolean | $ignorehidden | whether to select only visible events or all events |
array | int | boolean | $categories | array of categories, category id or boolean for all/no course events |
array::$events | of selected events or an empty array if there aren't any (or there was an error) |
calendar_get_events_by_id | ( | $eventids | ) |
Get calendar events by id.
array | $eventids | list of event ids |
array | Array of event entries, empty array if nothing found |
calendar_get_eventtype_choices | ( | $courseid | ) |
Returns option list of available options for the calendar event type, given the current user and course.
int | $courseid | The id of the course |
array | An array containing the event types the user can create. |
calendar_get_filter_types | ( | ) |
Get the list of potential calendar filter types as a type => name combination.
array |
calendar_get_footer_options | ( | $calendar | ) |
Get the calendar footer options.
calendar_information | $calendar | The calendar information object. |
array | The data for template and template name. |
calendar_get_group_cached | ( | $groupid | ) |
Get group from groupid for calendar display.
int | $groupid |
stdClass | group object with fields 'id', 'name' and 'courseid' |
calendar_get_icalendar | ( | $url | ) |
From a URL, fetch the calendar and return an iCalendar object.
string | $url | The iCalendar URL |
iCalendar | The iCalendar object |
calendar_get_legacy_events | ( | $tstart, | |
$tend, | |||
$users, | |||
$groups, | |||
$courses, | |||
$withduration = true , |
|||
$ignorehidden = true , |
|||
$categories = [] , |
|||
$limitnum = 0 |
|||
) |
Get legacy calendar events.
int | $tstart | Start time of time range for events |
int | $tend | End time of time range for events |
array | int | boolean | $users | array of users, user id or boolean for all/no user events |
array | int | boolean | $groups | array of groups, group id or boolean for all/no group events |
array | int | boolean | $courses | array of courses, course id or boolean for all/no course events |
boolean | $withduration | whether only events starting within time range selected or events in progress/already started selected as well |
boolean | $ignorehidden | whether to select only visible events or all events |
array | $categories | array of category ids and/or objects. |
int | $limitnum | Number of events to fetch or zero to fetch all. |
array::$events | of selected events or an empty array if there aren't any (or there was an error) |
calendar_get_link_href | ( | $linkbase, | |
$d, | |||
$m, | |||
$y, | |||
$time = 0 |
|||
) |
Adds day, month, year arguments to a URL and returns a moodle_url object.
string | moodle_url | $linkbase | |
int | $d | The number of the day. |
int | $m | The number of the month. |
int | $y | The number of the year. |
int | $time | the unixtime, used for multiple calendar support. The values $d, $m and $y are kept for backwards compatibility. |
moodle_url|null::$linkbase |
calendar_get_link_next | ( | $text, | |
$linkbase, | |||
$d, | |||
$m, | |||
$y, | |||
$accesshide = false , |
|||
$time = 0 |
|||
) |
Build and return a next month HTML link, with an arrow.
string | $text | The text label. |
string | moodle_url | $linkbase | The URL stub. |
int | $d | the number of the Day |
int | $m | The number of the month. |
int | $y | The number of the year. |
bool | $accesshide | Default visible, or hide from all except screenreaders. |
int | $time | the unixtime, used for multiple calendar support. The values $d, $m and $y are kept for backwards compatibility. |
string | HTML string. |
calendar_get_link_previous | ( | $text, | |
$linkbase, | |||
$d, | |||
$m, | |||
$y, | |||
$accesshide = false , |
|||
$time = 0 |
|||
) |
Build and return a previous month HTML link, with an arrow.
string | $text | The text label. |
string | moodle_url | $linkbase | The URL stub. |
int | $d | The number of the date. |
int | $m | The number of the month. |
int | $y | year The number of the year. |
bool | $accesshide | Default visible, or hide from all except screenreaders. |
int | $time | the unixtime, used for multiple calendar support. The values $d, $m and $y are kept for backwards compatibility. |
string | HTML string. |
calendar_get_module_cached | ( | & | $modulecache, |
$modulename, | |||
$instance | |||
) |
Get current module cache.
Only use this method if you do not know courseid. Otherwise use: get_fast_modinfo($courseid)->instances[$modulename][$instance]
array | $modulecache | in memory module cache |
string | $modulename | name of the module |
int | $instance | module instance number |
stdClass|bool::$module | information |
calendar_get_pollinterval_choices | ( | ) |
Returns option list for the poll interval setting.
array | An array of poll interval options. Interval => description. |
calendar_get_starting_weekday | ( | ) |
Gets the first day of the week.
Used to be define('CALENDAR_STARTING_WEEKDAY', blah);
int |
calendar_get_subscription | ( | $id | ) |
Get the subscription from a given id.
int | $id | id of the subscription |
stdClass | Subscription record from DB |
moodle_exception | for an invalid id |
calendar_get_timestamp | ( | $d, | |
$m, | |||
$y, | |||
$time = 0 |
|||
) |
Calculate the timestamp from the supplied Gregorian Year, Month, and Day.
int | $d | The day |
int | $m | The month |
int | $y | The year |
int | $time | The timestamp to use instead of a separate y/m/d. |
int | The timestamp |
calendar_get_view | ( | \calendar_information | $calendar, |
$view, | |||
$includenavigation = true , |
|||
bool | $skipevents = false , |
||
?int | $lookahead = null |
||
) |
Get the calendar view output.
calendar_information | $calendar | The calendar being represented |
string | $view | The type of calendar to have displayed |
bool | $includenavigation | Whether to include navigation |
bool | $skipevents | Whether to load the events or not |
int | $lookahead | Overwrites site and users's lookahead setting. |
array[array,string] |
calendar_import_icalendar_events | ( | $ical, | |
$unused = null , |
|||
$subscriptionid = null |
|||
) |
Import events from an iCalendar object into a course calendar.
iCalendar | $ical | The iCalendar object. |
int | $unused | Deprecated |
int | $subscriptionid | The subscription ID. |
string | A log of the import progress, including errors. |
calendar_internal_update_course_and_group_permission | ( | int | $courseid, |
context | $context, | ||
array & | $types | ||
) |
Given a course id, and context, updates the permission types array to add the 'course' or 'group' permission if it is relevant for that course.
For efficiency, if they already have 'course' or 'group' then it skips checks.
Do not call this function directly, it is only for use by calendar_get_allowed_event_types().
int | $courseid | Course id |
context | $context | Context for that course |
array | $types | Current permissions |
calendar_is_valid_eventtype | ( | $type | ) |
Check whether the specified event type is valid.
string | $type |
bool |
calendar_output_fragment_event_form | ( | $args | ) |
Request and render event form fragment.
array | $args | The fragment arguments. |
string | The rendered mform fragment. |
calendar_process_subscription_row | ( | $subscriptionid, | |
$pollinterval, | |||
$action | |||
) |
Update a subscription from the form data in one of the rows in the existing subscriptions table.
int | $subscriptionid | The ID of the subscription we are acting upon. |
int | $pollinterval | The poll interval to use. |
int | $action | The action to be performed. One of update or remove. |
dml_exception | if invalid subscriptionid is provided |
string | A log of the import progress, including errors |
calendar_set_event_type_display | ( | $type, | |
$display = null , |
|||
$user = null |
|||
) |
Sets the display of the event type given $display.
If $display = true the event type will be shown. If $display = false the event type will NOT be shown. If $display = null the current value will be toggled and saved.
int | $type | object of CALENDAR_EVENT_XXX |
bool | $display | option to display event type |
stdClass | int | $user | moodle user object or id, null means current user |
calendar_set_filters | ( | array | $courseeventsfrom, |
$ignorefilters = false , |
|||
stdClass | $user = null |
||
) |
Returns the courses to load events for.
array | $courseeventsfrom | An array of courses to load calendar events for |
bool | $ignorefilters | specify the use of filters, false is set as default |
stdClass | $user | The user object. This defaults to the global $USER object. |
array | An array of courses, groups, and user to load calendar events for based upon filters |
calendar_show_event_type | ( | $type, | |
$user = null |
|||
) |
Checks to see if the requested type of event should be shown for the given user.
int | $type | The type to check the display for (default is to display all) |
stdClass | int | null | $user | The user to check for - by default the current user |
bool | True if the tyep should be displayed false otherwise |
calendar_sub_month | ( | $month, | |
$year | |||
) |
Get the previous month.
int | $month | the number of the month. |
int | $year | the number of the year. |
array | previous month |
calendar_time_representation | ( | $time | ) |
return the formatted representation time.
int | $time | the timestamp in UTC, as obtained from the database |
string | the formatted date/time |
calendar_top_controls | ( | $type, | |
$data | |||
) |
Get control options for calendar.
string | $type | of calendar |
array | $data | calendar information |
string::$content | return available control for the calender in html |
calendar_update_subscription | ( | $subscription | ) |
Update a calendar subscription.
Also updates the associated cache.
stdClass | array | $subscription | Subscription record. |
coding_exception | If something goes wrong |
calendar_update_subscription_events | ( | $subscriptionid | ) |
Fetch a calendar subscription and update the events in the calendar.
int | $subscriptionid | The course ID for the calendar. |
string | A log of the import progress, including errors. |
calendar_user_can_add_event | ( | $course | ) |
See if user can add calendar entries at all used to print the "New Event" button.
stdClass | $course | object of a course or course id |
bool | has the capability to add at least one event type |
calendar_view_event_allowed | ( | calendar_event | $event | ) |
Return the capability for viewing a calendar event.
calendar_event | $event | event object |
boolean |
core_calendar_user_preferences | ( | ) |
Implements callback user_preferences, whitelists preferences that users are allowed to update directly.
Used in {
array |
create_event | ( | $properties | ) |
Create a calendar event with the given properties.
array | $properties | The properties to set on the event |
calendar_event |
const CALENDAR_DEFAULT_UPCOMING_LOOKAHEAD(!defined( 'MOODLE_INTERNAL')) 21 |
These are read by the administration component to provide default values.
CALENDAR_DEFAULT_UPCOMING_LOOKAHEAD - default value of upcoming event preference
const CALENDAR_EVENT_GLOBAL 1 |
CALENDAR_EVENT_GLOBAL - Site calendar event types.