Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
lib.php File Reference

Classes

class  calendar_event
 
class  calendar_information
 Calendar information class. More...
 

Functions

 calendar_add_event_allowed ($event)
 Check wether the current user is permitted to add events.
 
 calendar_add_event_metadata ($event)
 Add calendar event metadata.
 
 calendar_add_icalendar_event ($event, $unused, $subscriptionid, $timezone='UTC')
 Add an iCalendar event to the Moodle calendar.
 
 calendar_add_month ($month, $year)
 Get the next following month.
 
 calendar_add_subscription ($sub)
 Add an iCalendar subscription to the database.
 
 calendar_can_edit_subscription ($subscriptionorid)
 Checks to see if the user can edit a given subscription feed.
 
 calendar_can_manage_non_user_event_in_system ($event)
 Can current user manage a non user event in system context.
 
 calendar_can_manage_user_event ($event)
 Can current user edit/delete/add an user event?
 
 calendar_day_representation ($tstamp, $now=false, $usecommonwords=true)
 Return the representation day.
 
 calendar_days_in_month ($month, $year)
 Return the number of days in month.
 
 calendar_delete_event_allowed ($event)
 Return the capability for deleting a calendar event.
 
 calendar_delete_subscription ($subscription)
 Delete subscription and all related events.
 
 calendar_edit_event_allowed ($event, $manualedit=false)
 Return the capability for editing calendar event.
 
 calendar_events_by_day ($events, $month, $year, &$eventsbyday, &$durationbyday, &$typesbyday, &$courses)
 Get per-day basis events.
 
 calendar_format_event_location (calendar_event $event)
 Format event location property.
 
 calendar_format_event_time ($event, $now, $linkparams=null, $usecommonwords=true, $showtime=0)
 Get event format 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.
 
 calendar_get_allowed_types (&$allowed, $course=null, $groups=null, $category=null)
 Get calendar's allowed types.
 
 calendar_get_calendar_context ($subscription)
 Helper function to determine the context of a calendar subscription.
 
 calendar_get_course_cached (&$coursecache, $courseid)
 Get current course cache.
 
 calendar_get_courselink ($course)
 Get a HTML link to a course.
 
 calendar_get_days ()
 Return the days of the week.
 
 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.
 
 calendar_get_events ($tstart, $tend, $users, $groups, $courses, $withduration=true, $ignorehidden=true, $categories=[])
 Get calendar events.
 
 calendar_get_events_by_id ($eventids)
 Get calendar events by id.
 
 calendar_get_eventtype_choices ($courseid)
 Returns option list of available options for the calendar event type, given the current user and course.
 
 calendar_get_export_import_link_params ()
 Get the list of URL parameters for calendar expport and import links.
 
 calendar_get_export_token (stdClass $user)
 Get the auth token for exporting the given user calendar.
 
 calendar_get_filter_types ()
 Get the list of potential calendar filter types as a type => name combination.
 
 calendar_get_footer_options ($calendar, array $options=[])
 Get the calendar footer options.
 
 calendar_get_group_cached ($groupid)
 Get group from groupid for calendar display.
 
 calendar_get_icalendar ($url)
 From a URL, fetch the calendar and return an iCalendar object.
 
 calendar_get_legacy_events ($tstart, $tend, $users, $groups, $courses, $withduration=true, $ignorehidden=true, $categories=[], $limitnum=0)
 Get legacy calendar events.
 
 calendar_get_link_href ($linkbase, $d, $m, $y, $time=0)
 Adds day, month, year arguments to a URL and returns a moodle_url object.
 
 calendar_get_link_next ($text, $linkbase, $d, $m, $y, $accesshide=false, $time=0)
 Build and return a next month HTML link, with an arrow.
 
 calendar_get_link_previous ($text, $linkbase, $d, $m, $y, $accesshide=false, $time=0)
 Build and return a previous month HTML link, with an arrow.
 
 calendar_get_module_cached (&$modulecache, $modulename, $instance)
 Get current module cache.
 
 calendar_get_pollinterval_choices ()
 Returns option list for the poll interval setting.
 
 calendar_get_starting_weekday ()
 Gets the first day of the week.
 
 calendar_get_subscription ($id)
 Get the subscription from a given id.
 
 calendar_get_timestamp ($d, $m, $y, $time=0)
 Calculate the timestamp from the supplied Gregorian Year, Month, and Day.
 
 calendar_get_view (\calendar_information $calendar, $view, $includenavigation=true, bool $skipevents=false, ?int $lookahead=null)
 Get the calendar view output.
 
 calendar_import_events_from_ical (iCalendar $ical, int $subscriptionid=null)
 Import events from an iCalendar object into a course calendar.
 
 calendar_inplace_editable (string $itemtype, int $itemid, int $newvalue)
 Implements the inplace editable feature.
 
 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.
 
 calendar_is_valid_eventtype ($type)
 Check whether the specified event type is valid.
 
 calendar_output_fragment_event_form ($args)
 Request and render event form fragment.
 
 calendar_set_event_type_display ($type, $display=null, $user=null)
 Sets the display of the event type given $display.
 
 calendar_set_filters (array $courseeventsfrom, $ignorefilters=false, stdClass $user=null)
 Returns the courses to load events for.
 
 calendar_show_event_type ($type, $user=null)
 Checks to see if the requested type of event should be shown for the given user.
 
 calendar_sub_month ($month, $year)
 Get the previous month.
 
 calendar_time_representation ($time)
 return the formatted representation time.
 
 calendar_top_controls ($type, $data)
 Get control options for calendar.
 
 calendar_update_subscription ($subscription)
 Update a calendar subscription.
 
 calendar_update_subscription_events ($subscriptionid)
 Fetch a calendar subscription and update the events in the calendar.
 
 calendar_user_can_add_event ($course)
 See if user can add calendar entries at all used to print the "New Event" button.
 
 calendar_view_event_allowed (calendar_event $event)
 Return the capability for viewing a calendar event.
 
 core_calendar_user_preferences ()
 Implements callback user_preferences, lists preferences that users are allowed to update directly.
 

Variables

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.
 
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_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.