## Class mr_html_filter_abstract

Description

MR HTML Filter Abstract

- author: Mark Nielsen
- abstract:

Located in /html/filter/abstract.php (line 32)

Direct descendents

Class | Description
--- | ---
mr_html_filter_autocomplete | MR HTML Filter Autocomplete
mr_html_filter_autocompleteid | MR HTML Filter Autocomplete with IDs
mr_html_filter_checkbox | MR HTML Filter Checkbox
mr_html_filter_daterange | MR HTML Filter Date Range
mr_html_filter_header | MR HTML Filter Header
mr_html_filter_hidden | MR HTML Filter hidden
mr_html_filter_numberrange | MR HTML Filter Number Range
mr_html_filter_recent | MR HTML Filter Recent
mr_html_filter_select | MR HTML Filter Select
mr_html_filter_selectmulti | MR HTML Filter Multiple Select
mr_html_filter_selectmultiplus | Multi-select plus filter
mr_html_filter_text | MR HTML Filter Text
mr_html_filter_textarea | MR HTML Filter Text

Variable Summary
boolean $advanced
array $disabledif
string $field
array $helpbutton
string $label
string $name
mr_preferences $preferences
Method Summary
mr_html_filter_abstract __construct (string $name, string $label, [bool $advanced = false], [string $field = NULL])
mr_html_filter_abstract add_disabledif (string $dependenton, [string $condition = 'notchecked'], [string $value = '1'])
mr_html_filter_abstract add_element (MoodleQuickForm $mform)
mr_html_filter_abstract add_elements (MoodleQuickForm $mform)
mr_html_filter_abstract add_helpbutton (string $identifier, [string $component = 'moodle'])
string get_element_name ()
string get_field ()
string get_name ()
array preferences_defaults ()
mr_html_filter_abstract preferences_delete ([string $name = NULL])
mixed preferences_get (string $name)
mr_html_filter_abstract preferences_init (mr_preferences $preferences)
mr_html_filter_abstract preferences_update (object $data)
mixed sql ()
string __toString ()
Variables
boolean $advanced (line 53)

If it should be flagged as advanced or not in the form

- access: protected

array $disabledif = array() (line 81)

Element disabledIf parameters

- access: protected

string $field (line 60)

SQL field name (if different from $name)

- access: protected

array $helpbutton = array() (line 74)

Element help button parameters

- access: protected

string $label (line 45)

Filter label in the form

- access: protected

string $name (line 38)

The filter's name

- access: protected

mr_preferences $preferences (line 67)

User preferences (filter values are stored here)

- access: protected

Methods
Constructor __construct (line 91)

Construct

- access: public

mr_html_filter_abstract __construct (string $name, string $label, [bool $advanced = false], [string $field = NULL])

- string $name: Filter name
- string $label: Filter label
- bool $advanced: Filter advanced form setting
- string $field: SQL field, defaults to $name

Redefined in descendants as:

- mr_html_filter_autocomplete::__construct() : Adding an options param for the select options
- mr_html_filter_autocompleteid::__construct() : Adding an options param for the select options
- mr_html_filter_checkbox::__construct() : Checkbox filter constructor
- mr_html_filter_header::__construct() : Header "filter" constructor
- mr_html_filter_hidden::__construct() : Construct
- mr_html_filter_numberrange::__construct() : Construct
- mr_html_filter_select::__construct() : Adding an options param for the select options
- mr_html_filter_selectmulti::__construct() : Adding an options param for the select options
- mr_html_filter_selectmultiplus::__construct()
- mr_html_filter_textarea::__construct() : Construct

add_disabledif (line 237)

Add disabledIf to this filter

- access: public

mr_html_filter_abstract add_disabledif (string $dependenton, [string $condition = 'notchecked'], [string $value = '1'])

- string $dependenton: The name of the element whose state will be checked for condition
- string $condition: The condition to check
- string $value: Used in conjunction with condition.

add_element (line 282)

Add filter form element

- abstract:
- access: public

mr_html_filter_abstract add_element (MoodleQuickForm $mform)

- MoodleQuickForm $mform: Filter form

Redefined in descendants as:

- mr_html_filter_autocomplete::add_element() : Add text input
- mr_html_filter_autocompleteid::add_element() : Add text input for autocomplete and hidden field to store ID
- mr_html_filter_checkbox::add_element() : Add checkbox
- mr_html_filter_daterange::add_element() : Add date fields and checkboxes to enable/disable
- mr_html_filter_header::add_element() : Add filter form element
- mr_html_filter_hidden::add_element() : Add hidden field
- mr_html_filter_numberrange::add_element() : Add text fields and checkboxes to enable/disable
- mr_html_filter_recent::add_element() : Add select input
- mr_html_filter_select::add_element() : Add select input
- mr_html_filter_selectmulti::add_element() : Add select input
- mr_html_filter_selectmultiplus::add_element() : Add filter form element
- mr_html_filter_text::add_element() : Add text input
- mr_html_filter_textarea::add_element() : Add text input

add_elements (line 252)

Add all elements for this filter

- access: public

mr_html_filter_abstract add_elements (MoodleQuickForm $mform)

- MoodleQuickForm $mform: The filter form

Redefined in descendants as:

- mr_html_filter_selectmultiplus::add_elements() : Add all elements for this filter

add_helpbutton (line 221)

Add a help button to this filter

- access: public

mr_html_filter_abstract add_helpbutton (string $identifier, [string $component = 'moodle'])

- string $identifier: Help button text identifier
- string $component: The plugin component

get_element_name (line 133)

Get the filter's primary form element's name

This is used to attach help buttons, disabledIfs, etc to the filter's element.

- access: public

string get_element_name ()

Redefined in descendants as:

- mr_html_filter_daterange::get_element_name() : Return the group element
- mr_html_filter_numberrange::get_element_name() : Return the group element

get_field (line 142)

Get SQL field name

- access: public

string get_field ()
get_name (line 121)

Get the field's name

- access: public

string get_name ()
preferences_defaults (line 151)

Filter defaults

- access: public

array preferences_defaults ()

Redefined in descendants as:

- mr_html_filter_autocompleteid::preferences_defaults() : Defaults for two fields
- mr_html_filter_checkbox::preferences_defaults() : Filter defaults
- mr_html_filter_daterange::preferences_defaults() : Defaults for two fields
- mr_html_filter_hidden::preferences_defaults() : Defaults to value
- mr_html_filter_numberrange::preferences_defaults() : Defaults for two fields
- mr_html_filter_recent::preferences_defaults() : Default is zero
- mr_html_filter_select::preferences_defaults() : First option is default
- mr_html_filter_selectmulti::preferences_defaults() : First option is default

preferences_delete (line 202)

Remove preferences for this filter

- access: public

mr_html_filter_abstract preferences_delete ([string $name = NULL])

- string $name: A specific preference to delete, if NULL all are deleted

preferences_get (line 173)

Get a preference value (default can be returned)

- access: public

mixed preferences_get (string $name)

- string $name: Preference name

preferences_init (line 161)

Preferences init

- access: public

mr_html_filter_abstract preferences_init (mr_preferences $preferences)

- mr_preferences $preferences

preferences_update (line 185)

Update user preferences to current filter settings

- access: public

mr_html_filter_abstract preferences_update (object $data)

- object $data: Form data

Redefined in descendants as:

- mr_html_filter_daterange::preferences_update() : Enforce checkboxes - if not set
- mr_html_filter_numberrange::preferences_update() : Enforce checkboxes - if not set
- mr_html_filter_selectmulti::preferences_update() : Save as CSV value
- mr_html_filter_selectmultiplus::preferences_update()

sql (line 289)

Generate this filter's SQL

- abstract:
- access: public

mixed sql ()

Redefined in descendants as:

- mr_html_filter_autocomplete::sql() : Search by input value
- mr_html_filter_autocompleteid::sql() : Restrict to value
- mr_html_filter_checkbox::sql() : Limit by input value
- mr_html_filter_daterange::sql() : Set limits on field
- mr_html_filter_header::sql() : Stub method to override abstract method
- mr_html_filter_hidden::sql() : Set field to value
- mr_html_filter_numberrange::sql() : Set limits on field
- mr_html_filter_recent::sql() : Limit a field to being greater than our recent time
- mr_html_filter_select::sql() : Limit by input value
- mr_html_filter_selectmulti::sql() : Limit by input value
- mr_html_filter_selectmultiplus::sql()
- mr_html_filter_text::sql() : Search by input value
- mr_html_filter_textarea::sql() : Search by input value

__toString (line 108)

Convert this filter into a simple string

- access: public

string __toString ()

Documentation generated on Thu, 28 Jun 2012 16:33:44 -0700 by phpDocumentor 1.4.3