|
SelfHelp WebApp
v2.0.6
A WebApp to Create WebApps for Studies in Human Sciences
|
Public Member Functions | |
| __construct ($db) | |
| convert_to_valid_html_id ($string) | |
| get_input_fields ($filter=array()) | |
| get_input_fields_by_gender_male () | |
| get_input_fields_by_gender_female () | |
| get_input_fields_by_field_id ($field_id) | |
| get_input_fields_by_field_name ($field_name) | |
| get_input_fields_by_page ($keyword) | |
| get_input_fields_by_nav ($name) | |
| get_input_value_by_pattern ($pattern, $uid) | |
| get_input_value_pattern () | |
| set_field_attrs () | |
Private Member Functions | |
| fetch_input_fields ($conds=array()) | |
| fetch_nav_section_page ($id_section) | |
| fetch_section_name ($id) | |
| fetch_section_page ($id_section) | |
| fetch_section_parent ($id_child) | |
| find_section_page ($id_section) | |
Private Attributes | |
| $db | |
| $field_attrs | |
Class to deal with user inputs.
| UserInput::__construct | ( | $db | ) |
| object | $db | The db instance which grants access to the DB. |
| UserInput::convert_to_valid_html_id | ( | $string | ) |
Convert a string to HTML valid id
| string | $string | the string value that we want to convert to a valid HTML id |
| string | the converted string which will be used as ID |
|
private |
Fetches all user input fields from the database given certain conditions.
| array | $conds | A key => value array of db conditions where the key corresponds to the db column and the value to the db value. |
| array | An array of field items where eeach item has the following keys:
|
Referenced by get_input_fields().
|
private |
Fetch the page name to which the given navigation section belongs.
| int | $id_section | The id of the section |
Referenced by find_section_page().
|
private |
Fetch the name of a section.
| int | $id | The id of the section |
Referenced by find_section_page().
|
private |
Fetch the page name to which the given section belongs.
| int | $id_section | The id of the section |
Referenced by find_section_page().
|
private |
Fetch the id of the parent section.
| int | $id_child | The id of the child section. |
| int | The id of the parent section or null if no parent could be found. |
Referenced by find_section_page().
|
private |
Find the page name and navigation section name of a given child section.
| int | $id_section | The id of the child section. |
| array | An array with the keys "page" and "nav" where the former holds the name of the parent page and the latter the name of the parent navigation section. |
Referenced by set_field_attrs().
| UserInput::get_input_fields | ( | $filter = array() | ) |
Get all input fields given a filter
| array | $filter | The filter array can be empty or have any of the following keys:
|
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
Referenced by get_input_fields_by_field_id(), get_input_fields_by_field_name(), get_input_fields_by_gender_female(), get_input_fields_by_gender_male(), get_input_fields_by_nav(), get_input_fields_by_page(), and get_input_value_by_pattern().
| UserInput::get_input_fields_by_field_id | ( | $field_id | ) |
Get all input fields that match a field section id.
| int | $field_id | The field_id to match. |
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_fields_by_field_name | ( | $field_name | ) |
Get all input fields that match a field name.
| string | $field_name | The field_name to match. |
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_fields_by_gender_female | ( | ) |
Get all input fields submitted by female users.
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_fields_by_gender_male | ( | ) |
Get all input fields submitted by male users.
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_fields_by_nav | ( | $name | ) |
Get all input fields that are placed on a given navigation section.
| string | $name | The navigation section name to match. All navigation sections containing the given name are considered. |
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_fields_by_page | ( | $keyword | ) |
Get all input fields that are placed on a given page.
| string | $keyword | The page keyword to match. |
| array | The selected user input fields. See UserInput::fetch_input_fields() for more details. |
| UserInput::get_input_value_by_pattern | ( | $pattern, | |
| $uid | |||
| ) |
Get the user input value of an input field specified by a pattern.
| string | $pattern | A field identifier of the form @<form_name>#<field_name>. |
| int | $uid | The id of a user. |
| mixed | On success, the value corresponding to the requested form field, null in case of a bad pattern syntax, and the empty string if no value was found. |
| UserInput::get_input_value_pattern | ( | ) |
Returns the regular expression to find a form field
| string | the regular expression that finds a field identifier of the form @<form_name>#<field_name>. |
| UserInput::set_field_attrs | ( | ) |
Collect attributes for each existing user input field. The following attributes are set:
Referenced by __construct().
|
private |
The db instance which grants access to the DB.
Referenced by __construct().
|
private |
The collection of input field attributes. See UserInput::set_field_attrs.