|
Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Tour class. More...
Public Member Functions | |
| add_config_to_form (\MoodleQuickForm &$mform) | |
| Add the step configuration to the form. More... | |
| count_steps () | |
| Count the number of steps in the tour. More... | |
| get_config ($key=null, $default=null) | |
| Get the value of the specified configuration item. More... | |
| get_delete_link () | |
| The link to remove this tour. More... | |
| get_description () | |
| The description associated with the tour. More... | |
| get_duplicate_link () | |
| The link to duplicate this tour. More... | |
| get_edit_link () | |
| The link to edit this tour. More... | |
| get_enabled () | |
| The enabled state of the tour. More... | |
| get_export_link () | |
| The link to export this tour. More... | |
| get_filter_values ($filter) | |
| Get the configured filter values. More... | |
| get_id () | |
| The ID of the tour. More... | |
| get_movedown_link () | |
| Get the link to move this tour down in the sortorder. More... | |
| get_moveup_link () | |
| Get the link to move this tour up in the sortorder. More... | |
| get_name () | |
| The name of the tour. More... | |
| get_pathmatch () | |
| The path match for the tour. More... | |
| get_reset_link () | |
| The link to reset the state of this tour for all users. More... | |
| get_sortorder () | |
| Get the current sortorder for this tour. More... | |
| get_steps () | |
| Fetch all steps in the tour. More... | |
| get_tour_key () | |
| Get the key for this tour. More... | |
| get_view_link () | |
| The link to view this tour. More... | |
| is_enabled () | |
| Whether the tour is currently enabled. More... | |
| is_first_tour () | |
| Whether this tour is the first tour. More... | |
| is_last_tour ($tourcount=null) | |
| Whether this tour is the last tour. More... | |
| mark_major_change () | |
| Update a tour giving it a new major update time. More... | |
| mark_user_completed () | |
| Mark this tour as completed for this user. More... | |
| matches_all_filters (\context $context) | |
| Check whether this tour matches all filters. More... | |
| persist ($force=false) | |
| Save the tour and it's configuration to the database. More... | |
| prepare_data_for_form () | |
| Prepare the configuration data for the moodle form. More... | |
| remove () | |
| Remove this step. | |
| request_user_reset () | |
| Reset the requested by user date. More... | |
| reset_step_sortorder () | |
| Reset the sortorder for all steps in the tour. More... | |
| set_config ($key, $value) | |
| Set the configuration item as specified. More... | |
| set_description ($value) | |
| Set the description of the tour to the specified value. More... | |
| set_enabled ($value) | |
| Set the enabled state of the tour to the specified value. More... | |
| set_filter_values ($filter, array $values=[]) | |
| Set the values for the specified filter. More... | |
| set_name ($value) | |
| Set the name of the tour to the specified value. More... | |
| set_pathmatch ($value) | |
| Set the patchmatch of the tour to the specified value. More... | |
| set_sortorder ($value) | |
| Set the sortorder for this tour. More... | |
| should_show_for_user () | |
| Whether this tour should be displayed to the user. More... | |
| to_record () | |
| Prepare this tour for saving to the database. More... | |
Static Public Member Functions | |
| static | instance ($id) |
| Create an instance of the specified tour. More... | |
| static | load_from_record ($record, $clean=false) |
| Create an instance of tour from its provided DB record. More... | |
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. More... | |
| calculate_sortorder () | |
| Calculate the next sort-order value. More... | |
| fetch ($id) | |
| Fetch the specified tour into the current object. More... | |
| reload () | |
| Reload the current tour from database. More... | |
| reload_from_record ($record, $clean=false) | |
| Reload the tour into the current object. More... | |
| 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_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_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_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.
| stdClass[] |
| 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 | ) |
Check whether this tour matches all filters.
| context | $context | The context to check |
| 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_enabled | ( | $value | ) |
Set the enabled state of the tour to the specified value.
| boolean | $value | The new state. |
| $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 |