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

Static Public Member Functions

static get_config_keys ()
 The list of possible configuration keys. More...
 
static get_string_from_input ($string)
 Attempt to fetch any matching langstring if the string is in the format identifier,component. More...
 
static instance ($id)
 Fetch the step instance. More...
 
static load_from_record ($record, $clean=false)
 Load the step instance. More...
 

Protected Member Functions

 calculate_sortorder ()
 Calculate the next sort-order value. More...
 
 fetch ($id)
 Fetch the step instance. More...
 
 reload ()
 Refresh the current step from the datbase. More...
 
 reload_from_record ($record, $clean=false)
 Reload the current step from the supplied record. More...
 

Protected Attributes

object $config
 $config The configuration as an object.
 
string $content
 $content The content of this step.
 
bool $dirty = false
 $dirty Whether the step has been changed since it was loaded
 
int $id
 $id The id of the step.
 
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

◆ 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_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_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.

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 
)
static

Load the step instance.

Parameters
stdClass$recordThe step record to be loaded.
boolean$cleanClean the values.
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.
boolean$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)

Set the content value for this step.

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

◆ 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 ( )

Prepare this step for saving to the database.

Return values
object

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