Search moodle.org's
Developer Documentation

  • Bug fixes for general core bugs in 3.7.x will end 11 May 2020 (12 months).
  • Bug fixes for security issues in 3.7.x will end 9 November 2020 (18 months) - Support has ended.
  • minimum PHP 7.1.0 Note: minimum PHP version has increased since Moodle 3.6. PHP 7.2.x and 7.3.x are supported too. PHP 7.x could have some engine limitations.
  • Differences Between: [Versions 35 and 37] [Versions 36 and 37] [Versions 37 and 310] [Versions 37 and 311] [Versions 37 and 38] [Versions 37 and 39]

    External calendar API

    Copyright: 2012 Ankit Agarwal
    License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
    File Size: 1373 lines (57 kb)
    Included or required:0 times
    Referenced: 15 times
    Includes or requires: 0 files

    Defines 1 class

    core_calendar_external:: (42 methods):
      delete_calendar_events_parameters()
      delete_calendar_events()
      delete_calendar_events_returns()
      get_calendar_events_parameters()
      get_calendar_events()
      get_calendar_events_returns()
      get_calendar_action_events_by_timesort_parameters()
      get_calendar_action_events_by_timesort()
      get_calendar_action_events_by_timesort_returns()
      get_calendar_action_events_by_course_parameters()
      get_calendar_action_events_by_course()
      get_calendar_action_events_by_course_returns()
      get_calendar_action_events_by_courses_parameters()
      get_calendar_action_events_by_courses()
      get_calendar_action_events_by_courses_returns()
      create_calendar_events_parameters()
      create_calendar_events()
      create_calendar_events_returns()
      get_calendar_event_by_id_parameters()
      get_calendar_event_by_id()
      get_calendar_event_by_id_returns()
      submit_create_update_form_parameters()
      submit_create_update_form()
      submit_create_update_form_returns()
      get_calendar_monthly_view()
      get_calendar_monthly_view_parameters()
      get_calendar_monthly_view_returns()
      get_calendar_day_view()
      get_calendar_day_view_parameters()
      get_calendar_day_view_returns()
      update_event_start_day_parameters()
      update_event_start_day()
      update_event_start_day_returns()
      get_calendar_upcoming_view()
      get_calendar_upcoming_view_parameters()
      get_calendar_upcoming_view_returns()
      get_calendar_access_information_parameters()
      get_calendar_access_information()
      get_calendar_access_information_returns()
      get_allowed_event_types_parameters()
      get_allowed_event_types()
      get_allowed_event_types_returns()


    Class: core_calendar_external  - X-Ref

    Calendar external functions

    delete_calendar_events_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    delete_calendar_events($events)   X-Ref
    Delete Calendar events

    return: null
    param: array $eventids A list of event ids with repeat flag to delete

    delete_calendar_events_returns()   X-Ref
    Returns description of method result value

    return: external_description

    get_calendar_events_parameters()   X-Ref
    Returns description of method parameters

    return: external_function_parameters

    get_calendar_events($events = array()   X-Ref
    Get Calendar events

    return: array Array of event details
    param: array $events A list of events
    param: array $options various options

    get_calendar_events_returns()   X-Ref
    Returns description of method result value

    return: external_description

    get_calendar_action_events_by_timesort_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_action_events_by_timesort($timesortfrom = 0, $timesortto = null,$aftereventid = 0, $limitnum = 20, $limittononsuspendedevents = false,$userid = null)   X-Ref
    Get calendar action events based on the timesort value.

    return: array
    param: null|int $timesortfrom Events after this time (inclusive)
    param: null|int $timesortto Events before this time (inclusive)
    param: null|int $aftereventid Get events with ids greater than this one
    param: int $limitnum Limit the number of results to this value
    param: null|int $userid The user id

    get_calendar_action_events_by_timesort_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    get_calendar_action_events_by_course_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_action_events_by_course($courseid, $timesortfrom = null, $timesortto = null, $aftereventid = 0, $limitnum = 20)   X-Ref
    Get calendar action events for the given course.

    return: array
    param: int $courseid Only events in this course
    param: null|int $timesortfrom Events after this time (inclusive)
    param: null|int $timesortto Events before this time (inclusive)
    param: null|int $aftereventid Get events with ids greater than this one
    param: int $limitnum Limit the number of results to this value

    get_calendar_action_events_by_course_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    get_calendar_action_events_by_courses_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_action_events_by_courses(array $courseids, $timesortfrom = null, $timesortto = null, $limitnum = 10)   X-Ref
    Get calendar action events for a given list of courses.

    return: array
    param: array $courseids Only include events for these courses
    param: null|int $timesortfrom Events after this time (inclusive)
    param: null|int $timesortto Events before this time (inclusive)
    param: int $limitnum Limit the number of results per course to this value

    get_calendar_action_events_by_courses_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    create_calendar_events_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters.

    create_calendar_events($events)   X-Ref
    Create calendar events.

    return: array array of events created.
    param: array $events A list of events to create.

    create_calendar_events_returns()   X-Ref
    Returns description of method result value.

    return: external_description.

    get_calendar_event_by_id_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_event_by_id($eventid)   X-Ref
    Get calendar event by id.

    return: array Array of event details
    param: int $eventid The calendar event id to be retrieved.

    get_calendar_event_by_id_returns()   X-Ref
    Returns description of method result value

    return: external_description

    submit_create_update_form_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters.

    submit_create_update_form($formdata)   X-Ref
    Handles the event form submission.

    return: array The created or modified event
    param: string $formdata The event form data in a URI encoded param string

    submit_create_update_form_returns()   X-Ref
    Returns description of method result value.

    return: external_description.

    get_calendar_monthly_view($year, $month, $courseid, $categoryid, $includenavigation, $mini)   X-Ref
    Get data for the monthly calendar view.

    return: array
    param: int     $year The year to be shown
    param: int     $month The month to be shown
    param: int     $courseid The course to be included
    param: int     $categoryid The category to be included
    param: bool    $includenavigation Whether to include navigation
    param: bool    $mini Whether to return the mini month view or not

    get_calendar_monthly_view_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_monthly_view_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    get_calendar_day_view($year, $month, $day, $courseid, $categoryid)   X-Ref
    Get data for the daily calendar view.

    return: array
    param: int     $year The year to be shown
    param: int     $month The month to be shown
    param: int     $day The day to be shown
    param: int     $courseid The course to be included

    get_calendar_day_view_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_day_view_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    update_event_start_day_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    update_event_start_day($eventid, $daytimestamp)   X-Ref
    Change the start day for the given calendar event to the day that
    corresponds with the provided timestamp.

    The timestamp only needs to be anytime within the desired day as only
    the date data is extracted from it.

    The event's original time of day is maintained, only the date is shifted.

    return: array
    param: int $eventid Id of event to be updated
    param: int $daytimestamp Timestamp for the new start day

    update_event_start_day_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    get_calendar_upcoming_view($courseid, $categoryid)   X-Ref
    Get data for the monthly calendar view.

    return: array
    param: int     $courseid The course to be included
    param: int     $categoryid The category to be included

    get_calendar_upcoming_view_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters

    get_calendar_upcoming_view_returns()   X-Ref
    Returns description of method result value.

    return: external_description

    get_calendar_access_information_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters.

    get_calendar_access_information($courseid = 0)   X-Ref
    Convenience function to retrieve some permissions information for the given course calendar.

    return: array The access information
    param: int $courseid Course to check, empty for site.

    get_calendar_access_information_returns()   X-Ref
    Returns description of method result value.

    return: external_description.

    get_allowed_event_types_parameters()   X-Ref
    Returns description of method parameters.

    return: external_function_parameters.

    get_allowed_event_types($courseid = 0)   X-Ref
    Get the type of events a user can create in the given course.

    return: array The types allowed
    param: int $courseid Course to check, empty for site.

    get_allowed_event_types_returns()   X-Ref
    Returns description of method result value.

    return: external_description.