class type_bool extends type_base

Properties

protected request $request

Request object

protected template $template

Template object

protected user $user

User object

protected lang_helper $lang_helper

Profile fields language helper

Methods

__construct(lang_helper $lang_helper, request $request, template $template, user $user)

Construct

string
get_name()

Get the translated name of the type

string
get_service_name()

Get the name of service representing the type

string
get_template_filename()

Get the name of template file for this type

string
get_field_ident(array $field_data)

Get the ident of the field

string
get_field_name(string $field_name)

Get the localized name of the field

mixed
get_profile_contact_value(mixed $field_value, array $field_data)

Get Profile Value for display

array
get_language_options_input(array $field_data)

Get the input for the supplied language options

mixed
prepare_options_form(array $exclude_options, array $visibility_options)

Allows exclusion of options in single steps of the creation process

array
validate_options_on_submit(array $error, array $field_data)

Allows exclusion of options in single steps of the creation process

mixed
get_excluded_options(string $key, string $action, mixed $current_value, array $field_data, int $step)

Allows manipulating the intended variables if needed

mixed
prepare_hidden_fields(int $step, string $key, string $action, array $field_data)

Allows manipulating the intended variables if needed

null
display_options(array $template_vars, array $field_data)

Allows assigning of additional template variables

string
process_field_row(string $mode, array $profile_row)

Return templated value/field. Possible values for $mode are: change == user is able to set/enter profile values; preview == just show the value

string
get_name_short()

Get the short name of the type, used for error messages and template loops

array
get_options(string $default_lang_id, array $field_data)

Get dropdown options for second step in ACP

array
get_default_option_values()

Get default values for the options of this type

mixed
get_default_field_value(array $field_data)

Get default value for this type

mixed
get_profile_field(array $profile_row)

Get profile field value on submit

mixed
validate_profile_field(mixed $field_value, array $field_data)

Validate entered profile field data

mixed
get_profile_value(mixed $field_value, array $field_data)

Get Profile Value for display

mixed
get_profile_value_raw(mixed $field_value, array $field_data)

Get Profile Value ID for display (the raw, unprocessed user data)

null
generate_field(array $profile_row, mixed $preview_options = false)

Generate the input field for display

string
get_database_column_type()

Get the column type for the database

array
get_language_options(array $field_data)

Get the options we need to display for the language input fields in the ACP

Details

at line 50
__construct(lang_helper $lang_helper, request $request, template $template, user $user)

Construct

Parameters

lang_helper $lang_helper

Profile fields language helper

request $request

Request object

template $template

Template object

user $user

User object

in type_base at line 53
string get_name()

Get the translated name of the type

Return Value

string

Translated name of the field type

in type_base at line 61
string get_service_name()

Get the name of service representing the type

Return Value

string

lowercase version of the fields type

in type_base at line 69
string get_template_filename()

Get the name of template file for this type

Return Value

string

Returns the name of the template file

at line 252
string get_field_ident(array $field_data)

Get the ident of the field

Some types are multivalue, we can't give them a field_id as we would not know which to pick.

Parameters

array $field_data

Array with data for this field

Return Value

string

ident of the field

in type_base at line 85
string get_field_name(string $field_name)

Get the localized name of the field

Parameters

string $field_name

Unlocalized name of this field

Return Value

string

Localized name of the field

in type_base at line 93
mixed get_profile_contact_value(mixed $field_value, array $field_data)

Get Profile Value for display

When displaying a contact field, we don't want to have links already parsed and more

Parameters

mixed $field_value

Field value as stored in the database

array $field_data

Array with requirements of the field

Return Value

mixed

Field value to display

at line 286
array get_language_options_input(array $field_data)

Get the input for the supplied language options

Parameters

array $field_data

Array with data for this field

Return Value

array

Returns the language options we need to generate

at line 304
mixed prepare_options_form(array $exclude_options, array $visibility_options)

Allows exclusion of options in single steps of the creation process

Parameters

array $exclude_options

Array with options that should be excluded in the steps

array $visibility_options

Array with options responsible for the fields visibility

Return Value

mixed

Returns the provided language options

at line 314
array validate_options_on_submit(array $error, array $field_data)

Allows exclusion of options in single steps of the creation process

Parameters

array $error

Array with error messages

array $field_data

Array with data for this field

Return Value

array

Array with error messages

at line 327
mixed get_excluded_options(string $key, string $action, mixed $current_value, array $field_data, int $step)

Allows manipulating the intended variables if needed

Parameters

string $key

Name of the option

string $action

Currently performed action (create|edit)

mixed $current_value

Currently value of the option

array $field_data

Array with data for this field

int $step

Step on which the option is excluded

Return Value

mixed

Final value of the option

at line 371
mixed prepare_hidden_fields(int $step, string $key, string $action, array $field_data)

Allows manipulating the intended variables if needed

Parameters

int $step

Step on which the option is hidden

string $key

Name of the option

string $action

Currently performed action (create|edit)

array $field_data

Array with data for this field

Return Value

mixed

Final value of the option

at line 401
null display_options(array $template_vars, array $field_data)

Allows assigning of additional template variables

Parameters

array $template_vars

Template variables we are going to assign

array $field_data

Array with data for this field

Return Value

null

in type_base at line 187
string process_field_row(string $mode, array $profile_row)

Return templated value/field. Possible values for $mode are: change == user is able to set/enter profile values; preview == just show the value

Parameters

string $mode

Mode for displaying the field (preview|change)

array $profile_row

Array with data for this field

Return Value

string

at line 61
string get_name_short()

Get the short name of the type, used for error messages and template loops

Return Value

string

lowercase version of the fields type

at line 69
array get_options(string $default_lang_id, array $field_data)

Get dropdown options for second step in ACP

Parameters

string $default_lang_id

ID of the default language

array $field_data

Array with data for this field

Return Value

array

with the acp options

at line 95
array get_default_option_values()

Get default values for the options of this type

Return Value

array

with values like default field size and more

at line 110
mixed get_default_field_value(array $field_data)

Get default value for this type

Parameters

array $field_data

Array with data for this field

Return Value

mixed

default value for new users when no value is given

at line 118
mixed get_profile_field(array $profile_row)

Get profile field value on submit

Parameters

array $profile_row

Array with data for this field

Return Value

mixed

Submitted value of the profile field

at line 136
mixed validate_profile_field(mixed $field_value, array $field_data)

Validate entered profile field data

Parameters

mixed $field_value

Field value to validate

array $field_data

Array with requirements of the field

Return Value

mixed

String with the error message

at line 151
mixed get_profile_value(mixed $field_value, array $field_data)

Get Profile Value for display

Parameters

mixed $field_value

Field value as stored in the database

array $field_data

Array with requirements of the field

Return Value

mixed

Field value to display

at line 183
mixed get_profile_value_raw(mixed $field_value, array $field_data)

Get Profile Value ID for display (the raw, unprocessed user data)

Parameters

mixed $field_value

Field value as stored in the database

array $field_data

Array with requirements of the field

Return Value

mixed

Field value ID to display

at line 201
null generate_field(array $profile_row, mixed $preview_options = false)

Generate the input field for display

Parameters

array $profile_row

Array with data for this field

mixed $preview_options

When previewing we use different data

Return Value

null

at line 260
string get_database_column_type()

Get the column type for the database

Return Value

string

Returns the database column type

at line 268
array get_language_options(array $field_data)

Get the options we need to display for the language input fields in the ACP

Parameters

array $field_data

Array with data for this field

Return Value

array

Returns the language options we need to generate