getOwnerEntity();
$forward_url = $group->getURL();
$tabs = false;
$friends = elgg_get_logged_in_user_entity()->getFriends(array("limit" => false));
if (!empty($friends)) {
$toggle_content = "" . elgg_echo("group_tools:group:invite:friends:select_all") . "";
$toggle_content .= "" . elgg_echo("group_tools:group:invite:friends:deselect_all") . "";
$friendspicker = elgg_view("output/url", array("text" => $toggle_content, "href" => "javascript:void(0);", "onclick" => "group_tools_toggle_all_friends();", "id" => "friends_toggle", "class" => "float-alt elgg-button elgg-button-action"));
$friendspicker .= elgg_view('input/friendspicker', array('entities' => $friends, 'name' => 'user_guid', 'highlight' => 'all'));
} else {
$friendspicker = elgg_echo('groups:nofriendsatall');
}
// which options to show
if (in_array("yes", array($invite_site_members, $invite_email, $invite_csv))) {
$tabs = array(
"friends" => array(
"text" => elgg_echo("friends"),
"href" => "#",
"rel" => "friends",
"priority" => 200,
"onclick" => "group_tools_group_invite_switch_tab(\"friends\");",
"selected" => true
)
);
// invite friends
$form_data = "
";
$form_data .= $friendspicker;
$form_data .= "
";
//invite all site members
if ($invite_site_members == "yes") {
$tabs["users"] = array(
"text" => elgg_echo("group_tools:group:invite:users"),
"href" => "#",
"rel" => "users",
"priority" => 300,
"onclick" => "group_tools_group_invite_switch_tab(\"users\");"
);
$form_data .= "";
}
// invite by email
if ($invite_email == "yes") {
$tabs["email"] = array(
"text" => elgg_echo("group_tools:group:invite:email"),
"href" => "#",
"rel" => "users",
"priority" => 400,
"onclick" => "group_tools_group_invite_switch_tab(\"email\");"
);
$form_data .= "";
}
//invite by cvs upload
if ($invite_csv == "yes") {
$tabs["csv"] = array(
"text" => elgg_echo("group_tools:group:invite:csv"),
"href" => "#",
"rel" => "users",
"priority" => 500,
"onclick" => "group_tools_group_invite_switch_tab(\"csv\");"
);
$form_data .= "";
}
} else {
// only friends
$form_data = $friendspicker;
}
// optional text
$form_data .= elgg_view_module("aside", elgg_echo("group_tools:group:invite:text"), elgg_view("input/longtext", array("name" => "comment", 'value' => $comment)));
// renotify existing invites
if ($group->canEdit()) {
$form_data .= "";
$form_data .= "";
$form_data .= " " . elgg_echo("group_tools:group:invite:resend");
$form_data .= "
";
}
// build tabs
if (!empty($tabs)) {
foreach ($tabs as $name => $tab) {
$tab["name"] = $name;
elgg_register_menu_item("filter", $tab);
}
echo elgg_view_menu("filter", array("sort_by" => "priority"));
}
// show form
echo $form_data;
// show buttons
echo '';
?>