Elgg
Version 1.11
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
pages
friends
collections
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
12
$site_url
=
elgg_get_site_url
();
13
14
// Get callback type (list or picker)
15
$type
=
get_input
(
'type'
,
'picker'
);
16
17
$collection
= (int)
get_input
(
'collection'
, 0);
18
$members
=
get_members_of_access_collection
(
$collection
,
true
);
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)
26
$pageowner
=
elgg_get_page_owner_entity
();
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
59
echo
$content
;
get_input
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition:
input.php:27
$members
$members
Definition:
pickercallback.php:18
$type
$type
Definition:
pickercallback.php:15
$collection
$collection
Definition:
pickercallback.php:17
exit
exit
Definition:
reorder.php:12
forward
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition:
elgglib.js:419
$pageowner
$pageowner
Definition:
pickercallback.php:26
get_members_of_access_collection
get_members_of_access_collection($collection, $idonly=false)
Get all of members of an access collection.
Definition:
access.php:418
$friendspicker
if(!$members) $friendspicker
Definition:
pickercallback.php:23
echo
elgg echo
Translates a string.
Definition:
languages.js:43
elgg_get_site_url
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
Definition:
configuration.php:28
elgg_get_page_owner_entity
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition:
pageowner.php:53
elgg_view
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition:
views.php:354
$site_url
$site_url
Definition:
pickercallback.php:12
$friends
$friends
Definition:
add.php:10
$content
$content
Set robots.txt action.
Definition:
set_robots.php:6
Generated on Sat Sep 7 2024 00:00:48 for Elgg by
1.8.11