Function Module_admin_cns_customprofilefields->get_form_fields

Definitions

adminzone/pages/modules/admin_cns_customprofilefields.php

  • Get Tempcode for adding/editing form.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name SHORT_TEXT No No Blank (empty string) N/A N/A The name of the Custom Profile Field
$description LONG_TEXT No No Blank (empty string) N/A N/A The description of the field
$default LONG_TEXT No No Blank (empty string) N/A N/A The default value of the field
$public_view BINARY No No 1 N/A N/A Whether the field is publicly viewable
$owner_view BINARY No No 1 N/A N/A Whether the field may be viewed by the owner
$owner_set BINARY No No 1 N/A N/A Whether the owner may set the value of the field
$encrypted BINARY No No 0 N/A N/A Whether the field is encrypted
$type ID_TEXT No No long_text short_text long_text short_trans long_trans integer upload picture URL list tick N/A The type of the field
$required BINARY No No 0 N/A N/A Whether the field is required to be filled in
$show_on_join_form BINARY No No 0 N/A N/A Whether the field is to be shown on the join form
$show_in_posts BINARY No No 0 N/A N/A Whether the field is shown in posts
$show_in_post_previews BINARY No No 0 N/A N/A Whether the field is shown in post previews
$order ?integer No No Null N/A N/A The order the field is given relative to the order of the other Custom Profile Fields (null: last)
$only_group LONG_TEXT No No Blank (empty string) N/A N/A The usergroups that this field is confined to (comma-separated list)
$locked BINARY No No 0 N/A N/A Whether the field is locked, e.g. cannot be deleted
$options SHORT_TEXT No No Blank (empty string) N/A N/A Field options
$include_in_main_search BINARY No No 0 N/A N/A Whether to include in main keyword search
$allow_template_search BINARY No No 0 N/A N/A Whether to allow template search
$icon ID_TEXT No No Blank (empty string) N/A N/A An icon to show the CPF with on the member profiles
$section ID_TEXT No No Blank (empty string) N/A N/A A section to show with on the member-links part of member profiles
$tempcode LONG_TEXT No No Blank (empty string) N/A N/A This is Tempcode that is used for displaying the field. See the DESCRIPTION_CPF_CODE language string.
$autofill_type ID_TEXT No No Blank (empty string) N/A N/A Autofill field name from https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field
$autofill_hint ID_TEXT No No Blank (empty string) N/A N/A Autofill hint: '' or 'shipping' or 'billing'

Returns

  • A pair: The input fields, Hidden fields
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get Tempcode for adding/editing form.
 *
 * @param  SHORT_TEXT $name The name of the Custom Profile Field
 * @param  LONG_TEXT $description The description of the field
 * @param  LONG_TEXT $default The default value of the field
 * @param  BINARY $public_view Whether the field is publicly viewable
 * @param  BINARY $owner_view Whether the field may be viewed by the owner
 * @param  BINARY $owner_set Whether the owner may set the value of the field
 * @param  BINARY $encrypted Whether the field is encrypted
 * @param  ID_TEXT $type The type of the field
 * @set short_text long_text short_trans long_trans integer upload picture URL list tick
 * @param  BINARY $required Whether the field is required to be filled in
 * @param  BINARY $show_on_join_form Whether the field is to be shown on the join form
 * @param  BINARY $show_in_posts Whether the field is shown in posts
 * @param  BINARY $show_in_post_previews Whether the field is shown in post previews
 * @param  ?integer $order The order the field is given relative to the order of the other Custom Profile Fields (null: last)
 * @param  LONG_TEXT $only_group The usergroups that this field is confined to (comma-separated list)
 * @param  BINARY $locked Whether the field is locked, e.g. cannot be deleted
 * @param  SHORT_TEXT $options Field options
 * @param  BINARY $include_in_main_search Whether to include in main keyword search
 * @param  BINARY $allow_template_search Whether to allow template search
 * @param  ID_TEXT $icon An icon to show the CPF with on the member profiles
 * @param  ID_TEXT $section A section to show with on the member-links part of member profiles
 * @param  LONG_TEXT $tempcode This is Tempcode that is used for displaying the field. See the DESCRIPTION_CPF_CODE language string.
 * @param  ID_TEXT $autofill_type Autofill field name from https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field
 * @param  ID_TEXT $autofill_hint Autofill hint: '' or 'shipping' or 'billing'
 * @return array A pair: The input fields, Hidden fields
 */

public function get_form_fields(string $name = '', string $description = '', string $default = '', int $public_view = 1, int $owner_view = 1, int $owner_set = 1, int $encrypted = 0, string $type = 'long_text', int $required = 0, int $show_on_join_form = 0, int $show_in_posts = 0, int $show_in_post_previews = 0, ?int $order = null, string $only_group = '', int $locked = 0, string $options = '', int $include_in_main_search = 0, int $allow_template_search = 0, string $icon = '', string $section = '', string $tempcode = '', string $autofill_type = '', string $autofill_hint = '') : array