wrapper itself
*/
// var_export($vars['collection'][0]->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("profile/icon",array('entity' => $mem, 'size' => '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 elgg_view('input/form', array('body' => $form_body, 'action' => "action/$action"));