id);
// Set title, form destination
if (isset($vars['collection'])) {
$action = "friends/editcollection";
$title = $vars['collection'][0]->name;
$highlight = 'default';
} else {
$action = "friends/addcollection";
$title = "";
$highlight = 'all';
}
$form_body = "
";
$form_body .= "
";
if($vars['collection_members']){
$form_body .= elgg_echo("friends:collectionfriends") . "
";
foreach($vars['collection_members'] as $mem){
$form_body .= elgg_view_entity_icon($mem, 'tiny');
$form_body .= $mem->name;
}
}
$form_body .= "
";
$form_body .= "
".
elgg_view('core/friends/picker',array('entities' => $vars['friends'], 'name' => 'friends_collection', 'highlight' => $highlight)) . "
";
$form_body .= "
";
if (isset($vars['collection'])) {
$form_body .= elgg_view('input/hidden', array('name' => 'collection_id', 'value' => "{$vars['collection'][0]->id}"));
}
$form_body .= elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
$form_body .= "
";
echo $form_body;