Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool_usertours\step Class Reference

Step class. More...

Public Member Functions

 add_config_field_to_form (\MoodleQuickForm $mform, $key)
 Add the specified step field configuration to the form.
 
 add_config_to_form (\MoodleQuickForm $mform)
 Add the step configuration to the form.
 
 get_config ($key=null, $default=null)
 Get the value of the specified configuration item.
 
 get_content ()
 Get the body content of the step.
 
 get_contentformat ()
 Get the content format of the step.
 
 get_delete_link ()
 Get the delete link for this step.
 
 get_edit_link ()
 Get the edit link for this step.
 
 get_id ()
 Get the ID of the step.
 
 get_movedown_link ()
 Get the link to move this step down in the sortorder.
 
 get_moveup_link ()
 Get the link to move this step up in the sortorder.
 
 get_placement_options ()
 Get the list of possible placement options.
 
 get_sortorder ()
 Get the current sortorder for this step.
 
 get_target ()
 Get the target instance for this step.
 
 get_targettype ()
 Get the content value for this step.
 
 get_targetvalue ()
 Get the target value for this step.
 
 get_title ()
 Get the Title of the step.
 
 get_tour ()
 Get the Tour instance that this step belongs to.
 
 get_tourid ()
 Get the Tour ID of the step.
 
 handle_form_submission (local\forms\editstep &$mform, stdClass $data)
 Handle submission of the step editing form.
 
 is_first_step ()
 Whether this step is the first step in the tour.
 
 is_last_step ()
 Whether this step is the last step in the tour.
 
 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.
 
 set_config ($key, $value)
 Set the configuration item as specified.
 
 set_content ($value, $format=FORMAT_HTML)
 Set the content value for this step.
 
 set_sortorder ($value)
 Set the sortorder for this step.
 
 set_targettype ($value)
 Set the type of target for this step.
 
 set_targetvalue ($value)
 Set the target value for this step.
 
 set_title ($value)
 Set the title for this step.
 
 set_tourid ($value)
 Set the id of the tour.
 
 to_record (bool $isexporting=false)
 Prepare this step for saving to the database.
 

Static Public Member Functions

static get_config_keys ()
 The list of possible configuration keys.
 
static get_step_image_from_input (string $content)
 Attempt to replace PIXICON placeholder with the correct images for tour step content.
 
static get_string_from_input ($string)
 Attempt to fetch any matching langstring if the string is in the format identifier,component.
 
static instance ($id)
 Fetch the step instance.
 
static load_from_record ($record, $clean=false, bool $isimporting=false)
 Load the step instance.
 

Protected Member Functions

 calculate_sortorder ()
 Calculate the next sort-order value.
 
 embed_files ()
 Embed attached file to the json file for step.
 
 extract_files ()
 Get the embed files information and create store_file for this step.
 
 fetch ($id)
 Fetch the step instance.
 
 reload ()
 Refresh the current step from the datbase.
 
 reload_from_record ($record, $clean=false)
 Reload the current step from the supplied record.
 
 set_importing (bool $isimporting=false)
 Set the import state for the step.
 

Protected Attributes

object $config
 $config The configuration as an object.
 
string $content
 $content The content of this step.
 
int $contentformat
 $contentformat The content format: FORMAT_MOODLE/FORMAT_HTML/FORMAT_PLAIN/FORMAT_MARKDOWN.
 
bool $dirty = false
 $dirty Whether the step has been changed since it was loaded
 
stdClass[] $files = []
 $files The list of attached files for this step.
 
int $id
 $id The id of the step.
 
bool $isimporting
 $isimporting Whether the step is being imported or not.
 
int $sortorder
 $sortorder The sort order.
 
int $targettype
 $targettype The type of target.
 
string $targetvalue
 $targetvalue The value for this type of target.
 
string $title
 $title The title of the step.
 
tour $tour
 $tour The tour class that this step belongs to.
 
int $tourid
 $tourid The id of the tour that this step belongs to.
 

Detailed Description

Step class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_config_field_to_form()

tool_usertours\step::add_config_field_to_form ( \MoodleQuickForm $mform,
$key )

Add the specified step field configuration to the form.

Parameters
MoodleQuickForm$mformThe form to add configuration to.
string$keyThe key to add.
Return values
$this

◆ add_config_to_form()

tool_usertours\step::add_config_to_form ( \MoodleQuickForm $mform)

Add the step configuration to the form.

Parameters
MoodleQuickForm$mformThe form to add configuration to.
Return values
$this

◆ calculate_sortorder()

tool_usertours\step::calculate_sortorder ( )
protected

Calculate the next sort-order value.

Return values
int

◆ embed_files()

tool_usertours\step::embed_files ( )
protected

Embed attached file to the json file for step.

Return values
arrayList of files.

◆ extract_files()

tool_usertours\step::extract_files ( )
protected

Get the embed files information and create store_file for this step.

Return values
void

◆ fetch()

tool_usertours\step::fetch ( $id)
protected

Fetch the step instance.

Parameters
int$idThe id of the step to be retrieved.
Return values
step

◆ get_config()

tool_usertours\step::get_config ( $key = null,
$default = null )

Get the value of the specified configuration item.

If notvalue was found, and no default was specified, the default for the tour will be used.

Parameters
string$keyThe configuration key to set.
mixed$defaultThe default value to use if a value was not found.
Return values
mixed

◆ get_config_keys()

static tool_usertours\step::get_config_keys ( )
static

The list of possible configuration keys.

Return values
array

◆ get_content()

tool_usertours\step::get_content ( )

Get the body content of the step.

Return values
string

◆ get_contentformat()

tool_usertours\step::get_contentformat ( )

Get the content format of the step.

Return values
int

◆ get_delete_link()

tool_usertours\step::get_delete_link ( )

Get the delete link for this step.

Return values
moodle_url

◆ get_edit_link()

tool_usertours\step::get_edit_link ( )

Get the edit link for this step.

Return values
moodle_url

◆ get_id()

tool_usertours\step::get_id ( )

Get the ID of the step.

Return values
int

◆ get_movedown_link()

tool_usertours\step::get_movedown_link ( )

Get the link to move this step down in the sortorder.

Return values
moodle_url

◆ get_moveup_link()

tool_usertours\step::get_moveup_link ( )

Get the link to move this step up in the sortorder.

Return values
moodle_url

◆ get_placement_options()

tool_usertours\step::get_placement_options ( )

Get the list of possible placement options.

Return values
array

◆ get_sortorder()

tool_usertours\step::get_sortorder ( )

Get the current sortorder for this step.

Return values
int

◆ get_step_image_from_input()

static tool_usertours\step::get_step_image_from_input ( string $content)
static

Attempt to replace PIXICON placeholder with the correct images for tour step content.

Parameters
string$contentTour content
Return values
stringProcessed tour content

◆ get_string_from_input()

static tool_usertours\step::get_string_from_input ( $string)
static

Attempt to fetch any matching langstring if the string is in the format identifier,component.

Deprecated
since Moodle 4.0 MDL-72783. Please use helper\get_string_from_input() instead.
Parameters
string$string
Return values
string

◆ get_target()

tool_usertours\step::get_target ( )

Get the target instance for this step.

Return values
target

◆ get_targettype()

tool_usertours\step::get_targettype ( )

Get the content value for this step.

Return values
string

◆ get_targetvalue()

tool_usertours\step::get_targetvalue ( )

Get the target value for this step.

Return values
string

◆ get_title()

tool_usertours\step::get_title ( )

Get the Title of the step.

Return values
string

◆ get_tour()

tool_usertours\step::get_tour ( )

Get the Tour instance that this step belongs to.

Return values
tour

◆ get_tourid()

tool_usertours\step::get_tourid ( )

Get the Tour ID of the step.

Return values
int

◆ handle_form_submission()

tool_usertours\step::handle_form_submission ( local\forms\editstep & $mform,
stdClass $data )

Handle submission of the step editing form.

Parameters
local\forms\editstep$mformThe sumitted form.
stdClass$dataThe submitted data.
Return values
$this

◆ instance()

static tool_usertours\step::instance ( $id)
static

Fetch the step instance.

Parameters
int$idThe id of the step to be retrieved.
Return values
step

◆ is_first_step()

tool_usertours\step::is_first_step ( )

Whether this step is the first step in the tour.

Return values
boolean

◆ is_last_step()

tool_usertours\step::is_last_step ( )

Whether this step is the last step in the tour.

Return values
boolean

◆ load_from_record()

static tool_usertours\step::load_from_record ( $record,
$clean = false,
bool $isimporting = false )
static

Load the step instance.

Parameters
stdClass$recordThe step record to be loaded.
bool$cleanClean the values.
bool$isimportingWhether the step is being imported or not.
Return values
step

◆ persist()

tool_usertours\step::persist ( $force = false)

Save the tour and it's configuration to the database.

Parameters
boolean$forceWhether to force writing to the database.
Return values
$this

◆ prepare_data_for_form()

tool_usertours\step::prepare_data_for_form ( )

Prepare the configuration data for the moodle form.

Return values
object

◆ reload()

tool_usertours\step::reload ( )
protected

Refresh the current step from the datbase.

Return values
step

◆ reload_from_record()

tool_usertours\step::reload_from_record ( $record,
$clean = false )
protected

Reload the current step from the supplied record.

Parameters
stdClass$recordThe step record to be loaded.
bool$cleanClean the values.
Return values
step

◆ set_config()

tool_usertours\step::set_config ( $key,
$value )

Set the configuration item as specified.

Parameters
string$keyThe configuration key to set.
mixed$valueThe new value for the configuration item.
Return values
$this

◆ set_content()

tool_usertours\step::set_content ( $value,
$format = FORMAT_HTML )

Set the content value for this step.

Parameters
string$valueThe new content to use.
int$formatThe new format to use: FORMAT_MOODLE/FORMAT_HTML/FORMAT_PLAIN/FORMAT_MARKDOWN.
Return values
$this

◆ set_importing()

tool_usertours\step::set_importing ( bool $isimporting = false)
protected

Set the import state for the step.

Parameters
bool$isimportingTrue if the step is imported, otherwise false.
Return values
void

◆ set_sortorder()

tool_usertours\step::set_sortorder ( $value)

Set the sortorder for this step.

Parameters
int$valueThe new sortorder to use.
Return values
$this

◆ set_targettype()

tool_usertours\step::set_targettype ( $value)

Set the type of target for this step.

Parameters
string$valueThe new target to use.
Return values
$this

◆ set_targetvalue()

tool_usertours\step::set_targetvalue ( $value)

Set the target value for this step.

Parameters
string$valueThe new target value to use.
Return values
$this

◆ set_title()

tool_usertours\step::set_title ( $value)

Set the title for this step.

Parameters
string$valueThe new title to use.
Return values
$this

◆ set_tourid()

tool_usertours\step::set_tourid ( $value)

Set the id of the tour.

Parameters
int$valueThe id of the tour.
Return values
self

◆ to_record()

tool_usertours\step::to_record ( bool $isexporting = false)

Prepare this step for saving to the database.

Parameters
bool$isexportingWhether the step is being exported or not.
Return values
object

The documentation for this class was generated from the following file: