Elgg  Version master
Variables
autocomplete.php File Reference

Go to the source code of this file.

Variables

 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-autocomplete')
 Displays an autocomplete text input. More...
 
 $defaults
 
 $params = elgg_extract('options', $vars, [])
 
if(!empty($params)) $match_on = elgg_extract('match_on', $vars)
 
if(empty($match_on)||!is_string($match_on)) if($match_on== 'friends') $params ['match_on'] = $match_on
 
if(isset($vars['match_owner'])) if(isset($vars['match_membership'])) if(isset($vars['match_target'])) $params ['view'] = 'json'
 
 $handler = elgg_extract('handler', $vars, "livesearch/$match_on")
 
 $source = elgg_normalize_url(elgg_http_add_url_query_elements($handler, $params))
 
 $vars ['type'] = 'text'
 
 $vars ['data-source'] = $source
 

Variable Documentation

$defaults
Initial value:
= [
'value' => ''

Definition at line 24 of file autocomplete.php.

$handler = elgg_extract('handler', $vars, "livesearch/$match_on")

Definition at line 78 of file autocomplete.php.

if (!empty($params)) $match_on = elgg_extract('match_on', $vars)

Definition at line 42 of file autocomplete.php.

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

Definition at line 31 of file autocomplete.php.

if (empty($match_on)||!is_string($match_on)) if ($match_on== 'friends') $params['match_on'] = $match_on

Definition at line 52 of file autocomplete.php.

if (isset($vars['match_owner'])) if (isset($vars['match_membership'])) if (isset($vars['match_target'])) $params['view'] = 'json'

Definition at line 77 of file autocomplete.php.

Definition at line 79 of file autocomplete.php.

$vars = elgg_extract_class($vars, 'elgg-input-autocomplete')

Displays an autocomplete text input.

$vars['handler'] Data source URL, defaults to /livesearch handler $vars['options'] Options to be passed to the handler with the URL query If using custom options, make sure to impose a signed request gatekeeper in the resource view $vars['value'] Current value for the text input $vars['match_on'] users|groups|friends $vars['match_owner'] Restrict search results to owned entities Applies to group search. Owner will default to logged in user, unless match_target is set $vars['match_membership'] Restrict search results to entities that user is a member of Applies to group search. Unless match_target is set, will default to currently logge din user $vars['match_target'] Restrict search results to a specific target Applies to friends search Applies to group search with match_owner Applies to group search with match_membership Note that current user must be able to edit the target user for the results to show $vars['class'] Additional CSS class

Definition at line 22 of file autocomplete.php.

$vars['type'] = 'text'

Definition at line 81 of file autocomplete.php.

$vars['data-source'] = $source

Definition at line 82 of file autocomplete.php.