## Class mr_html_filter

Description

MR HTML Filter

This controls the setup, interaction and usage of a moodleform class and mr_html_filter_* classes.

- author: Mark Nielsen
- example: See how to use this class

Located in /html/filter.php (line 42)

    mr_readonly
       |
       --mr_html_filter

Variable Summary
mr_html_filter_abstract[] $filters
string $formpath
mr_helper $helper
moodleform $mform
mr_preferences $preferences
mr_report_abstract $report
moodle_url $url
Method Summary
mr_html_filter __construct (mr_preferences $preferences, moodle_url $url, [string $formpath = 'local/mr/form/filter'])
mr_html_filter add (mr_html_filter_abstract $filter)
mr_html_filter add_disabledif (string $filtername, string $dependenton, [string $condition = 'notchecked'], [string $value = '1'])
mr_html_filter add_helpbutton (string $filtername, string $identifier, [string $component = 'moodle'])
mr_html_filter init ()
mr_html_filter mform_hook ( &$mform, MoodleQuickForm $mform)
void set_report (mr_report_abstract $report)
array sql ()
mixed|mr_html_filter __call (string $name, array $arguments)
string __toString ()
Variables
mr_html_filter_abstract[] $filters = array() (line 48)

Added filters

- access: protected

string $formpath (line 69)

The path to the form class

- access: protected

mr_helper $helper (line 83)

Helper model

- access: protected

moodleform $mform (line 76)

Filter form

- access: protected

mr_preferences $preferences (line 55)

User preferences

- access: protected

mr_report_abstract $report (line 90)

Report

- access: protected

moodle_url $url (line 62)

Base URL

- access: protected

Methods
Constructor __construct (line 99)

Construct

- access: public

mr_html_filter __construct (mr_preferences $preferences, moodle_url $url, [string $formpath = 'local/mr/form/filter'])

- mr_preferences $preferences: Preferences model
- moodle_url $url: Base URL
- string $formpath: The patch to the form class, passed to mr_helper_load

add (line 170)

Add a filter

- access: public

mr_html_filter add (mr_html_filter_abstract $filter)

- mr_html_filter_abstract $filter: A filter instance

add_disabledif (line 203)

Add disabledIf to a filter

- throws: coding_exception
- access: public

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

- string $filtername: The filter's name
- 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_helpbutton (line 185)

Add a help button to a filter

- throws: coding_exception
- access: public

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

- string $filtername: The filter's name
- string $identifier: Help button text identifier
- string $component: The plugin component

init (line 113)

After filters have been added, you can initialze the form and handle submitted data

- throws: coding_exception
- access: public

mr_html_filter init ()
mform_hook (line 216)

Hook from

- access: public

mr_html_filter mform_hook ( &$mform, MoodleQuickForm $mform)

- MoodleQuickForm $mform
- MoodleQuickForm &$mform

set_report (line 227)

Set a report to the filters

- access: public

void set_report (mr_report_abstract $report)

- mr_report_abstract $report

sql (line 141)

Return filter SQL and params

- access: public

array sql ()
__call (line 241)

Use this to add new filters to the filter model

Example: ->new_text(...args...);

- access: public

mixed|mr_html_filter __call (string $name, array $arguments)

- string $name: The name of the filter
- array $arguments: Filter args

Redefinition of:

mr_readonly::__call()
  Provides dynamic get_{dataMember}() method access

__toString (line 259)

Convert this filter into a simple string

- access: public

string __toString ()

#### Inherited Methods

Inherited From mr_readonly

> mr_readonly::__call()

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