Moodle  2.2.1
http://www.collinsharper.com
base_setting Class Reference
Inheritance diagram for base_setting:

Public Member Functions

 __construct ($name, $vtype, $value=null, $visibility=self::VISIBLE, $status=self::NOT_LOCKED)
 destroy ()
 get_name ()
 get_value ()
 get_visibility ()
 get_status ()
 set_value ($value)
 set_visibility ($visibility)
 set_status ($status)
 get_my_dependency_properties ($settingname=null)
 get_settings_depended_on ()
 has_dependent_settings ()
 has_dependencies_on_settings ()
 set_ui (backup_setting_ui $ui)
 get_ui ()
 register_dependency (setting_dependency $dependency)
 add_dependency (base_setting $dependentsetting, $type=null, $options=array())
 get_dependencies ()
 get_ui_name ()
 get_ui_type ()
 set_help ($identifier, $component='moodle')
 get_help ()
 has_help ()

Data Fields

const UI_NONE = 0
const UI_HTML_CHECKBOX = 10
const UI_HTML_RADIOBUTTON = 20
const UI_HTML_DROPDOWN = 30
const UI_HTML_TEXTFIELD = 40
const IS_BOOLEAN = 'bool'
const IS_INTEGER = 'int'
const IS_FILENAME = 'file'
const IS_PATH = 'path'
const IS_TEXT = 'text'
const VISIBLE = 1
const HIDDEN = 0
const NOT_LOCKED = 3
const LOCKED_BY_CONFIG = 5
const LOCKED_BY_HIERARCHY = 7
const LOCKED_BY_PERMISSION = 9
const CHANGED_VALUE = 1
const CHANGED_VISIBILITY = 2
const CHANGED_STATUS = 3

Protected Member Functions

 register_dependent_dependency (setting_dependency $dependency)
 validate_value ($vtype, $value)
 validate_visibility ($visibility)
 validate_status ($status)
 inform_dependencies ($ctype, $oldv)
 is_circular_reference ($obj)

Protected Attributes

 $name
 $value
 $vtype
 $visibility
 $status
 $dependencies = array()
 $dependenton = array()
 $uisetting
 $help = array()

Detailed Description

This abstract class defines one basic setting

Each setting will be able to control its name, value (from a list), ui representation (check box, drop down, text field...), visibility, status (editable/locked...) and its hierarchy with other settings (using one like-observer pattern.

TODO: Finish phpdocs

Definition at line 35 of file base_setting.class.php.


Constructor & Destructor Documentation

__construct ( name,
vtype,
value = null,
visibility = self::VISIBLE,
status = self::NOT_LOCKED 
)

Member Function Documentation

add_dependency ( base_setting dependentsetting,
type = null,
options = array() 
)

Quick method to add a dependency to this setting.

The dependency created is done so by inspecting this setting and the setting that is passed in as the dependent setting.

Parameters:
base_setting$dependentsetting
int$typeOne of setting_dependency::*
array$options

Definition at line 324 of file base_setting.class.php.

Here is the call graph for this function:

destroy ( )

Destroy all circular references. It helps PHP 5.2 a lot!

Definition at line 119 of file base_setting.class.php.

Definition at line 479 of file base_setting.class.php.

get_help ( )

Gets the help string params for this setting if it has been set

Returns:
array|false An array (identifier, component) or false if not set

Definition at line 505 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_my_dependency_properties ( settingname = null)

Gets an array of properties for all of the dependencies that will affect this setting.

This method returns an array rather than the dependencies in order to minimise the memory footprint of for the potentially huge recursive dependency structure that we may be dealing with.

This method also ensures that all dependencies are transmuted to affect the setting in question and that we don't provide any duplicates.

Parameters:
string | null$settingname
Returns:
array

Definition at line 229 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_name ( )

Definition at line 136 of file base_setting.class.php.

Here is the caller graph for this function:

Returns all of the dependencies that affect this setting. e.g. settings this setting depends on.

Returns:
array Array of setting_dependency's

Definition at line 249 of file base_setting.class.php.

Definition at line 148 of file base_setting.class.php.

Here is the caller graph for this function:

get_ui ( )

Gets the user interface for this setting

Returns:
base_setting_ui

Definition at line 285 of file base_setting.class.php.

Here is the caller graph for this function:

Definition at line 483 of file base_setting.class.php.

Here is the caller graph for this function:

Definition at line 487 of file base_setting.class.php.

Here is the caller graph for this function:

get_value ( )

Definition at line 140 of file base_setting.class.php.

Here is the caller graph for this function:

Definition at line 144 of file base_setting.class.php.

Here is the caller graph for this function:

Checks if this setting is dependent on any other settings

Returns:
bool True if this setting is dependent on any other settings

Definition at line 267 of file base_setting.class.php.

Checks if there are other settings that are dependent on this setting

Returns:
bool True if there are other settings that are dependent on this setting

Definition at line 258 of file base_setting.class.php.

has_help ( )

Returns true if help has been set for this setting

Returns:
cool

Definition at line 516 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

inform_dependencies ( ctype,
oldv 
) [protected]

Definition at line 458 of file base_setting.class.php.

Here is the caller graph for this function:

is_circular_reference ( obj) [protected]

Definition at line 464 of file base_setting.class.php.

Here is the caller graph for this function:

Adds a dependency where another setting depends on this setting.

Parameters:
setting_dependency$dependency

Definition at line 293 of file base_setting.class.php.

Here is the call graph for this function:

register_dependent_dependency ( setting_dependency dependency) [protected]

Adds a dependency where this setting is dependent on another.

This should only be called internally once we are sure it is not cicrular.

Parameters:
setting_dependency$dependency

Definition at line 310 of file base_setting.class.php.

Here is the call graph for this function:

set_help ( identifier,
component = 'moodle' 
)

Sets a help string for this setting

Parameters:
string$identifier
string$component

Definition at line 497 of file base_setting.class.php.

Here is the call graph for this function:

set_status ( status)

Definition at line 192 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Sets the user interface for this setting

Parameters:
base_setting_ui$ui

Definition at line 276 of file base_setting.class.php.

Here is the caller graph for this function:

set_value ( value)

Definition at line 152 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_visibility ( visibility)

Definition at line 171 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

validate_status ( status) [protected]

Definition at line 447 of file base_setting.class.php.

Here is the caller graph for this function:

validate_value ( vtype,
value 
) [protected]

Definition at line 400 of file base_setting.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

validate_visibility ( visibility) [protected]

Definition at line 437 of file base_setting.class.php.

Here is the caller graph for this function:


Field Documentation

$dependencies = array() [protected]

Definition at line 73 of file base_setting.class.php.

$dependenton = array() [protected]

Definition at line 74 of file base_setting.class.php.

$help = array() [protected]

Definition at line 87 of file base_setting.class.php.

$name [protected]

Definition at line 66 of file base_setting.class.php.

$status [protected]

Definition at line 71 of file base_setting.class.php.

$uisetting [protected]

Definition at line 80 of file base_setting.class.php.

$value [protected]

Definition at line 67 of file base_setting.class.php.

$visibility [protected]

Definition at line 70 of file base_setting.class.php.

$vtype [protected]

Definition at line 68 of file base_setting.class.php.

const CHANGED_STATUS = 3

Definition at line 64 of file base_setting.class.php.

const CHANGED_VALUE = 1

Definition at line 62 of file base_setting.class.php.

const CHANGED_VISIBILITY = 2

Definition at line 63 of file base_setting.class.php.

const HIDDEN = 0

Definition at line 53 of file base_setting.class.php.

const IS_BOOLEAN = 'bool'

Definition at line 45 of file base_setting.class.php.

const IS_FILENAME = 'file'

Definition at line 47 of file base_setting.class.php.

const IS_INTEGER = 'int'

Definition at line 46 of file base_setting.class.php.

const IS_PATH = 'path'

Definition at line 48 of file base_setting.class.php.

const IS_TEXT = 'text'

Definition at line 49 of file base_setting.class.php.

const LOCKED_BY_CONFIG = 5

Definition at line 57 of file base_setting.class.php.

Definition at line 58 of file base_setting.class.php.

Definition at line 59 of file base_setting.class.php.

const NOT_LOCKED = 3

Definition at line 56 of file base_setting.class.php.

const UI_HTML_CHECKBOX = 10

Definition at line 39 of file base_setting.class.php.

const UI_HTML_DROPDOWN = 30

Definition at line 41 of file base_setting.class.php.

const UI_HTML_RADIOBUTTON = 20

Definition at line 40 of file base_setting.class.php.

const UI_HTML_TEXTFIELD = 40

Definition at line 42 of file base_setting.class.php.

const UI_NONE = 0

Definition at line 38 of file base_setting.class.php.

const VISIBLE = 1

Definition at line 52 of file base_setting.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations