/** * Displays a list of the user's group where BuddyDrive is activated * * @uses bp_loggedin_user_id() to get current user id * @uses buddydrive_get_select_user_group() to build the select box * @return string a select box */ function buddydrive_list_user_groups() { // Bail if not a POST action if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) { return; } if (!bp_is_active('groups')) { exit; } $user_id = !empty($_POST['userid']) ? intval($_POST['userid']) : bp_loggedin_user_id(); $group_id = !empty($_POST['groupid']) ? intval($_POST['groupid']) : false; $name = !empty($_POST['selectname']) ? $_POST['selectname'] : false; $output = buddydrive_get_select_user_group($user_id, $group_id, $name); echo $output; die; }
/** * Displays a select box to choose the group to attach the BuddyDrive Item to * * @param int $user_id the user id * @param int $selected the group id in case of edit form * @param string $name the name of the select box * @uses buddydrive_get_select_user_group() to get the select box */ function buddydrive_select_user_group($user_id = false, $selected = false, $name = false) { echo buddydrive_get_select_user_group($user_id, $selected, $name); }