Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
pickercallback.php
Go to the documentation of this file.
1 <?php
9 // Load Elgg engine
11 
12 // Get callback type (list or picker)
13 $type = get_input('type', 'picker');
14 
15 $collection = (int) get_input('collection', 0);
17 if (!$members) {
18  $members = array();
19 }
20 
21 $friendspicker = (int) get_input('friendspicker', 0);
22 
23 // Get page owner (bomb out if there isn't one)
25 if (!$pageowner) {
26  forward();
27  exit;
28 }
29 
30 // Depending on the view type, launch a different view
31 switch($type) {
32  case 'list':
33  $js_segment = elgg_view('core/friends/tablelistcountupdate', array(
34  'friendspicker' => $friendspicker,
35  'count' => sizeof($members),
36  ));
37  $content = elgg_view('core/friends/tablelist', array(
38  'entities' => $members,
39  'content' => $js_segment,
40  ));
41  break;
42  default:
43  $friends = $pageowner->getFriends(array('limit' => 0));
44 
45  $content = elgg_view('input/friendspicker', array(
46  'entities' => $friends,
47  'value' => $members,
48  'callback' => true,
49  'friendspicker' => $friendspicker,
50  'collection_id' => $collection,
51  'formtarget' => $site_url . 'action/friends/collections/edit',
52  ));
53  break;
54 }
55 
56 // Output the content
57 echo $content;
$members
$collection
get_members_of_access_collection($collection_id, $guids_only=false)
Get all of members of an access collection.
Definition: access.php:416
$pageowner
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
if(!$members) $friendspicker
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:56
$site_url
$friends
Definition: add.php:10
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
$content
Set robots.txt action.
Definition: set_robots.php:6
exit
Definition: autoloader.php:34