A dependency that disables the secondary setting if the value of the primary setting is empty.
More...
|
const | DISABLED_CHECKED = 4 |
|
const | DISABLED_EMPTY = 6 |
|
const | DISABLED_FALSE = 3 |
|
const | DISABLED_NOT_CHECKED = 5 |
|
const | DISABLED_NOT_EMPTY = 7 |
|
const | DISABLED_NOT_VALUE = 1 |
|
const | DISABLED_TRUE = 2 |
|
const | DISABLED_VALUE = 0 |
| Used to define the type of a dependency. More...
|
|
|
mixed | $defaultvalue |
| The default setting.
|
|
base_setting | $dependentsetting |
| The dependent setting (secondary)
|
|
mixed | $lastvalue |
| The last value the dependent setting had.
|
|
base_setting | $setting |
| The parent setting (primary)
|
|
mixed | $value |
| The value to compare to.
|
|
A dependency that disables the secondary setting if the value of the primary setting is empty.
- Copyright
- 2010 Sam Hemelryk
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
setting_dependency_disabledif_empty::__construct |
( |
base_setting |
$setting, |
|
|
base_setting |
$dependentsetting, |
|
|
|
$defaultvalue = false |
|
) |
| |
Creates the dependency object.
- Parameters
-
base_setting | $setting | The parent setting or the primary setting if you prefer |
base_setting | $dependentsetting | The dependent setting |
mixed | $defaultvalue | The default value to assign if the dependency is unmet |
Reimplemented from setting_dependency.
◆ destroy()
setting_dependency::destroy |
( |
| ) |
|
|
inherited |
Destroy all circular references.
It helps PHP 5.2 a lot!
◆ enforce()
setting_dependency_disabledif_equals::enforce |
( |
| ) |
|
|
inherited |
Enforces the dependency if required.
- Return values
-
bool | True if there were changes |
Reimplemented from setting_dependency.
◆ evaluate_disabled_condition()
setting_dependency_disabledif_empty::evaluate_disabled_condition |
( |
|
$value | ) |
|
|
protected |
Evaluate the current value of the setting and return true if the dependent setting should be locked or false.
- Parameters
-
mixed | $value | The value of the parent setting. |
- Return values
-
Reimplemented from setting_dependency_disabledif_equals.
◆ get_dependent_setting()
setting_dependency::get_dependent_setting |
( |
| ) |
|
|
inherited |
Gets the dependent setting.
- Return values
-
◆ get_moodleform_properties()
setting_dependency_disabledif_empty::get_moodleform_properties |
( |
| ) |
|
◆ get_setting()
setting_dependency::get_setting |
( |
| ) |
|
|
inherited |
Gets the primary setting.
- Return values
-
◆ is_locked()
setting_dependency_disabledif_equals::is_locked |
( |
| ) |
|
|
inherited |
◆ process_change()
setting_dependency::process_change |
( |
|
$changetype, |
|
|
|
$oldvalue |
|
) |
| |
|
finalinherited |
Processes a change is setting called by the primary setting.
- Parameters
-
int | $changetype | |
mixed | $oldvalue | |
- Return values
-
◆ process_status_change()
setting_dependency_disabledif_equals::process_status_change |
( |
|
$oldstatus | ) |
|
|
protectedinherited |
Processes a status change in the primary setting.
- Parameters
-
- Return values
-
Reimplemented from setting_dependency.
◆ process_value_change()
setting_dependency_disabledif_equals::process_value_change |
( |
|
$oldvalue | ) |
|
|
protectedinherited |
Processes a value change in the primary setting.
- Parameters
-
- Return values
-
Reimplemented from setting_dependency.
◆ process_visibility_change()
setting_dependency::process_visibility_change |
( |
|
$oldvisibility | ) |
|
|
protectedinherited |
Processes a visibility change.
- Parameters
-
- Return values
-
◆ DISABLED_VALUE
const setting_dependency::DISABLED_VALUE = 0 |
|
inherited |
Used to define the type of a dependency.
Note with these that checked and true, and not checked and false are equal. This is because the terminology differs but the resulting action is the same. Reduces code!
The documentation for this class was generated from the following file: