35 if (isset($CONFIG->input[$variable])) {
37 $result = $CONFIG->input[$variable];
74 if (!isset($CONFIG->input)) {
75 $CONFIG->input = array();
79 array_walk_recursive(
$value, create_function(
'&$v, $k',
'$v = trim($v);'));
80 $CONFIG->input[trim($variable)] =
$value;
82 $CONFIG->input[trim($variable)] = trim(
$value);
109 $page =
$url[
'scheme'] .
"://" .
$url[
'host'];
111 if (isset(
$url[
'port']) &&
$url[
'port']) {
112 $page .=
":" .
$url[
'port'];
115 $page = trim($page,
"/");
130 return filter_var($address, FILTER_VALIDATE_EMAIL) === $address;
153 $vars = array_merge($req->query->all(), $req->request->all());
156 $session->set(
'sticky_forms', $data);
174 unset(
$data[$form_name]);
189 return isset(
$data[$form_name]);
208 if (isset(
$data[$form_name][$variable])) {
210 if ($filter_result) {
231 if (!isset(
$data[$form_name])) {
235 $values =
$data[$form_name];
236 if ($filter_result) {
257 unset(
$data[$form_name][$variable]);
295 $q = str_replace(array(
'_',
'%'), array(
'\_',
'\%'), $q);
297 $match_on =
get_input(
'match_on',
'all');
299 if (!is_array($match_on)) {
300 $match_on = array($match_on);
304 if (in_array(
'all', $match_on)) {
305 $match_on = array(
'users',
'groups');
317 foreach ($match_on as $match_type) {
318 switch ($match_type) {
323 'joins' => array(
"JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
326 "(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')" 331 if (!empty($entities)) {
332 foreach ($entities as
$entity) {
334 if (in_array(
'groups', $match_on)) {
337 $value = $entity->username;
341 'use_hover' =>
false,
343 'class' =>
'elgg-autocomplete-item',
344 'title' => $entity->name,
348 'use_hover' =>
false,
353 'name' => $entity->name,
354 'desc' => $entity->username,
355 'guid' => $entity->guid,
359 'url' => $entity->getURL(),
360 'html' =>
elgg_view(
'input/userpicker/item', array(
365 $results[$entity->name . rand(1, 100)] =
$result;
380 'joins' => array(
"JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"),
382 "(ge.name LIKE '$q%' OR ge.name LIKE '% $q%' OR ge.description LIKE '% $q%')" 387 if (!empty($entities)) {
388 foreach ($entities as
$entity) {
391 'use_hover' =>
false,
392 'class' =>
'elgg-autocomplete-item',
393 'full_view' =>
false,
395 'title' => $entity->name,
399 'use_hover' =>
false,
404 'name' => $entity->name,
405 'desc' => strip_tags($entity->description),
406 'guid' => $entity->guid,
408 'value' => $entity->guid,
410 'url' => $entity->getURL(),
413 $results[$entity->name . rand(1, 100)] =
$result;
422 'relationship' =>
'friend',
423 'relationship_guid' =>
$user->getGUID(),
424 'joins' => array(
"JOIN {$dbprefix}users_entity ue ON e.guid = ue.guid"),
427 "(ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')" 432 if (!empty($entities)) {
433 foreach ($entities as
$entity) {
436 'use_hover' =>
false,
438 'class' =>
'elgg-autocomplete-item',
439 'title' => $entity->name,
443 'use_hover' =>
false,
448 'name' => $entity->name,
449 'desc' => $entity->username,
450 'guid' => $entity->guid,
452 'value' => $entity->username,
454 'url' => $entity->getURL(),
455 'html' =>
elgg_view(
'input/userpicker/item', array(
460 $results[$entity->name . rand(1, 100)] =
$result;
466 header(
"HTTP/1.0 400 Bad Request",
true);
467 echo "livesearch: unknown match_on of $match_type";
474 header(
"Content-Type: application/json");
475 echo json_encode(array_values($results));
488 if (is_array($array)) {
532 if (get_magic_quotes_gpc()) {
533 $_POST = array_map(
'_elgg_stripslashes_deep', $_POST);
534 $_GET = array_map(
'_elgg_stripslashes_deep', $_GET);
535 $_COOKIE = array_map(
'_elgg_stripslashes_deep', $_COOKIE);
536 $_REQUEST = array_map(
'_elgg_stripslashes_deep', $_REQUEST);
537 if (!empty($_SERVER[
'REQUEST_URI'])) {
538 $_SERVER[
'REQUEST_URI'] = stripslashes($_SERVER[
'REQUEST_URI']);
540 if (!empty($_SERVER[
'QUERY_STRING'])) {
541 $_SERVER[
'QUERY_STRING'] = stripslashes($_SERVER[
'QUERY_STRING']);
543 if (!empty($_SERVER[
'HTTP_REFERER'])) {
544 $_SERVER[
'HTTP_REFERER'] = stripslashes($_SERVER[
'HTTP_REFERER']);
546 if (!empty($_SERVER[
'PATH_INFO'])) {
547 $_SERVER[
'PATH_INFO'] = stripslashes($_SERVER[
'PATH_INFO']);
549 if (!empty($_SERVER[
'PHP_SELF'])) {
550 $_SERVER[
'PHP_SELF'] = stripslashes($_SERVER[
'PHP_SELF']);
552 if (!empty($_SERVER[
'PATH_TRANSLATED'])) {
553 $_SERVER[
'PATH_TRANSLATED'] = stripslashes($_SERVER[
'PATH_TRANSLATED']);
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.
elgg_view_entity_icon(ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
sanitise_string($string)
Wrapper function for alternate English spelling (.
elgg_pop_context()
Removes and returns the top context string from the stack.
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)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
elgg global
Pointer to the global context.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
elgg_push_context($context)
Push a context onto the top of the stack.
elgg_is_active_plugin($plugin_id, $site_guid=null)
Returns if a plugin is active for a current site.
sanitise_int($int, $signed=true)
Sanitizes an integer for database use.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
clearfix elgg elgg elgg elgg page header
elgg_get_entities_from_relationship($options)
Return entities matching a given query joining against a relationship.
if(file_exists($welcome)) $vars