function _linkit_build_autocomplete_form_fields in Linkit 7.3
Append autocomplete (BAC) form element to the profile form.
Parameters
LinkitProfile $profile: A profile object contains all settings for the profile.
See also
1 call to _linkit_build_autocomplete_form_fields()
- linkit_profiles_form in plugins/
export_ui/ linkit_profiles.inc - Linkit profile settings form.
File
- plugins/
export_ui/ linkit_profiles.inc, line 453
Code
function _linkit_build_autocomplete_form_fields(&$form, LinkitProfile $profile) {
$form['data']['autocomplete'] = array(
'#type' => 'fieldset',
'#title' => t('Autocomplete options'),
'#description' => t('Linkit uses !bac which may be configured with a focus on
performance.', array(
'!bac' => l(t('Better Autocomplete'), 'https://github.com/betamos/Better-Autocomplete'),
)),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#tree' => TRUE,
'#weight' => 100,
);
$form['data']['autocomplete']['charLimit'] = array(
'#title' => t('Character limit'),
'#type' => 'textfield',
'#default_value' => isset($profile->data['autocomplete']['charLimit']) ? $profile->data['autocomplete']['charLimit'] : LINKIT_CHAR_LIMIT,
'#size' => 5,
'#description' => t('Minimum number of characters to perform server polling.
A higher value reduces server load. <em>Default: @default</em>', array(
'@default' => LINKIT_CHAR_LIMIT,
)),
'#element_validate' => array(
'linkit_isnumeric_validate',
),
);
$form['data']['autocomplete']['wait'] = array(
'#title' => t('Key press delay'),
'#type' => 'textfield',
'#default_value' => isset($profile->data['autocomplete']['wait']) ? $profile->data['autocomplete']['wait'] : LINKIT_WAIT,
'#size' => 5,
'#description' => t('Time from last key press to poll the server. A higher
value reduces server load. <em>Default: @default</em>', array(
'@default' => LINKIT_WAIT,
)),
'#field_suffix' => t('ms'),
'#element_validate' => array(
'linkit_isnumeric_validate',
),
);
$form['data']['autocomplete']['remoteTimeout'] = array(
'#title' => t('Remote timeout'),
'#type' => 'textfield',
'#default_value' => isset($profile->data['autocomplete']['remoteTimeout']) ? $profile->data['autocomplete']['remoteTimeout'] : LINKIT_REMOTE_TIMEOUT,
'#size' => 5,
'#description' => t('Client side timeout for a request to the server.
<em>Default: @default</em>', array(
'@default' => LINKIT_REMOTE_TIMEOUT,
)),
'#field_suffix' => t('ms'),
'#element_validate' => array(
'linkit_isnumeric_validate',
),
);
}