Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
MoodleQuickForm_modvisible Class Reference
Inheritance diagram for MoodleQuickForm_modvisible:
MoodleQuickForm_select templatable

Public Member Functions

 __construct ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Class constructor. More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 exportValue (&$submitvalues, $assoc=false)
 As usual, to get the group's value we access its elements and call their exportValue() methods. More...
 
 getElementTemplateType ()
 Slightly different container template when frozen. More...
 
 getHelpButton ()
 get html for help button More...
 
 MoodleQuickForm_modvisible ($elementName=null, $elementLabel=null, $attributes=null, $options=null)
 Old syntax of class constructor. More...
 
 MoodleQuickForm_select ($elementName=null, $elementLabel=null, $options=null, $attributes=null)
 Old syntax of class constructor. More...
 
 onQuickFormEvent ($event, $arg, &$caller)
 Called by HTML_QuickForm whenever form event is made on this element. More...
 
 removeOption ($value)
 Removes an OPTION from the SELECT. More...
 
 removeOptions ()
 Removes all OPTIONs from the SELECT.
 
 setHiddenLabel ($hiddenLabel)
 Sets label to be hidden. More...
 
 toHtml ()
 Returns HTML for select form element. More...
 

Public Attributes

string $_helpbutton =''
 html for help button, if empty then no help
 
bool $_hiddenLabel =false
 if true label will be hidden
 
int const HIDE = 0
 activity state: visible=0, visibleoncoursepage=any
 
int const SHOW = 1
 activity state: visible=1, visibleoncoursepage=1
 
int const STEALTH = -1
 activity state: visible=1, visibleoncoursepage=0
 

Constructor & Destructor Documentation

◆ __construct()

MoodleQuickForm_modvisible::__construct (   $elementName = null,
  $elementLabel = null,
  $attributes = null,
  $options = null 
)

Class constructor.

Parameters
string$elementNameSelect name attribute
mixed$elementLabelLabel(s) for the select
mixed$attributesEither a typical HTML attribute string or an associative array
array$optionsignored

Reimplemented from MoodleQuickForm_select.

Member Function Documentation

◆ export_for_template()

MoodleQuickForm_select::export_for_template ( renderer_base  $output)
inherited

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements templatable.

Reimplemented in MoodleQuickForm_tags, and MoodleQuickForm_autocomplete.

◆ exportValue()

MoodleQuickForm_modvisible::exportValue ( $submitvalues,
  $assoc = false 
)

As usual, to get the group's value we access its elements and call their exportValue() methods.

Parameters
array$submitvaluessubmitted values
bool$associf true the retured value is associated array
Return values
mixed

Reimplemented from MoodleQuickForm_select.

◆ getElementTemplateType()

MoodleQuickForm_select::getElementTemplateType ( )
inherited

Slightly different container template when frozen.

Don't want to use a label tag with a for attribute in that case for the element label but instead use a div. Templates are defined in renderer constructor.

Return values
string

◆ getHelpButton()

MoodleQuickForm_select::getHelpButton ( )
inherited

get html for help button

Return values
stringhtml for help button

◆ MoodleQuickForm_modvisible()

MoodleQuickForm_modvisible::MoodleQuickForm_modvisible (   $elementName = null,
  $elementLabel = null,
  $attributes = null,
  $options = null 
)

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ MoodleQuickForm_select()

MoodleQuickForm_select::MoodleQuickForm_select (   $elementName = null,
  $elementLabel = null,
  $options = null,
  $attributes = null 
)
inherited

Old syntax of class constructor.

Deprecated in PHP7.

Deprecated:
since Moodle 3.1

◆ onQuickFormEvent()

MoodleQuickForm_modvisible::onQuickFormEvent (   $event,
  $arg,
$caller 
)

Called by HTML_QuickForm whenever form event is made on this element.

Parameters
string$eventName of event
mixed$argevent arguments
object$callercalling object
Return values
bool

◆ removeOption()

MoodleQuickForm_select::removeOption (   $value)
inherited

Removes an OPTION from the SELECT.

Parameters
string$valueValue for the OPTION to remove
Return values
void

◆ setHiddenLabel()

MoodleQuickForm_select::setHiddenLabel (   $hiddenLabel)
inherited

Sets label to be hidden.

Parameters
bool$hiddenLabelsets if label should be hidden

◆ toHtml()

MoodleQuickForm_select::toHtml ( )
inherited

Returns HTML for select form element.

Return values
string

Reimplemented in MoodleQuickForm_tags, and MoodleQuickForm_autocomplete.


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