Commit edba66f3 authored by Nigel McNie's avatar Nigel McNie
Browse files

Make each 'add friend' button on user search pass through the query if it's there.

This is so that the same query will be run, and we can guarantee that the pieform will be available so processing can occur.

This is a bit of a hack. It would be better to do the user search results in one big form, and toggle on the submit button pressed to work out what to do.
parent 4b921f3a
......@@ -917,12 +917,30 @@ function get_users_data($userlist) {
'elements' => array(
'submit' => array(
'type' => 'submit',
'value' => get_string('addtofriendslist', 'group')
'value' => get_string('addtofriendslist', 'group'),
'id' => array(
'type' => 'hidden',
'value' => $friend->id
'value' => $friend->id,
// These two fields pass on any query that was running on a
// user search screen. This is so when the form is
// submitted, the correct user search is run again and so
// this pieform will definitely be created and ready to be
// submitted.
// A bit of a hack caused by having one form for each user.
// It would be nice at some point to put the entire 'find
// friends' page into one form and toggle on the submit
// button to work out which friend to add.
'query' => array(
'type' => 'hidden',
'value' => param_variable('query', ''),
'offset' => array(
'type' => 'hidden',
'value' => param_integer('offset', 0),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment