Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
add.php
Go to the documentation of this file.
1 <?php
9 $collection_name = htmlspecialchars(get_input('collection_name', '', false), ENT_QUOTES, 'UTF-8');
10 $friends = get_input('friends_collection');
11 
12 if (!$collection_name) {
13  register_error(elgg_echo("friends:nocollectionname"));
15 }
16 
18 
19 if ($id) {
21  if ($result) {
22  system_message(elgg_echo("friends:collectionadded"));
23  forward("collections/owner/" . elgg_get_logged_in_user_entity()->username);
24  } else {
25  register_error(elgg_echo("friends:nocollectionname"));
27  }
28 } else {
29  register_error(elgg_echo("friends:nocollectionname"));
31 }
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
update_access_collection($collection_id, $members)
Updates the membership in an access collection.
Definition: access.php:328
register_error($error)
Display an error on next page load.
Definition: elgglib.php:452
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$collection_name
Definition: add.php:9
const REFERER
Definition: elgglib.php:2029
$friends
Definition: add.php:10
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
username
Definition: contents.php:36
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:32
if(!$collection_name) $id
Definition: add.php:17
system_message($message)
Display a system message on next page load.
Definition: elgglib.php:438
create_access_collection($name, $owner_guid=0, $site_guid=0)
Creates a new access collection.
Definition: access.php:308