Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
resources
friends
collections
pickercallback.php
Go to the documentation of this file.
1
<?php
9
// Load Elgg engine
10
$site_url
=
elgg_get_site_url
();
11
12
// Get callback type (list or picker)
13
$type
=
get_input
(
'type'
,
'picker'
);
14
15
$collection
= (int)
get_input
(
'collection'
, 0);
16
$members
=
get_members_of_access_collection
(
$collection
,
true
);
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)
24
$pageowner
=
elgg_get_page_owner_entity
();
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
$members
Definition:
pickercallback.php:16
$type
$type
Definition:
pickercallback.php:13
$collection
$collection
Definition:
pickercallback.php:15
forward
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
get_members_of_access_collection($collection_id, $guids_only=false)
Get all of members of an access collection.
Definition:
access.php:416
$pageowner
$pageowner
Definition:
pickercallback.php:24
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
$friendspicker
if(!$members) $friendspicker
Definition:
pickercallback.php:21
echo
elgg echo
Translates a string.
Definition:
languages.js:48
elgg_view
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition:
views.php:336
elgg_get_site_url
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
Definition:
configuration.php:27
elgg_get_page_owner_entity
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition:
pageowner.php:56
$site_url
$site_url
Definition:
pickercallback.php:10
$friends
$friends
Definition:
add.php:10
$content
$content
Set robots.txt action.
Definition:
set_robots.php:6
exit
exit
Definition:
autoloader.php:34
Generated on Sat Dec 21 2024 00:01:05 for Elgg by
1.8.11