Elgg  Version 5.1
Variables
entitypicker.php File Reference

Go to the source code of this file.

Variables

 $name = elgg_extract('name', $vars, 'entities', false)
 Entity Picker. More...
 
 $guids = (array) elgg_extract('values', $vars, elgg_extract('value', $vars, []))
 
 $params = elgg_extract('options', $vars, [])
 
if(!empty($params)) $params ['view'] = 'json'
 
 $wrapper_options
 
 $picker
 
 $item_view = elgg_extract('item_view', $vars, 'input/autocomplete/item')
 
 $items = ''
 

Variable Documentation

$guids = (array) elgg_extract('values', $vars, elgg_extract('value', $vars, []))

Definition at line 22 of file entitypicker.php.

$item_view = elgg_extract('item_view', $vars, 'input/autocomplete/item')

Definition at line 59 of file entitypicker.php.

$items = ''

Definition at line 60 of file entitypicker.php.

$name = elgg_extract('name', $vars, 'entities', false)

Entity Picker.

Sends an array of entity guids.

$vars['values'] Array of user guids for already selected entities or null $vars['limit'] Limit number of entities (default 0 = no limit) $vars['name'] Name of the returned data array (default "entities") $vars['handler'] Name of page handler used to power search (default "livesearch") $vars['options'] Additional options to pass to the handler with the URL query If using custom options, make sure to impose a signed request gatekeeper in the resource view $vars['placeholder'] Optional placeholder text for the input $vars['item_view'] The item view to use for the display of the values (default 'input/autocomplete/item')

Defaults to lazy load entity lists in alphabetical order. User needs to type two characters before seeing the user popup list.

As entities are selected they move down to a "entities" box. When this happens, a hidden input is created to return the GUID in the array with the form

Definition at line 20 of file entitypicker.php.

$params = elgg_extract('options', $vars, [])

Definition at line 24 of file entitypicker.php.

if (!empty($params)) $params['view'] = 'json'

Definition at line 35 of file entitypicker.php.

foreach ($guids as $guid) $picker
Initial value:
= elgg_format_element('input', [
'type' => 'text',
'class' => [
'elgg-input-entity-picker',
'elgg-input-user-picker',
],
'size' => 30,
'id' => elgg_extract('id', $vars),
'placeholder' => elgg_extract('placeholder', $vars),
])
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$vars
Definition: theme.php:5
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145

Definition at line 45 of file entitypicker.php.

$wrapper_options
Initial value:
= [
'class' => elgg_extract_class($vars, ['elgg-entity-picker'])
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:276
$vars
Definition: theme.php:5

Definition at line 37 of file entitypicker.php.