Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Tour class. More...
Public Member Functions | |
add_config_to_form (\MoodleQuickForm &$mform) | |
Add the step configuration to the form. | |
count_steps () | |
Count the number of steps in the tour. | |
get_client_filter_values (array $filters) | |
Gets all filter values for use in client side filters. | |
get_config ($key=null, $default=null) | |
Get the value of the specified configuration item. | |
get_delete_link () | |
The link to remove this tour. | |
get_description () | |
The description associated with the tour. | |
get_display_step_numbers () | |
Get the value of the display step numbers setting. | |
get_duplicate_link () | |
The link to duplicate this tour. | |
get_edit_link () | |
The link to edit this tour. | |
get_enabled () | |
The enabled state of the tour. | |
get_endtourlabel () | |
The end tour label for the tour. | |
get_export_link () | |
The link to export this tour. | |
get_filter_values ($filter) | |
Get the configured filter values. | |
get_id () | |
The ID of the tour. | |
get_movedown_link () | |
Get the link to move this tour down in the sortorder. | |
get_moveup_link () | |
Get the link to move this tour up in the sortorder. | |
get_name () | |
The name of the tour. | |
get_pathmatch () | |
The path match for the tour. | |
get_reset_link () | |
The link to reset the state of this tour for all users. | |
get_sortorder () | |
Get the current sortorder for this tour. | |
get_steps () | |
Fetch all steps in the tour. | |
get_tour_key () | |
Get the key for this tour. | |
get_view_link () | |
The link to view this tour. | |
is_enabled () | |
Whether the tour is currently enabled. | |
is_first_tour () | |
Whether this tour is the first tour. | |
is_last_tour ($tourcount=null) | |
Whether this tour is the last tour. | |
mark_major_change () | |
Update a tour giving it a new major update time. | |
mark_user_completed () | |
Mark this tour as completed for this user. | |
matches_all_filters (\context $context, array $filters=null) | |
Check whether this tour matches all filters. | |
persist ($force=false) | |
Save the tour and it's configuration to the database. | |
prepare_data_for_form () | |
Prepare the configuration data for the moodle form. | |
remove () | |
Remove this step. | |
request_user_reset () | |
Reset the requested by user date. | |
reset_step_sortorder () | |
Reset the sortorder for all steps in the tour. | |
set_config ($key, $value) | |
Set the configuration item as specified. | |
set_description ($value) | |
Set the description of the tour to the specified value. | |
set_display_step_numbers (bool $value) | |
Set the value for the display step numbers setting. | |
set_enabled ($value) | |
Set the enabled state of the tour to the specified value. | |
set_endtourlabel (string $value) | |
Set the endtourlabel of the tour to the specified value. | |
set_filter_values ($filter, array $values=[]) | |
Set the values for the specified filter. | |
set_name ($value) | |
Set the name of the tour to the specified value. | |
set_pathmatch ($value) | |
Set the patchmatch of the tour to the specified value. | |
set_sortorder ($value) | |
Set the sortorder for this tour. | |
should_show_for_user () | |
Whether this tour should be displayed to the user. | |
to_record () | |
Prepare this tour for saving to the database. | |
Static Public Member Functions | |
static | instance ($id) |
Create an instance of the specified tour. | |
static | load_from_record ($record, $clean=false) |
Create an instance of tour from its provided DB record. | |
Public Attributes | |
DISABLED const | DISABLED = 0 |
The tour is currently disabled. | |
DISABLED const | ENABLED = 1 |
The tour is currently disabled. | |
TOUR_LAST_COMPLETED_BY_USER const | TOUR_LAST_COMPLETED_BY_USER = 'tool_usertours_tour_completion_time_' |
The user preference value to indicate the time of completion of the tour for a user. | |
TOUR_REQUESTED_BY_USER const | TOUR_REQUESTED_BY_USER = 'tool_usertours_tour_reset_time_' |
The user preference value to indicate the time that a user last requested to see the tour. | |
Protected Member Functions | |
add_config_field_to_form (\MoodleQuickForm &$mform, $key) | |
Add the specified step field configuration to the form. | |
calculate_sortorder () | |
Calculate the next sort-order value. | |
fetch ($id) | |
Fetch the specified tour into the current object. | |
reload () | |
Reload the current tour from database. | |
reload_from_record ($record, $clean=false) | |
Reload the tour into the current object. | |
remove_user_preferences () | |
Remove stored user preferences for the tour. | |
Tour class.
|
protected |
Add the specified step field configuration to the form.
MoodleQuickForm | $mform | The form to add configuration to. |
string | $key | The key to add. |
$this |
tool_usertours\tour::add_config_to_form | ( | \MoodleQuickForm & | $mform | ) |
Add the step configuration to the form.
MoodleQuickForm | $mform | The form to add configuration to. |
$this |
|
protected |
Calculate the next sort-order value.
int |
tool_usertours\tour::count_steps | ( | ) |
Count the number of steps in the tour.
int |
|
protected |
Fetch the specified tour into the current object.
int | $id | The ID of the tour to fetch. |
tour |
tool_usertours\tour::get_client_filter_values | ( | array | $filters | ) |
Gets all filter values for use in client side filters.
array | $filters | Array of clientside filters. |
array |
tool_usertours\tour::get_config | ( | $key = null, | |
$default = null ) |
Get the value of the specified configuration item.
string | $key | The configuration key to set. |
mixed | $default | The default value to use if a value was not found. |
mixed |
tool_usertours\tour::get_delete_link | ( | ) |
The link to remove this tour.
moodle_url |
tool_usertours\tour::get_description | ( | ) |
The description associated with the tour.
string |
tool_usertours\tour::get_display_step_numbers | ( | ) |
Get the value of the display step numbers setting.
bool |
tool_usertours\tour::get_duplicate_link | ( | ) |
The link to duplicate this tour.
moodle_url |
tool_usertours\tour::get_edit_link | ( | ) |
The link to edit this tour.
moodle_url |
tool_usertours\tour::get_enabled | ( | ) |
The enabled state of the tour.
int |
tool_usertours\tour::get_endtourlabel | ( | ) |
The end tour label for the tour.
string |
tool_usertours\tour::get_export_link | ( | ) |
The link to export this tour.
moodle_url |
tool_usertours\tour::get_filter_values | ( | $filter | ) |
Get the configured filter values.
string | $filter | The filter to retrieve values for. |
array |
tool_usertours\tour::get_id | ( | ) |
The ID of the tour.
int |
tool_usertours\tour::get_movedown_link | ( | ) |
Get the link to move this tour down in the sortorder.
moodle_url |
tool_usertours\tour::get_moveup_link | ( | ) |
Get the link to move this tour up in the sortorder.
moodle_url |
tool_usertours\tour::get_name | ( | ) |
The name of the tour.
string |
tool_usertours\tour::get_pathmatch | ( | ) |
The path match for the tour.
string |
tool_usertours\tour::get_reset_link | ( | ) |
The link to reset the state of this tour for all users.
moodle_url |
tool_usertours\tour::get_sortorder | ( | ) |
Get the current sortorder for this tour.
int |
tool_usertours\tour::get_steps | ( | ) |
Fetch all steps in the tour.
step[] |
tool_usertours\tour::get_tour_key | ( | ) |
Get the key for this tour.
This is used in the session cookie to determine whether the user has seen this tour before.
tool_usertours\tour::get_view_link | ( | ) |
The link to view this tour.
moodle_url |
|
static |
Create an instance of the specified tour.
int | $id | The ID of the tour to load. |
tour |
tool_usertours\tour::is_enabled | ( | ) |
Whether the tour is currently enabled.
boolean |
tool_usertours\tour::is_first_tour | ( | ) |
Whether this tour is the first tour.
boolean |
tool_usertours\tour::is_last_tour | ( | $tourcount = null | ) |
Whether this tour is the last tour.
int | $tourcount | The pre-fetched count of tours |
boolean |
|
static |
Create an instance of tour from its provided DB record.
stdClass | $record | The record of the tour to load. |
boolean | $clean | Clean the values. |
tour |
tool_usertours\tour::mark_major_change | ( | ) |
Update a tour giving it a new major update time.
This will ensure that it is displayed to all users, even those who have already seen it.
$this |
tool_usertours\tour::mark_user_completed | ( | ) |
Mark this tour as completed for this user.
$this |
tool_usertours\tour::matches_all_filters | ( | \context | $context, |
array | $filters = null ) |
Check whether this tour matches all filters.
context | $context | The context to check. |
array | null | $filters | Optional array of filters. |
bool |
tool_usertours\tour::persist | ( | $force = false | ) |
Save the tour and it's configuration to the database.
boolean | $force | Whether to force writing to the database. |
$this |
tool_usertours\tour::prepare_data_for_form | ( | ) |
Prepare the configuration data for the moodle form.
object |
|
protected |
Reload the current tour from database.
tour |
|
protected |
Reload the tour into the current object.
stdClass | $record | The record to reload. |
boolean | $clean | Clean the values. |
tour |
tool_usertours\tour::request_user_reset | ( | ) |
Reset the requested by user date.
$this |
tool_usertours\tour::reset_step_sortorder | ( | ) |
Reset the sortorder for all steps in the tour.
$this |
tool_usertours\tour::set_config | ( | $key, | |
$value ) |
Set the configuration item as specified.
string | $key | The configuration key to set. |
mixed | $value | The new value for the configuration item. |
$this |
tool_usertours\tour::set_description | ( | $value | ) |
Set the description of the tour to the specified value.
string | $value | The new description. |
$this |
tool_usertours\tour::set_display_step_numbers | ( | bool | $value | ) |
Set the value for the display step numbers setting.
bool | $value | True for enable. |
$this |
tool_usertours\tour::set_enabled | ( | $value | ) |
Set the enabled state of the tour to the specified value.
boolean | $value | The new state. |
$this |
tool_usertours\tour::set_endtourlabel | ( | string | $value | ) |
Set the endtourlabel of the tour to the specified value.
string | $value |
$this |
tool_usertours\tour::set_filter_values | ( | $filter, | |
array | $values = [] ) |
Set the values for the specified filter.
string | $filter | The filter to set. |
array | $values | The values to set. |
$this |
tool_usertours\tour::set_name | ( | $value | ) |
Set the name of the tour to the specified value.
string | $value | The new name. |
$this |
tool_usertours\tour::set_pathmatch | ( | $value | ) |
Set the patchmatch of the tour to the specified value.
string | $value | The new patchmatch. |
$this |
tool_usertours\tour::set_sortorder | ( | $value | ) |
Set the sortorder for this tour.
int | $value | The new sortorder to use. |
$this |
tool_usertours\tour::should_show_for_user | ( | ) |
Whether this tour should be displayed to the user.
boolean |
tool_usertours\tour::to_record | ( | ) |
Prepare this tour for saving to the database.
object |