HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Form templates

» Return to Contents



sources/form_templates.php

Global_functions_form_templates.php

Function summary

void init__form_templates ()
void handle_max_file_size (tempcode hidden, ID_TEXT regular_max_size_type)
array get_attachments (ID_TEXT posting_field_name)
tempcode get_posting_form (mixed submit_name, LONG_TEXT post, mixed post_url, tempcode hidden_fields, tempcode specialisation, ?mixed post_comment, string extra, ?tempcode specialisation2, ?tempcode default_parsed, ?string javascript, ?integer tabindex, boolean required, boolean has_preview)
tempcode get_comcode_editor (string field_name, boolean cut_down)
boolean wysiwyg_on ()
?string get_field_restrict_property (string property, string field, ?string page, ?string type)
tempcode form_input_codename (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?integer _maxlength)
tempcode form_input_line (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?integer _maxlength, string type)
tempcode form_input_username (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, boolean needs_match, ?integer tabindex)
tempcode form_input_author (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)
tempcode form_input_email (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)
tempcode form_input_colour (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, boolean true_field)
tempcode form_input_page_link (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?ID_TEXT page_type)
tempcode form_input_line_comcode (mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)
tempcode form_input_line_multi (mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, ?integer tabindex, string class)
tempcode form_input_text_multi (mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, ?integer tabindex)
tempcode form_input_username_multi (mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, boolean needs_match, ?integer tabindex)
tempcode form_input_text (mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, boolean scrolls)
tempcode form_input_text_comcode (mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, boolean force_non_wysiwyg, mixed description_side, ?tempcode default_parsed, boolean scrolls)
tempcode form_input_huge_comcode (mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, integer rows, mixed description_side, ?tempcode default_parsed, boolean scrolls)
tempcode form_input_huge (mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, integer rows, mixed description_side, boolean scrolls)
tempcode form_input_password (mixed pretty_name, mixed description, ID_TEXT name, boolean required, ?integer tabindex, string default)
tempcode form_input_tick (mixed pretty_name, mixed description, ID_TEXT name, boolean ticked, ?integer tabindex, ID_TEXT value)
tempcode form_input_various_ticks (array options, mixed description, ?integer _tabindex, mixed _pretty_name, boolean simple_style)
tempcode form_input_upload (mixed pretty_name, mixed description, ID_TEXT name, boolean required, ?string default, ?integer tabindex, boolean swfupload, string filter)
tempcode form_input_upload_multi (mixed pretty_name, mixed description, string name, boolean required, ?integer tabindex, ?array default, boolean swfupload, string filter)
tempcode form_input_list (mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, boolean inline_list, boolean required)
tempcode form_input_tree_list (mixed pretty_name, mixed description, ID_TEXT name, ?ID_TEXT root_id, string hook, array options, boolean required, ?string default, boolean use_server_id, ?integer tabindex)
tempcode form_input_huge_list (mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, boolean inline_list, boolean required, ?integer size)
tempcode form_input_multi_list (mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, integer size, boolean required)
tempcode form_input_all_and_not (mixed pretty_name, mixed description, string base, tempcode list, string type, ?integer tabindex)
tempcode form_input_radio (mixed pretty_name, mixed description, tempcode content, boolean required, boolean picture_contents, string selected_path)
tempcode form_input_picture_choose_specific (mixed pretty_name, mixed description, ID_TEXT name, array ids, ?URLPATH selected_url, ?string selected_code, ?integer tabindex, boolean allow_none, ?object db, ?ID_TEXT theme, ?ID_TEXT lang)
tempcode wrap_image_radio_list (array entries)
tempcode form_input_date__scheduler (mixed pretty_name, mixed description, ID_TEXT stub, boolean null_ok, boolean null_default, boolean do_time, ?mixed default_time, integer total_years_to_show, ?integer year_start, ?integer tabindex)
tempcode form_input_date (mixed pretty_name, mixed description, ID_TEXT stub, boolean null_ok, boolean null_default, boolean do_time, ?mixed default_time, ?integer total_years_to_show, ?integer year_start, ?integer tabindex, ?boolean required, boolean do_date, ?ID_TEXT timezone, boolean handle_timezone)
tempcode form_input_integer (mixed pretty_name, mixed description, ID_TEXT name, ?integer default, boolean required, ?integer tabindex)
tempcode form_input_float (mixed pretty_name, mixed description, ID_TEXT name, ?float default, boolean required, ?integer tabindex)
tempcode _form_input (ID_TEXT name, mixed pretty_name, mixed description, tempcode input, boolean required, boolean comcode, ?integer tabindex, boolean w, boolean skip_label, mixed description_side)
array handle_conflict_resolution (?ID_TEXT id, boolean only_staff)
integer get_form_field_tabindex (?integer tabindex)
tempcode form_input_radio_entry (string name, string value, boolean selected, mixed text, ?integer tabindex, string description)

void init__form_templates()

Standard code module initialisation function.

Parameters…

(No return value)


Return to the function index for this class Expand: View the source code to this function

void handle_max_file_size(tempcode hidden, ID_TEXT regular_max_size_type)

Insert hidden data for the maximum file size of form fields.

Parameters…

Name hidden
Description Hidden fields
Type tempcode

Name regular_max_size_type
Description Code representing the media types we are using limits for
Default value file
Type ID_TEXT
Values restricted to image file

(No return value)


Return to the function index for this class Expand: View the source code to this function

array get_attachments(ID_TEXT posting_field_name)

Get what we need to get attachments in a form-field interface.

Parameters…

Name posting_field_name
Description The name of the field attachments are for
Type ID_TEXT

Returns…

Description A pair: the attachments UI (tempcode), the hidden attachment field
Type array

Return to the function index for this class Expand: View the source code to this function

tempcode get_posting_form(mixed submit_name, LONG_TEXT post, mixed post_url, tempcode hidden_fields, tempcode specialisation, ?mixed post_comment, string extra, ?tempcode specialisation2, ?tempcode default_parsed, ?string javascript, ?integer tabindex, boolean required, boolean has_preview)

Creates a posting form, with attachment support.

Parameters…

Name submit_name
Description The title of the form submission button
Type mixed

Name post
Description The default post to put in.
Type LONG_TEXT

Name post_url
Description Where the form is sent (URLPATH or Tempcode).
Type mixed

Name hidden_fields
Description A form_input_hidden buildup of hidden fields (additional parameters sent to the target URL).
Type tempcode

Name specialisation
Description A buildup of leading extra fields, in a format compatible with the templates used by this function.
Type tempcode

Name post_comment
Description The post comment (string or Tempcode). This gives information about how you should post. (NULL: no post comment)
Default value
Type ?mixed

Name extra
Description Extra info to put on the posting form
Default value
Type string

Name specialisation2
Description A buildup of trailing extra fields, in a format compatible with the templates used by this function. (NULL: none)
Default value
Type ?tempcode

Name default_parsed
Description The parsed Comcode. (NULL: calculate)
Default value
Type ?tempcode

Name javascript
Description Javascript code to include (NULL: none)
Default value
Type ?string

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name required
Description Whether this is a required input field
Default value boolean-true
Type boolean

Name has_preview
Description Whether the form supports previewing
Default value boolean-true
Type boolean

Returns…

Description The posting form
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode get_comcode_editor(string field_name, boolean cut_down)

Creates a Comcode editor.

Parameters…

Name field_name
Description The name of the field the editor is working for
Default value post
Type string

Name cut_down
Description Whether to make a cut-down version
Default value boolean-false
Type boolean

Returns…

Description The Comcode editor
Type tempcode

Return to the function index for this class Expand: View the source code to this function

boolean wysiwyg_on()

Find whether WYSIWYG is currently on.

Parameters…

Returns…

Description Whether it is
Type boolean

Return to the function index for this class Expand: View the source code to this function

?string get_field_restrict_property(string property, string field, ?string page, ?string type)

Get the value of a scoped field restriction property. Returns "first-found".

Parameters…

Name property
Description The name of the property
Type string

Name field
Description The name of the field it's scoped for
Type string

Name page
Description The page name scoped for (NULL: current page)
Default value
Type ?string

Name type
Description The page type scoped for (NULL: current type)
Default value
Type ?string

Returns…

Description The property (NULL: non-existant)
Type ?string

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_codename(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?integer _maxlength)

Get the tempcode for a codename input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name _maxlength
Description The maximum length of the field (NULL: default 80)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_line(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?integer _maxlength, string type)

Get the tempcode for a text input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name _maxlength
Description The maximum length of the field (NULL: default 255)
Default value
Type ?integer

Name type
Description The input type (only used if HTML5 enabled)
Default value text
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_username(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, boolean needs_match, ?integer tabindex)

Get the tempcode for a username input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name needs_match
Description Whether it is required than a valid username is given
Default value boolean-true
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_author(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)

Get the tempcode for a author/username input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_email(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)

Get the tempcode for a email-address input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_colour(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, boolean true_field)

Get the tempcode for a colour input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name true_field
Description Whether to display as a true/standard ocPortal input field, neatly along other different kinds of input fields
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_page_link(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex, ?ID_TEXT page_type)

Get the tempcode for a page-link input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name page_type
Description Page type to show (NULL: all)
Default value
Type ?ID_TEXT

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_line_comcode(mixed pretty_name, mixed description, ID_TEXT name, ?string default, boolean required, ?integer tabindex)

Get the tempcode for a comcode-enabled text input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: blank)
Type ?string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_line_multi(mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, ?integer tabindex, string class)

Get the tempcode for a DHTML input field that takes multiple lines. A new line is added when the prior one isn't blank.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The base parameter name which this input field is for (as this takes multiple parameters, they are named <name><x>). This name must end with '_'.
Type ID_TEXT

Name default_array
Description An array of lines to use as default (at least this many lines, filled by this array, will be presented by default)
Type array

Name num_required
Description The minimum number of inputs allowed.
Type integer

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name class
Description CSS class for input.
Default value line
Type string
Values restricted to line email

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_text_multi(mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, ?integer tabindex)

Get the tempcode for a DHTML input field that takes multiple textareas. A new textarea is added when the prior one isn't blank.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The base parameter name which this input field is for (as this takes multiple parameters, they are named <name><x>). This name must end with '_'.
Type ID_TEXT

Name default_array
Description An array of texts to use as default (at least this many textareas, filled by this array, will be presented by default)
Type array

Name num_required
Description The minimum number of textareas allowed.
Type integer

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_username_multi(mixed pretty_name, mixed description, ID_TEXT name, array default_array, integer num_required, boolean needs_match, ?integer tabindex)

Get the tempcode for a username input line.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The base parameter name which this input field is for (as this takes multiple parameters, they are named <name><x>). This name must end with '_'.
Type ID_TEXT

Name default_array
Description An array of lines to use as default (at least this many lines, filled by this array, will be presented by default)
Type array

Name num_required
Description The minimum number of inputs allowed
Type integer

Name needs_match
Description Whether this is a required input field
Default value boolean-true
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_text(mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, boolean scrolls)

Get the tempcode for a text input (textarea).

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field
Type string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name scrolls
Description Whether the field scrolls
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_text_comcode(mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, boolean force_non_wysiwyg, mixed description_side, ?tempcode default_parsed, boolean scrolls)

Get the tempcode for a comcode-enabled text input (textarea).

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field
Type string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name force_non_wysiwyg
Description Force non-WYSIWYG and non default-Comcode parsing
Default value boolean-false
Type boolean

Name description_side
Description A secondary side description for this input field
Default value
Type mixed

Name default_parsed
Description The parsed Comcode. (NULL: calculate)
Default value
Type ?tempcode

Name scrolls
Description Whether the field scrolls
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_huge_comcode(mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, integer rows, mixed description_side, ?tempcode default_parsed, boolean scrolls)

Get the tempcode for a huge comcode-enabled text input (textarea). These need extra space to fit. This function is also used as an automatic replacement for form_input_text_comcode if WYSIWYG is available (as WYSIWYG needs more space too)

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field
Type string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name rows
Description The number of rows to use
Default value 20
Type integer

Name description_side
Description A secondary side description for this input field
Default value
Type mixed

Name default_parsed
Description The parsed Comcode. (NULL: calculate)
Default value
Type ?tempcode

Name scrolls
Description Whether the field scrolls
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_huge(mixed pretty_name, mixed description, ID_TEXT name, string default, boolean required, ?integer tabindex, integer rows, mixed description_side, boolean scrolls)

Get the tempcode for a huge text input (textarea).

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field
Type string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name rows
Description The number of rows to use
Default value 20
Type integer

Name description_side
Description A secondary side description for this input field
Default value
Type mixed

Name scrolls
Description Whether the field scrolls
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_password(mixed pretty_name, mixed description, ID_TEXT name, boolean required, ?integer tabindex, string default)

Get the tempcode for a password input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name default
Description The default value for this input field
Default value
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_tick(mixed pretty_name, mixed description, ID_TEXT name, boolean ticked, ?integer tabindex, ID_TEXT value)

Get the tempcode for a checkbox input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name ticked
Description Whether this is ticked by default
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name value
Description The value the checkbox passes when ticked
Default value 1
Type ID_TEXT

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_various_ticks(array options, mixed description, ?integer _tabindex, mixed _pretty_name, boolean simple_style)

Get the tempcode for a bank of tick boxes.

Parameters…

Name options
Description A list of tuples: (prettyname, name, value, description)
Type array

Name description
Description A description for this input field
Type mixed

Name _tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name _pretty_name
Description A human intelligible name for this input field (blank: use default)
Default value
Type mixed

Name simple_style
Description Whether to place each tick on a new line
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_upload(mixed pretty_name, mixed description, ID_TEXT name, boolean required, ?string default, ?integer tabindex, boolean swfupload, string filter)

Get the tempcode for a file upload input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name required
Description Whether this is a required input field
Type boolean

Name default
Description The default value for the field (NULL: none) (blank: none)
Default value
Type ?string

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name swfupload
Description Whether swf-upload-style is preferred
Default value boolean-true
Type boolean

Name filter
Description File-type filter to limit to, comma-separated file extensions (might not be supported)
Default value
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_upload_multi(mixed pretty_name, mixed description, string name, boolean required, ?integer tabindex, ?array default, boolean swfupload, string filter)

Get the tempcode for a multiple file upload input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The base name which this input field is for
Type string

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name default
Description The default value for the field (NULL: none)
Default value
Type ?array

Name swfupload
Description Whether swf-upload-style is preferred
Default value boolean-true
Type boolean

Name filter
Description File-type filter to limit to, comma-separated file extensions (might not be supported)
Default value
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_list(mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, boolean inline_list, boolean required)

Get the tempcode for a listbox.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name content
Description The list entries for our list
Type tempcode

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name inline_list
Description Whether this is an inline displayed list as opposed to a dropdown
Default value boolean-false
Type boolean

Name required
Description Whether this is required
Default value boolean-true
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_tree_list(mixed pretty_name, mixed description, ID_TEXT name, ?ID_TEXT root_id, string hook, array options, boolean required, ?string default, boolean use_server_id, ?integer tabindex)

Get the tempcode for an AJAX-powered tree listbox.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name root_id
Description The ID to do under (NULL: root)
Type ?ID_TEXT

Name hook
Description The ajax tree-list hook that drives our data
Type string

Name options
Description A map of special options
Type array

Name required
Description Whether this is a required input field
Type boolean

Name default
Description The default value for the field (NULL: none)
Default value
Type ?string

Name use_server_id
Description Whether to use the server-ID in the list instead of the ID in the list
Default value boolean-false
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_huge_list(mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, boolean inline_list, boolean required, ?integer size)

Get the tempcode for a huge listbox.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name content
Description The list entries for our list
Type tempcode

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name inline_list
Description Whether this is an inline displayed list as opposed to a dropdown
Default value boolean-false
Type boolean

Name required
Description Whether this is required
Default value boolean-true
Type boolean

Name size
Description Size of list (NULL: default)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_multi_list(mixed pretty_name, mixed description, ID_TEXT name, tempcode content, ?integer tabindex, integer size, boolean required)

Get the tempcode for a listbox with multiple selections.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name content
Description The list entries for our list
Type tempcode

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name size
Description How much space the list takes up
Default value 5
Type integer

Name required
Description Whether at least one must be selected
Default value boolean-false
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_all_and_not(mixed pretty_name, mixed description, string base, tempcode list, string type, ?integer tabindex)

Get the tempcode for a complex input that chooses partials from a list ('all', 'all-except-these', or 'these').

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name base
Description The base name which this input field is for
Type string

Name list
Description A list culmulation to select against
Type tempcode

Name type
Description The current type of partial selection
Default value +
Type string
Values restricted to + - *

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_radio(mixed pretty_name, mixed description, tempcode content, boolean required, boolean picture_contents, string selected_path)

Get the tempcode for a radio group.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name content
Description The radio buttons for our radio group
Type tempcode

Name required
Description Whether a radio selection is required
Default value boolean-false
Type boolean

Name picture_contents
Description Whether this is a picture-based radio list
Default value boolean-false
Type boolean

Name selected_path
Description Default value (only appropriate if has picture contents)
Default value
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_picture_choose_specific(mixed pretty_name, mixed description, ID_TEXT name, array ids, ?URLPATH selected_url, ?string selected_code, ?integer tabindex, boolean allow_none, ?object db, ?ID_TEXT theme, ?ID_TEXT lang)

Get the tempcode to choose a picture from the given list of images in the theme image system, with sub-categorisation.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name ids
Description A list of image IDs (codes) we can choose from
Type array

Name selected_url
Description The currently selected entry in our picture choosing, by URL (NULL: none)
Default value
Type ?URLPATH

Name selected_code
Description The currently selected entry in our picture choosing, by code (NULL: none)
Default value
Type ?string

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name allow_none
Description Whether to allow the selection of 'no' picture
Default value boolean-false
Type boolean

Name db
Description The database connection to the OCF install we are choosing images from (NULL: site db)
Default value
Type ?object

Name theme
Description Theme to use (NULL: current theme)
Default value
Type ?ID_TEXT

Name lang
Description Language to use (NULL: current language)
Default value
Type ?ID_TEXT

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode wrap_image_radio_list(array entries)

Get the tempcode for a radio list of pictures.

Parameters…

Name entries
Description A list of image radio buttons
Type array

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_date__scheduler(mixed pretty_name, mixed description, ID_TEXT stub, boolean null_ok, boolean null_default, boolean do_time, ?mixed default_time, integer total_years_to_show, ?integer year_start, ?integer tabindex)

Get the tempcode for a date input, or if cron is not on, return blank.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name stub
Description The parameter name stub for this input field (it's actually a composite field, read in by passing this stub to post_param_date)
Type ID_TEXT

Name null_ok
Description Whether this is a required field
Type boolean

Name null_default
Description Whether this field is empty by default
Type boolean

Name do_time
Description Whether to input time for this field also
Type boolean

Name default_time
Description The default timestamp to use (either TIME or array of time components) (NULL: now)
Default value
Type ?mixed

Name total_years_to_show
Description The number of years to allow selection from (all into the future, as this field type is not meant for inputting past dates)
Default value 10
Type integer

Name year_start
Description The year to start from (NULL: this year)
Default value
Type ?integer

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_date(mixed pretty_name, mixed description, ID_TEXT stub, boolean null_ok, boolean null_default, boolean do_time, ?mixed default_time, ?integer total_years_to_show, ?integer year_start, ?integer tabindex, ?boolean required, boolean do_date, ?ID_TEXT timezone, boolean handle_timezone)

Get the tempcode for a date input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name stub
Description The parameter name stub for this input field (it's actually a composite field, read in by passing this stub to post_param_date)
Type ID_TEXT

Name null_ok
Description Whether this is a required field
Type boolean

Name null_default
Description Whether this field is empty by default
Type boolean

Name do_time
Description Whether to input time for this field also
Type boolean

Name default_time
Description The default timestamp to use (either TIME or array of time components) (NULL: now)
Default value
Type ?mixed

Name total_years_to_show
Description The number of years to allow selection from (all into the future, as this field type is not meant for inputting past dates) (NULL: no limit)
Default value 10
Type ?integer

Name year_start
Description The year to start from (NULL: this year)
Default value
Type ?integer

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name required
Description Whether this is rendered in pink as a required field (NULL: depend on $null_ok)
Default value
Type ?boolean

Name do_date
Description Whether to input date for this field (if false, will just do time)
Default value boolean-true
Type boolean

Name timezone
Description Timezone to input in (NULL: current user's timezone)
Default value
Type ?ID_TEXT

Name handle_timezone
Description Convert $default_time to $timezone
Default value boolean-true
Type boolean

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_integer(mixed pretty_name, mixed description, ID_TEXT name, ?integer default, boolean required, ?integer tabindex)

Get the tempcode for an integer-only input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: no default)
Type ?integer

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_float(mixed pretty_name, mixed description, ID_TEXT name, ?float default, boolean required, ?integer tabindex)

Get the tempcode for a float-only input.

Parameters…

Name pretty_name
Description A human intelligible name for this input field
Type mixed

Name description
Description A description for this input field
Type mixed

Name name
Description The name which this input field is for
Type ID_TEXT

Name default
Description The default value for this input field (NULL: no default)
Type ?float

Name required
Description Whether this is a required input field
Type boolean

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode _form_input(ID_TEXT name, mixed pretty_name, mixed description, tempcode input, boolean required, boolean comcode, ?integer tabindex, boolean w, boolean skip_label, mixed description_side)

Helper function to show an input field.

Parameters…

Name name
Description The codename for this field
Type ID_TEXT

Name pretty_name
Description The human-readable name for this field
Type mixed

Name description
Description The human-readable description for this field
Type mixed

Name input
Description The actual raw input field
Type tempcode

Name required
Description Whether it is required that this field be filled in
Type boolean

Name comcode
Description Whether this field may contain comcode
Default value boolean-false
Type boolean

Name tabindex
Description The tab index (NULL: none specified)
Default value
Type ?integer

Name w
Description Whether it is a textarea field
Default value boolean-false
Type boolean

Name skip_label
Description Whether to skip displaying a label for the field
Default value boolean-false
Type boolean

Name description_side
Description A secondary side description for this input field
Default value
Type mixed

Returns…

Description The field
Type tempcode

Return to the function index for this class Expand: View the source code to this function

array handle_conflict_resolution(?ID_TEXT id, boolean only_staff)

Look for editing conflicts, and setup editing pinging.

Parameters…

Name id
Description The ID we're editing (NULL: get from param, 'id')
Default value
Type ?ID_TEXT

Name only_staff
Description Whether to only care about staff conflicts
Default value boolean-false
Type boolean

Returns…

Description A pair: warning details, ping url
Type array

Return to the function index for this class Expand: View the source code to this function

integer get_form_field_tabindex(?integer tabindex)

Helper function for tab-index linearisation (serves as a filter).

Parameters…

Name tabindex
Description Requested tab-index (NULL: no specific request)
Default value
Type ?integer

Returns…

Description Used tab-index
Type integer

Return to the function index for this class Expand: View the source code to this function

tempcode form_input_radio_entry(string name, string value, boolean selected, mixed text, ?integer tabindex, string description)

Get the tempcode for a radio input. (You would gather together the outputs of several of these functions, then put them in as the $content in a form_input_radio function call).

Parameters…

Name name
Description The name of the radio button group this will be put in (i.e. the name the value presented here will be possibly matched against)
Type string

Name value
Description The value for this entry
Type string

Name selected
Description Whether this entry is selected by default or not
Default value boolean-false
Type boolean

Name text
Description The text associated with this choice (blank: just use name for text)
Default value
Type mixed

Name tabindex
Description The tab index of the field (NULL: not specified)
Default value
Type ?integer

Name description
Description An additional long description (blank: no description)
Default value
Type string

Returns…

Description The input field
Type tempcode

Return to the function index for this class Expand: View the source code to this function