68 $page =
$url[
'scheme'] .
"://" .
$url[
'host'];
70 if (isset(
$url[
'port']) &&
$url[
'port']) {
71 $page .=
":" .
$url[
'port'];
74 $page = trim($page,
"/");
89 return filter_var($address, FILTER_VALIDATE_EMAIL) === $address;
162 return _elgg_services()->stickyForms->getStickyValues($form_name, $filter_result);
175 _elgg_services()->stickyForms->clearStickyValue($form_name, $variable);
212 $q = str_replace(array(
'_',
'%'), array(
'\_',
'\%'), $q);
214 $match_on =
get_input(
'match_on',
'all');
216 if (!is_array($match_on)) {
217 $match_on = array($match_on);
221 if (in_array(
'all', $match_on)) {
222 $match_on = array(
'users',
'groups');
234 foreach ($match_on as $match_type) {
235 switch ($match_type) {
240 'joins' => array(
"JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
243 "(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')" 248 if (!empty($entities)) {
249 foreach ($entities as
$entity) {
251 if (in_array(
'groups', $match_on)) {
254 $value = $entity->username;
258 'use_hover' =>
false,
260 'class' =>
'elgg-autocomplete-item',
261 'title' => $entity->name,
265 'use_hover' =>
false,
270 'name' => $entity->name,
271 'desc' => $entity->username,
272 'guid' => $entity->guid,
276 'url' => $entity->getURL(),
277 'html' =>
elgg_view(
'input/userpicker/item', array(
282 $results[$entity->name . rand(1, 100)] =
$result;
297 'joins' => array(
"JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"),
299 "(ge.name LIKE '$q%' OR ge.name LIKE '% $q%' OR ge.description LIKE '% $q%')" 304 if (!empty($entities)) {
305 foreach ($entities as
$entity) {
307 'use_hover' =>
false,
308 'class' =>
'elgg-autocomplete-item',
309 'full_view' =>
false,
311 'title' => $entity->name,
315 'use_hover' =>
false,
320 'name' => $entity->name,
321 'desc' => strip_tags($entity->description),
322 'guid' => $entity->guid,
324 'value' => $entity->guid,
326 'url' => $entity->getURL(),
329 $results[$entity->name . rand(1, 100)] =
$result;
338 'relationship' =>
'friend',
339 'relationship_guid' =>
$user->getGUID(),
340 'joins' => array(
"JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
343 "(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')" 348 if (!empty($entities)) {
349 foreach ($entities as
$entity) {
352 'use_hover' =>
false,
354 'class' =>
'elgg-autocomplete-item',
355 'title' => $entity->name,
359 'use_hover' =>
false,
364 'name' => $entity->name,
365 'desc' => $entity->username,
366 'guid' => $entity->guid,
368 'value' => $entity->username,
370 'url' => $entity->getURL(),
371 'html' =>
elgg_view(
'input/userpicker/item', array(
376 $results[$entity->name . rand(1, 100)] =
$result;
382 header(
"HTTP/1.0 400 Bad Request",
true);
383 echo "livesearch: unknown match_on of $match_type";
390 header(
"Content-Type: application/json;charset=utf-8");
391 echo json_encode(array_values($results));
407 $events->registerHandler(
'init',
'system',
'_elgg_input_init');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg parse_url
Parse a URL into its parts.
elgg_view_list_item($item, array $vars=array())
View an item in a list.
sanitise_string($string)
Alias of sanitize_string.
const ELGG_ENTITIES_ANY_VALUE
elgg echo
Translates a string.
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
clearfix elgg elgg elgg elgg page header
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
elgg_is_active_plugin($plugin_id, $site_guid=null)
Returns if a plugin is active for a current site.
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
sanitise_int($int, $signed=true)
Alias of sanitize_int.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_get_entities_from_relationship($options)
Return entities matching a given query joining against a relationship.