Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
add.php
Go to the documentation of this file.
1 <?php
11 // Set title, form destination
12 if (isset($vars['collection'])) {
13  $title = $vars['collection']->name;
14  $highlight = 'default';
15 } else {
16  $title = "";
17  $highlight = 'all';
18 }
19 
20 echo "<div class=\"mtm\"><label>" . elgg_echo("friends:collectionname") . "<br/>";
21 echo elgg_view("input/text", array(
22  "name" => "collection_name",
23  "value" => $title,
24  ));
25 echo "</label></div>";
26 
27 echo "<div>";
28 if ($vars['collection_members']) {
29  echo elgg_echo("friends:collectionfriends") . "<br />";
30  foreach ($vars['collection_members'] as $mem) {
31  echo elgg_view_entity_icon($mem, 'tiny');
32  echo $mem->name;
33  }
34 }
35 echo "</div>";
36 
37 echo "<div><label>" . elgg_echo("friends:addfriends") . "</label>";
38 echo elgg_view('input/friendspicker', array(
39  'entities' => $vars['friends'],
40  'name' => 'friends_collection',
41  'highlight' => $highlight,
42 ));
43 echo "</div>";
44 
45 echo '<div class="elgg-foot">';
46 if (isset($vars['collection'])) {
47  echo elgg_view('input/hidden', array(
48  'name' => 'collection_id',
49  'value' => $vars['collection']->id,
50  ));
51 }
52 echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
53 echo '</div>';
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$vars['entity']
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:895
$highlight
Definition: add.php:17
$title
Display an add user form.
Definition: add.php:6