function process_selection($data) { foreach ($data->_selection as $userid) { cluster_manual_assign_user($data->id, $userid, !empty($data->autoenrol), !empty($data->leader)); } $tmppage = new clusteruserpage(array('id' => $data->id)); redirect($tmppage->get_url(), get_string('cluster_user_assigned', 'block_curr_admin', count($data->_selection))); }
$perpage = optional_param('perpage', 30, PARAM_INT); // add user to cluster if ($userid) { require_once $CFG->dirroot . '/curriculum/cluster/manual/assignpopup_form.php'; $assignform = new assignpopup_form(); if ($assignform->is_cancelled()) { // do something } elseif ($data = $assignform->get_data()) { cluster_manual_assign_user($data->clusterid, $data->userid, !empty($data->autoenrol), !empty($data->leader)); // reload the main page with the new assignments $target = new clusteruserpage(array('id' => $clusterid)); ?> <script type="text/javascript"> //<![CDATA[ window.opener.location = "<?php echo htmlspecialchars_decode($target->get_url()); ?> "; //]]> </script> <?php } else { $a = new object(); $a->site = $site->shortname; $a->name = $cluster->name; print_header(get_string('assign_user_cluster', 'block_curr_admin', $a)); $user = new user($userid); $a = new object(); $a->fullname = cm_fullname($user); $a->name = $cluster->name; $bc = '<span class="breadcrumb">' . get_string('cluster_manual_options', 'block_curr_admin', $a) . '</span>';