Elgg  Version 1.11
pickercallback.php
Go to the documentation of this file.
1 <?php
9 // Load Elgg engine
10 require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php");
11 
13 
14 // Get callback type (list or picker)
15 $type = get_input('type', 'picker');
16 
17 $collection = (int) get_input('collection', 0);
19 if (!$members) {
20  $members = array();
21 }
22 
23 $friendspicker = (int) get_input('friendspicker', 0);
24 
25 // Get page owner (bomb out if there isn't one)
27 if (!$pageowner) {
28  forward();
29  exit;
30 }
31 
32 // Depending on the view type, launch a different view
33 switch($type) {
34  case 'list':
35  $js_segment = elgg_view('core/friends/tablelistcountupdate', array(
36  'friendspicker' => $friendspicker,
37  'count' => sizeof($members),
38  ));
39  $content = elgg_view('core/friends/tablelist', array(
40  'entities' => $members,
41  'content' => $js_segment,
42  ));
43  break;
44  default:
45  $friends = $pageowner->getFriends(array('limit' => 0));
46 
47  $content = elgg_view('input/friendspicker', array(
48  'entities' => $friends,
49  'value' => $members,
50  'callback' => true,
51  'friendspicker' => $friendspicker,
52  'collection_id' => $collection,
53  'formtarget' => $site_url . 'action/friends/collections/edit',
54  ));
55  break;
56 }
57 
58 // Output the content
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$members
$collection
exit
Definition: reorder.php:12
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
$pageowner
get_members_of_access_collection($collection, $idonly=false)
Get all of members of an access collection.
Definition: access.php:418
if(!$members) $friendspicker
elgg echo
Translates a string.
Definition: languages.js:43
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:53
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$site_url
$friends
Definition: add.php:10
$content
Set robots.txt action.
Definition: set_robots.php:6