Elgg  Version 1.11
collection.php
Go to the documentation of this file.
1 <?php
11 $coll = $vars['collection'];
12 
13 if (is_array($vars['collection']->members)) {
14  $count = sizeof($vars['collection']->members);
15 } else {
16  $count = 0;
17 }
18 
19 echo "<li><h2>";
20 
21 //as collections are private, check that the logged in user is the owner
22 if ($coll->owner_guid == elgg_get_logged_in_user_guid()) {
23  echo "<div class=\"friends_collections_controls\">";
24  echo elgg_view('output/url', array(
25  'href' => 'action/friends/collections/delete?collection=' . $coll->id,
26  'class' => 'delete_collection',
27  'text' => elgg_view_icon('delete'),
28  'encode_text' => false,
29  'confirm' => true,
30  ));
31  echo "</div>";
32 }
33 echo $coll->name;
34 echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
35 
36 // individual collection panels
37 $friends = $vars['collection']->entities;
38 if ($friends) {
39  $content = elgg_view('core/friends/collectiontabs', array(
40  'owner' => elgg_get_logged_in_user_entity(),
41  'collection' => $vars['collection'],
42  'friendspicker' => $vars['friendspicker'],
43  ));
44 
45  echo elgg_view('input/friendspicker', array(
46  'entities' => $friends,
47  'value' => $vars['collection']->members,
48  'content' => $content,
49  'replacement' => '',
50  'friendspicker' => $vars['friendspicker'],
51  ));
52 ?>
53 <?php //@todo JS 1.8: no ?>
54  <script type="text/javascript">
55  $(function () {
56 
57  $('#friends-picker_placeholder<?php echo $vars['friendspicker']; ?>').load(elgg.config.wwwroot + 'pages/friends/collections/pickercallback.php?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
58 
59  });
60  </script>
61  <?php
62 }
63 
64 // close friends-picker div and the accordian list item
65 echo "</li>";
elgg
Definition: install.js:23
$friends
Definition: collection.php:37
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
Definition: views.php:1403
$coll
Definition: collection.php:11
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$content
Set robots.txt action.
Definition: set_robots.php:6
if(elgg_in_context('widget')) $count
Definition: pagination.php:20
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:32
list style type
Definition: admin.php:748
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:42
if(file_exists($welcome)) $vars
Definition: upgrade.php:93