Elgg  Version 1.9
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/confirmlink', 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  ));
30  echo "</div>";
31 }
32 echo $coll->name;
33 echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
34 
35 // individual collection panels
36 $friends = $vars['collection']->entities;
37 if ($friends) {
38  $content = elgg_view('core/friends/collectiontabs', array(
39  'owner' => elgg_get_logged_in_user_entity(),
40  'collection' => $vars['collection'],
41  'friendspicker' => $vars['friendspicker'],
42  ));
43 
44  echo elgg_view('input/friendspicker', array(
45  'entities' => $friends,
46  'value' => $vars['collection']->members,
47  'content' => $content,
48  'replacement' => '',
49  'friendspicker' => $vars['friendspicker'],
50  ));
51 ?>
52 <?php //@todo JS 1.8: no ?>
53  <script type="text/javascript">
54  $(function () {
55 
56  $('#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; ?>');
57 
58  });
59  </script>
60  <?php
61 }
62 
63 // close friends-picker div and the accordian list item
64 echo "</li>";
elgg
Definition: install.js:23
elgg_view_icon($name, $class= '')
View one of the elgg sprite icons.
Definition: views.php:1370
$friends
Definition: collection.php:36
$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
$count
Definition: tools.php:19
$content
Set robots.txt action.
Definition: set_robots.php:6
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:724
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