|
static | create ($time, int $courseid, int $categoryid=null) |
| Creates and set up a instance. More...
|
|
◆ __construct()
calendar_information::__construct |
( |
|
$day = 0 , |
|
|
|
$month = 0 , |
|
|
|
$year = 0 , |
|
|
|
$time = 0 |
|
) |
| |
Creates a new instance.
- Parameters
-
int | $day | the number of the day |
int | $month | the number of the month |
int | $year | the number of the year |
int | $time | the unixtimestamp representing the date we want to view, this is used instead of $calmonth and $calyear to support multiple calendars |
◆ add_sidecalendar_blocks()
calendar_information::add_sidecalendar_blocks |
( |
core_calendar_renderer |
$renderer, |
|
|
|
$showfilters = false , |
|
|
|
$view = null |
|
) |
| |
Adds the pretend blocks for the calendar.
- Parameters
-
core_calendar_renderer | $renderer | |
bool | $showfilters | display filters, false is set as default |
string | null | $view | preference view options (eg: day, month, upcoming) |
◆ checkdate()
calendar_information::checkdate |
( |
|
$defaultonow = true | ) |
|
Ensures the date for the calendar is correct and either sets it to now or throws a moodle_exception if not.
- Parameters
-
bool | $defaultonow | use current time |
- Exceptions
-
- Return values
-
bool | validation of checkdate |
◆ create()
static calendar_information::create |
( |
|
$time, |
|
|
int |
$courseid, |
|
|
int |
$categoryid = null |
|
) |
| |
|
static |
Creates and set up a instance.
- Parameters
-
int | $time | the unixtimestamp representing the date we want to view. |
int | $courseid | The ID of the course the user wishes to view. |
int | $categoryid | The ID of the category the user wishes to view If a courseid is specified, this value is ignored. |
- Return values
-
◆ prepare_for_view()
calendar_information::prepare_for_view |
( |
stdClass |
$course, |
|
|
array |
$coursestoload, |
|
|
|
$ignorefilters = false |
|
) |
| |
Initialize calendar information.
- Deprecated:
- 3.4
- Parameters
-
stdClass | $course | object |
array | $coursestoload | An array of courses [$course->id => $course] |
bool | $ignorefilters | options to use filter |
◆ set_sources()
calendar_information::set_sources |
( |
stdClass |
$course, |
|
|
array |
$courses, |
|
|
stdClass |
$category = null |
|
) |
| |
Set the sources for events within the calendar.
If no category is provided, then the category path for the current course will be used.
- Parameters
-
stdClass | $course | The current course being viewed. |
stdClass[] | $courses | The list of all courses currently accessible. |
stdClass | $category | The current category to show. |
◆ set_time()
calendar_information::set_time |
( |
|
$time = null | ) |
|
Set the time period of this instance.
- Parameters
-
int | $time | the unixtimestamp representing the date we want to view. |
- Return values
-
◆ timestamp_today()
calendar_information::timestamp_today |
( |
| ) |
|
Gets todays timestamp for the calendar.
- Return values
-
◆ timestamp_tomorrow()
calendar_information::timestamp_tomorrow |
( |
| ) |
|
Gets tomorrows timestamp for the calendar.
- Return values
-
◆ $time
int calendar_information::$time |
The timestamp.
Rather than setting the day, month and year we will set a timestamp which will be able to be used by multiple calendars.
The documentation for this class was generated from the following file: