Documentation

O3PO_Ready2PublishForm extends O3PO_PublicForm
in package
implements O3PO_SettingsSpecifyer

Class for the ready to publish form.

Tags
since
0.4.0
subpackage

O3PO/includes

author

Christian Gogolin o3po@quantum-journal.org

Table of Contents

Interfaces

O3PO_SettingsSpecifyer
Interface for classes specifying settings.

Properties

$coming_from_page  : int
The page id of the page the user is coming from
$fields  : array<string|int, mixed>
Array of all field of the form.
$pages  : array<string|int, mixed>
Array of all pages of the form.
$plugin_name  : string
The unique identifier of this plugin.
$sections  : array<string|int, mixed>
Array of all sections of the form.
$session_id  : str
The id of this session
$slug  : string
Slug of this form.
$environment  : O3PO_Environment
Environment
$storage  : array<string|int, mixed>
Storage used by this form.

Methods

__construct()  : mixed
Construct this form
checked()  : mixed
Ensure that a check box field is checked
checked_if_on_or_past_containing_page_unless_back_or_upload()  : mixed
Ensure that a check box field is checked
checked_or_unchecked()  : mixed
Restrict input to checked or unchecked fields
do_parse_request()  : mixed
Parse form requests
generate_session_id()  : string
Generate a unique session id
get_errors()  : array<string|int, mixed>
Return all errors
get_field_default()  : string
Get the default value of a field by id.
get_field_defaults()  : mixed
Get the default values of all fields.
get_field_title()  : mixed
Get the title of a field by id.
get_field_value()  : mixed
Get the value of a field by id.
get_page_to_display()  : string
Return page to display
handle_form_data_and_produce_content()  : mixed
Handle the form data and render the form
init()  : mixed
Adds a rewrite endpoint for the form.
leave_unchanged()  : mixed
Leave user input to field unchanged.
non_empty_if_payment_method_is_invoice_and_on_or_past_containing_page()  : mixed
Validate that field is non empty under certain conditions
on_submit()  : bool
On submit
one_of_invoice_noinvoice_waiver()  : mixed
Validate the payment method input
read_and_validate_field_values()  : mixed
Read all form values from $_POST and process.
render_abstract()  : mixed
Render the abstract field
render_acceptance_code()  : mixed
Render the acceptance code field
render_acceptance_codes_setting()  : mixed
Render the setting for valid acceptance codes
render_agree_to_publish()  : mixed
Render the agreement ot publish checkbox
render_array_as_comma_separated_list_field()  : mixed
Render an array as comma separated list type field.
render_author_data()  : mixed
Render the author data field(s)
render_author_data_summary()  : mixed
Render the summary of the author data
render_basic_manuscript_data_section()  : mixed
Render the help text of the basic manuscript data section
render_checkbox_field()  : mixed
Render a checkbox type field.
render_comments()  : mixed
Render the comments text box.
render_copyright_confirmation()  : mixed
Render the check box to confirm the copyright
render_corresponding_author_email()  : mixed
Render the corresponding author email field
render_dissemination_material_section()  : mixed
Render the help text of the dissemination material section
render_dissemination_multimedia()  : mixed
Render the multi media text box
render_eprint_field()  : mixed
Render the eprint field
render_featured_image_caption()  : mixed
Render the feature image caption text box
render_featured_image_upload()  : mixed
Render the featured image upload
render_fermats_library()  : mixed
Render the Fermat's library checkbox
render_funder_information()  : mixed
Render the funder information field(s)
render_funder_information_summary()  : mixed
Render the summary of the funder information
render_image_upload_field()  : mixed
Render an image upload field
render_invoice_address()  : mixed
Render the invoice address field
render_invoice_recipient()  : mixed
Render the invoice recipient field
render_invoice_vat_number()  : mixed
Render the invoice recipient vat number field
render_manuscript_data_section()  : mixed
Render the help text of the manuscript meta-data section
render_multi_line_field()  : mixed
Render a multi line text box type field.
render_navigation()  : mixed
Render the form navigation
render_password_field()  : mixed
Render a password field.
render_payment_amount()  : mixed
Render the payment amount select box
render_payment_method()  : mixed
Render the payment method section.
render_popular_summary()  : mixed
Render the popular summary text box
render_ready2publish_settings()  : mixed
Render the lead in text of the settings of this form
render_select_field()  : mixed
Render a select type field.
render_single_line_field()  : mixed
Render a standard text box type field.
render_summary()  : mixed
Render the form summary
render_title()  : mixed
Render the title field
sanitize_user_input()  : string
Sanitize user input
specify_fake_field()  : mixed
Add a fake field
specify_field()  : mixed
Specify a field of the form.
specify_page()  : mixed
Specify a section of the form.
specify_section()  : mixed
Specify a section of the form.
specify_settings()  : mixed
Specify the settings of this form
submitted_message()  : string
Render the final message after form submission
trim()  : mixed
Trim user input to field
trim_strip_tags()  : mixed
Trim user input to field
validate_acceptance_code()  : string
Validate the provided acceptance code
validate_array_as_comma_separated_list()  : mixed
Validate input to comma separated list fields.
validate_array_of_at_most_1000_checked_or_unchecked()  : mixed
Validate an array of at most 1000 values of checked or unchecked
validate_array_of_at_most_1000_name_styles()  : mixed
Validate that an array of at most 1000 name styles
validate_array_of_at_most_1000_names()  : mixed
Validate that an array of at most 1000 names
validate_array_of_at_most_1000_roles()  : mixed
Validate an array of at most 1000 editor coordinator or steering board entries
validate_array_of_at_most_1000_urls()  : mixed
Validate an array of at most 1000 urls
validate_array_of_at_most_1000_urls_or_empty()  : mixed
Validate an array of at most 1000 urls or empty fields
validate_array_of_at_most_1000_uuidv4s()  : mixed
Validate that an array consists of at most 1000 UUIDv4s
validate_array_of_at_most_1000_years()  : mixed
Validate that an array of at most 1000 years
validate_array_of_at_most_1000_years_or_empty()  : mixed
Validate that an array of at most 1000 years or empty
validate_doi_prefix()  : mixed
Clean user input to doi_prefix fields
validate_doi_suffix()  : mixed
Clean user input to doi_suffix fields
validate_email()  : mixed
Clean user input to email fields
validate_eprint()  : string
Clean user input to eprint fields
validate_eprint_fetch_meta_data_check_license_and_store_in_session()  : string
Validate the license and fetch and store meta-data from the arXiv
validate_featured_image_upload()  : array<string|int, mixed>
Validate the feature image upload
validate_four_digit_year()  : mixed
Clean user input to fields expecting a year.
validate_issn()  : mixed
Clean user input to issn fields
validate_issn_or_empty()  : string
Clean user input to issn fields
validate_non_negative_euros()  : mixed
Validate non-negative euro fields
validate_non_negative_float()  : mixed
Validate non-negative float
validate_positive_integer()  : mixed
Validate positive integer fields
validate_role()  : mixed
Restrict input to valid roles of people working for the journal
validate_session_id()  : mixed
Check whether an id is a valid session id
validate_two_letter_country_code()  : mixed
Validate two letter country code fields
validate_url()  : mixed
Clean user input to url fields
add_error()  : mixed
Add an error or warning to the list of errors
add_sideloaded_files_to_media_library()  : mixed
Add the files uploaded by the user to the media library.
append_session_data()  : mixed
Append a field value pair to the current session data
get_session_data()  : mixed
Get field from the data of a session
put_session_data()  : mixed
Set field in the data of a session
specify_pages_sections_and_fields()  : mixed
Specifies form sections and fields.

Properties

$coming_from_page

The page id of the page the user is coming from

protected int $coming_from_page = \false

Page id.

Tags
since
0.4.0
access

private

$fields

Array of all field of the form.

protected array<string|int, mixed> $fields = array()

Dictionary of all fields and their properties.

Tags
since
0.4.0
access

protected

$pages

Array of all pages of the form.

protected array<string|int, mixed> $pages = array()
Tags
since
0.4.0
access

protected

$plugin_name

The unique identifier of this plugin.

protected string $plugin_name

The string used to uniquely identify this plugin.

Tags
since
0.1.0
access

private

$sections

Array of all sections of the form.

protected array<string|int, mixed> $sections = array()

Dictionary of all sections and their properties.

Tags
since
0.4.0
access

protected

$slug

Slug of this form.

protected string $slug

Used for css classes when rendering the sections and fields. Used then storing/retreiving data from the database.

Slug of the form.

Tags
since
0.4.0
access

protected

$storage

Storage used by this form.

private array<string|int, mixed> $storage

Storage of the form.

Tags
since
0.4.0
access

private

Methods

checked()

Ensure that a check box field is checked

public checked(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
sinde

0.4.0

access

public

checked_if_on_or_past_containing_page_unless_back_or_upload()

Ensure that a check box field is checked

public checked_if_on_or_past_containing_page_unless_back_or_upload(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
sinde

0.4.0

access

public

checked_or_unchecked()

Restrict input to checked or unchecked fields

public checked_or_unchecked(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

do_parse_request()

Parse form requests

public do_parse_request(bool $bool, WP $wp[, bool $do_not_exit = false ]) : mixed

Processes form input and displays the form.

Parameters
$bool : bool

Whether or not to parse the request.

$wp : WP

Current WordPress environment instance.

$do_not_exit : bool = false

Whether to exit after parsing the request. Can be set to false for testing only.

Tags
since
0.4.0
access

public

generate_session_id()

Generate a unique session id

public generate_session_id() : string
Tags
since
0.4.0
access

public

Return values
string —

Random hex string

get_errors()

Return all errors

public get_errors() : array<string|int, mixed>
Tags
since
0.4.0
access

public

Return values
array<string|int, mixed> —

All errors recorded so far.

get_field_default()

Get the default value of a field by id.

public get_field_default(int $id) : string
Parameters
$id : int

Id of the field.

Tags
since
0.4.0
acceess

public

Return values
string —

Default value of the field

get_field_defaults()

Get the default values of all fields.

public get_field_defaults([bool $include_fake_fields = false ]) : mixed
Parameters
$include_fake_fields : bool = false

Whether to also include fake fields in the list.

Tags
since
0.4.0
acceess

public

get_field_title()

Get the title of a field by id.

public get_field_title(int $id) : mixed
Parameters
$id : int

Id of the field.

Tags
since
0.4.0
acceess

prublic

get_field_value()

Get the value of a field by id.

public get_field_value(int $id) : mixed
Parameters
$id : int

Id of the field.

Tags
since
0.4.0
acceess

prublic

get_page_to_display()

Return page to display

public get_page_to_display() : string
Tags
since
0.4.0
access

public

Return values
string —

Page id to be displayed

handle_form_data_and_produce_content()

Handle the form data and render the form

public handle_form_data_and_produce_content() : mixed
Tags
since
0.4.0
access

public

init()

Adds a rewrite endpoint for the form.

public init() : mixed

To be added to the 'init' action.

Tags
since
0.1.0
access

public

leave_unchanged()

Leave user input to field unchanged.

public leave_unchanged(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

non_empty_if_payment_method_is_invoice_and_on_or_past_containing_page()

Validate that field is non empty under certain conditions

public non_empty_if_payment_method_is_invoice_and_on_or_past_containing_page(string $id, string $input) : mixed
Parameters
$id : string

Id of the field

$input : string

Input

Tags
since
0.4.0
access

public

on_submit()

On submit

public on_submit(array<string|int, mixed> $attach_ids) : bool

Executed on form submission. Stores the information in the storage and sends various emails.

Parameters
$attach_ids : array<string|int, mixed>

Id of attachments created during form submission.

Tags
since
0.4.0
access

public

Return values
bool —

Whether this step of form submission was successful.

one_of_invoice_noinvoice_waiver()

Validate the payment method input

public one_of_invoice_noinvoice_waiver(string $id, string $input) : mixed
Parameters
$id : string

Id of the field

$input : string

Input

Tags
since
0.4.0
access

public

read_and_validate_field_values()

Read all form values from $_POST and process.

public read_and_validate_field_values() : mixed
Tags
since
0.4.0
access

public

render_acceptance_code()

Render the acceptance code field

public render_acceptance_code() : mixed
Tags
since
0.4.0
access

public

render_acceptance_codes_setting()

Render the setting for valid acceptance codes

public static render_acceptance_codes_setting() : mixed
Tags
since
0.4.0
access

public

render_agree_to_publish()

Render the agreement ot publish checkbox

public render_agree_to_publish() : mixed
Tags
since
0.4.0
access

public

render_array_as_comma_separated_list_field()

Render an array as comma separated list type field.

public render_array_as_comma_separated_list_field(string $id[, string $placeholder = null ]) : mixed

Does not escape or otherwise handle individual fields that contain commas.

Parameters
$id : string

Id of the field.

$placeholder : string = null

Placeholder text.

Tags
since
0.3.0
access

public

render_author_data_summary()

Render the summary of the author data

public render_author_data_summary() : mixed
Tags
since
0.4.0
access

public

render_basic_manuscript_data_section()

Render the help text of the basic manuscript data section

public render_basic_manuscript_data_section() : mixed
Tags
since
0.4.0
access

public

render_checkbox_field()

Render a checkbox type field.

public render_checkbox_field(string $id[, string $label = '' ][, bool $esc_label = true ]) : mixed
Parameters
$id : string

Id of the field.

$label : string = ''

Label of the field.

$esc_label : bool = true

Whether to escape the content of $label, disable in case you want $label to contains htmls

Tags
since
0.1.0
access

public

Render the check box to confirm the copyright

public render_copyright_confirmation() : mixed
since
0.4.0
access

public

render_corresponding_author_email()

Render the corresponding author email field

public render_corresponding_author_email() : mixed
Tags
since
0.4.0
access

public

render_dissemination_material_section()

Render the help text of the dissemination material section

public render_dissemination_material_section() : mixed
Tags
since
0.4.0
access

public

render_dissemination_multimedia()

Render the multi media text box

public render_dissemination_multimedia() : mixed
Tags
since
0.4.0
access

public

Render the feature image caption text box

public render_featured_image_caption() : mixed
since
0.4.0
access

public

Render the featured image upload

public render_featured_image_upload() : mixed
since
0.4.0
access

public

render_fermats_library()

Render the Fermat's library checkbox

public render_fermats_library() : mixed
Tags
since
0.4.0
access

public

render_funder_information()

Render the funder information field(s)

public render_funder_information() : mixed
Tags
since
0.4.0
access

public

render_funder_information_summary()

Render the summary of the funder information

public render_funder_information_summary() : mixed
Tags
since
0.4.0
access

public

render_image_upload_field()

Render an image upload field

public render_image_upload_field(string $id[, string $label = '' ][, bool $esc_label = true ]) : mixed
Parameters
$id : string

Id of the field

$label : string = ''

Label of the field. May contain html and is not escaped!

$esc_label : bool = true

Whether to escape the label

Tags
since
0.0.4
access

public

render_invoice_address()

Render the invoice address field

public render_invoice_address() : mixed
Tags
since
0.4.0
access

public

render_invoice_recipient()

Render the invoice recipient field

public render_invoice_recipient() : mixed
Tags
since
0.4.0
access

public

render_invoice_vat_number()

Render the invoice recipient vat number field

public render_invoice_vat_number() : mixed
Tags
since
0.4.0
access

public

render_manuscript_data_section()

Render the help text of the manuscript meta-data section

public render_manuscript_data_section() : mixed
Tags
since
0.4.0
access

public

render_multi_line_field()

Render a multi line text box type field.

public render_multi_line_field(string $id[, int $rows = false ][, string $style = false ][, bool $preview = false ][, string $placeholder = false ]) : mixed
Parameters
$id : string

Id of the field.

$rows : int = false

Number of rows

$style : string = false

CSS style

$preview : bool = false

Whether to show a LaTeX preview below the field.

$placeholder : string = false

Placeholder

Tags
since
0.4.0
access

public

render_navigation()

Render the form navigation

public render_navigation(int $previous_page_id, int $page_id, int $next_page_id) : mixed
Parameters
$previous_page_id : int

Id of the previous page

$page_id : int

Id of this page

$next_page_id : int

Id of the next page

Tags
since
0.4.0
access

public

render_password_field()

Render a password field.

public render_password_field(string $id) : mixed
Parameters
$id : string

Id of the field.

Tags
since
0.1.0
access

public

render_payment_amount()

Render the payment amount select box

public render_payment_amount() : mixed
Tags
since
0.4.0
access

public

render_payment_method()

Render the payment method section.

public render_payment_method() : mixed
Tags
since
0.4.0
access

public

Render the popular summary text box

public render_popular_summary() : mixed
since
0.4.0
access

public

render_ready2publish_settings()

Render the lead in text of the settings of this form

public static render_ready2publish_settings() : mixed
Tags
since
0.4.0
access

public

render_select_field()

Render a select type field.

public render_select_field(string $id, array<string|int, mixed> $options[, string $onchange = false ][, mixed $label = '' ][, mixed $esc_label = true ]) : mixed
Parameters
$id : string

Id of the field.

$options : array<string|int, mixed>

The options between which to select

$onchange : string = false

The HTML onchange parameter

$label : mixed = ''
$esc_label : mixed = true
Tags
since
0.4.0
access

public

render_single_line_field()

Render a standard text box type field.

public render_single_line_field(string $id[, string|null $placeholder = null ][, string $autocomplete = 'on' ][, string $style = false ][, string $label = false ][, bool $esc_label = true ][, string $label_style = false ][, mixed $fallback_value = false ][, mixed $readonly = false ][, mixed $default_generator = false ]) : mixed
Parameters
$id : string

Id of the field.

$placeholder : string|null = null

Placeholder text (default is null).

$autocomplete : string = 'on'

Whether to auto complete 'on' (default) or 'off.

$style : string = false

CSS style.

$label : string = false

HTML label.

$esc_label : bool = true

Whether to escape the content of label.

$label_style : string = false

CSS style for the label.

$fallback_value : mixed = false
$readonly : mixed = false
$default_generator : mixed = false
Tags
since
0.4.0
access

public

render_summary()

Render the form summary

public render_summary() : mixed
Tags
since
0.4.0
access

public

sanitize_user_input()

Sanitize user input

public sanitize_user_input(string $input) : string
Parameters
$input : string

The input to sanitize.

Tags
since
0.4.0
access

public

Return values
string —

Sanitized input

specify_fake_field()

Add a fake field

public specify_fake_field(string $id, string $default) : mixed

Fake fields cannot be modified, but have default values that can be used to avoid hard coding values.

Parameters
$id : string

Slug-name to identify the section. Used in the 'id' attribute of tags.

$default : string

Default value for the field.

Tags
since
0.4.0
access

private

specify_field()

Specify a field of the form.

public specify_field(string $id, string $title, callable $callback, string $page, string $section, array<string|int, mixed> $args, callable $validation_callable, string $default[, int $max_length = false ]) : mixed

Keeps a record of all fields in $this->fields.

Parameters
$id : string

Slug-name to identify the field. Used in the 'id' attribute of tags.

$title : string

Formatted title of the field. Shown as the heading for the field.

$callback : callable

Function that echos out any content at the top of the field (between heading and fields).

$page : string

The slug-name of the page on which to show the field.

$section : string

The slug-name of the section in which to show the field.

$args : array<string|int, mixed>

{ Extra arguments used when outputting the field. May be an empty array().

@type string $label_for When supplied, the label will be wrapped
                        in a `<label>` element, its `for` attribute populated
                        with this value.
@type string $class     CSS Class to be added to the `<tr>` element when the
                        field is output.

}

$validation_callable : callable

Callable to use during validation of inputs. Must take a field ID and input as parameters and return a valid value for the field. Should call $this->add_error() to indicate problems.

$default : string

Default value for the field.

$max_length : int = false

Maximum length of the value of the field.

Tags
since
0.4.0
access

private

specify_page()

Specify a section of the form.

public specify_page(string $id, string $title[, callable $callback = null ]) : mixed

Keeps a record of all sections in $this->sections.

Parameters
$id : string

Slug-name to identify the page.

$title : string

Formatted title of the section. Shown as the heading for the section.

$callback : callable = null

Function that echos out the any content at the top of the page (before the first section).

Tags
since
0.4.0
access

private

specify_section()

Specify a section of the form.

public specify_section(string $id, string $title, callable $callback, string $page[, callable $summary_callback = null ]) : mixed

Keeps a record of all sections in $this->sections.

Parameters
$id : string

Slug-name to identify the section. Used in the 'id' attribute of tags.

$title : string

Formatted title of the section. Shown as the heading for the section.

$callback : callable

Function that echos out any content at the top of the section (between heading and fields).

$page : string

The slug-name of the page on which to show the section.

$summary_callback : callable = null

Callback to call when composing the summary of this form.

Tags
since
0.4.0
access

private

submitted_message()

Render the final message after form submission

public submitted_message(bool $submitted_successfully) : string
Parameters
$submitted_successfully : bool

Whether the form submission was successful.

Tags
since
0.4.0
access

public

Return values
string —

The message

trim()

Trim user input to field

public trim(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

trim_strip_tags()

Trim user input to field

public trim_strip_tags(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_acceptance_code()

Validate the provided acceptance code

public validate_acceptance_code(string $id, string $input) : string
Parameters
$id : string

Id of the field

$input : string

The input

Tags
since
0.4.0
access

public

Return values
string —

The acceptance code if valid otherwise the field default value

validate_array_as_comma_separated_list()

Validate input to comma separated list fields.

public validate_array_as_comma_separated_list(string $id, string $input) : mixed

Break a comma separated list into an array of fields.

Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_array_of_at_most_1000_checked_or_unchecked()

Validate an array of at most 1000 values of checked or unchecked

public validate_array_of_at_most_1000_checked_or_unchecked(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_name_styles()

Validate that an array of at most 1000 name styles

public validate_array_of_at_most_1000_name_styles(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.0
access

private

validate_array_of_at_most_1000_names()

Validate that an array of at most 1000 names

public validate_array_of_at_most_1000_names(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_roles()

Validate an array of at most 1000 editor coordinator or steering board entries

public validate_array_of_at_most_1000_roles(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_urls()

Validate an array of at most 1000 urls

public validate_array_of_at_most_1000_urls(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_urls_or_empty()

Validate an array of at most 1000 urls or empty fields

public validate_array_of_at_most_1000_urls_or_empty(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_uuidv4s()

Validate that an array consists of at most 1000 UUIDv4s

public validate_array_of_at_most_1000_uuidv4s(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.3
access

private

validate_array_of_at_most_1000_years()

Validate that an array of at most 1000 years

public validate_array_of_at_most_1000_years(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_array_of_at_most_1000_years_or_empty()

Validate that an array of at most 1000 years or empty

public validate_array_of_at_most_1000_years_or_empty(string $id, array<string|int, mixed> $input) : mixed
Parameters
$id : string

The id of the field whose input is validated.

$input : array<string|int, mixed>

The input.

Tags
since
0.4.1
access

private

validate_doi_prefix()

Clean user input to doi_prefix fields

public validate_doi_prefix(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.0
access

private

validate_doi_suffix()

Clean user input to doi_suffix fields

public validate_doi_suffix(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.0
access

private

validate_email()

Clean user input to email fields

public validate_email(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.0
access

private

validate_eprint()

Clean user input to eprint fields

public validate_eprint(string $id, string $input) : string
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.0
access

private

Return values
string —

Valid issn or empty string.

validate_eprint_fetch_meta_data_check_license_and_store_in_session()

Validate the license and fetch and store meta-data from the arXiv

public validate_eprint_fetch_meta_data_check_license_and_store_in_session(string $id, string $input) : string
Parameters
$id : string

Id of the field

$input : string

The input

Tags
since
0.4.0
access

public

Return values
string —

The eprint

Validate the feature image upload

public validate_featured_image_upload(string $id, array<string|int, mixed> $file_of_this_id) : array<string|int, mixed>
Parameters
$id : string

Id of the image upload field

$file_of_this_id : array<string|int, mixed>

Array with fields such as those of a single element of the $_FILES variable

since
0.4.0
access

public

Return values
array<string|int, mixed> —

Various image upload information

validate_four_digit_year()

Clean user input to fields expecting a year.

public validate_four_digit_year(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.1
access

private

validate_issn()

Clean user input to issn fields

public validate_issn(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_issn_or_empty()

Clean user input to issn fields

public validate_issn_or_empty(string $id, string $input) : string
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.0
access

private

Return values
string —

Valid issn or empty string.

validate_non_negative_euros()

Validate non-negative euro fields

public validate_non_negative_euros(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_non_negative_float()

Validate non-negative float

public validate_non_negative_float(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_positive_integer()

Validate positive integer fields

public validate_positive_integer(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_role()

Restrict input to valid roles of people working for the journal

public validate_role(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.4.1
access

private

validate_session_id()

Check whether an id is a valid session id

public validate_session_id(int $id) : mixed
Parameters
$id : int

Id to validate

Tags
since
0.4.0
Return values
mixed —

Session id or False if invalid.

validate_two_letter_country_code()

Validate two letter country code fields

public validate_two_letter_country_code(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

validate_url()

Clean user input to url fields

public validate_url(string $id, string $input) : mixed
Parameters
$id : string

The field this was input to.

$input : string

User input.

Tags
since
0.3.0
access

private

add_error()

Add an error or warning to the list of errors

protected add_error(string $setting, string $code, string $message[, string $type = 'error' ]) : mixed
Parameters
$setting : string

Setting that produced the error.

$code : string

Error code.

$message : string

Error message

$type : string = 'error'

Type of error, one of 'error' or 'warning'.

Tags
since
0.4.0
access

public

add_sideloaded_files_to_media_library()

Add the files uploaded by the user to the media library.

protected add_sideloaded_files_to_media_library() : mixed
Tags
since
0.4.0
access

protected

append_session_data()

Append a field value pair to the current session data

protected append_session_data(string $field, mixed $value) : mixed
Parameters
$field : string

The field to set.

$value : mixed

The value to set.

Tags
since
0.4.0

get_session_data()

Get field from the data of a session

protected get_session_data(string $field[, mixed $default = null ][, string $session_id = null ]) : mixed
Parameters
$field : string

The field to get.

$default : mixed = null

The default value in case the field is not set.

$session_id : string = null

The session id for which to get the field.

Tags
since
0.4.0

put_session_data()

Set field in the data of a session

protected put_session_data(string $field, mixed $value[, string $session_id = null ]) : mixed
Parameters
$field : string

The field to set.

$value : mixed

The value to set.

$session_id : string = null

The session id for which to set the field.

Tags
since
0.4.0

specify_pages_sections_and_fields()

Specifies form sections and fields.

protected specify_pages_sections_and_fields() : mixed
Tags
since
0.4.0
access

private


        
On this page

Search results