Elgg  Version 2.3
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
$members
$collection
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
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 echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
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
$content
Set robots.txt action.
Definition: set_robots.php:6
exit
Definition: autoloader.php:34