Elgg  Version 2.3
collectiontabs.php
Go to the documentation of this file.
1 <?php
12 $friendspicker = $vars['friendspicker'];
13 
14 $collectionid = $vars['collection']->id;
15 $ownerid = $vars['owner']->getGUID();
16 
17 ?>
18 
19 <ul class="elgg-tabs">
20  <li class="elgg-state-selected">
21  <a href="#" class="collectionmembers<?php echo $friendspicker; ?>">
22  <?php echo elgg_echo('friends:collections:members'); ?>
23  </a>
24  </li>
25  <li>
26  <a href="#" class="editmembers<?php echo $friendspicker; ?>">
27  <?php echo elgg_echo('friends:collections:edit'); ?>
28  </a>
29  </li>
30 </ul>
31 
32 <script>
33 require(['jquery'], function($) {
34  $('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
35  // load collection members pane
36  $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>collections/pickercallback?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
37 
38  // remove selected state from previous tab
39  $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected");
40  // add selected class to current tab
41  $(this).parent().addClass("elgg-state-selected");
42 
43  return false;
44  });
45 
46  $('a.editmembers<?php echo $friendspicker; ?>').click(function () {
47  // load friends picker pane
48  $('#friends-picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo elgg_get_site_url(); ?>collections/pickercallback?username=<?php echo elgg_get_logged_in_user_entity()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
49 
50  // remove selected state from previous tab
51  $(this).parent().parent().find("li.elgg-state-selected").removeClass("elgg-state-selected");
52  // add selected class to current tab
53  $(this).parent().addClass("elgg-state-selected");
54 
55  return false;
56  });
57 });
58 </script>
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
a
Definition: admin.css.php:97
$vars['entity']
ul
Definition: admin.css.php:44
$ownerid
elgg menu user li
Definition: admin.css.php:211
$collectionid
elgg echo
Translates a string.
Definition: languages.js:48
elgg require
Throw an error if the required package isn&#39;t present.
Definition: elgglib.js:164
function elgg combo checkbox click(function(){if($(this).is(':checked')){$(this).prev().attr('disabled', true);$(this).prev().val('');}else{$(this).prev().attr('disabled', false);}})
$friendspicker