}; $users_to_groups[$userid] = array_map($groupmapper, $gids); $users_to_roles[$userid] = $filterd; if (!$user->suspended) { $users[$userid] = $user; } } if (empty($users)) { print_error('no_usergroups', 'block_quickmail'); } // we are presenting the form with values populated from either the log or drafts table in the db if (!empty($type)) { $email = $DB->get_record('block_quickmail_' . $type, array('id' => $typeid)); //$emailmailto = array(); if ($messageIDresend == 1) { list($email->mailto, $email->additional_emails) = quickmail::clean($email->failuserids); } } else { $email = new stdClass(); $email->id = null; } $email->messageformat = editors_get_preferred_format(); $default_sigid = $DB->get_field('block_quickmail_signatures', 'id', array('userid' => $USER->id, 'default_flag' => 1)); $email->sigid = $default_sigid ? $default_sigid : -1; // Some setters for the form $email->type = $type; $email->typeid = $typeid; $editor_options = array('trusttext' => false, 'subdirs' => 1, 'maxfiles' => EDITOR_UNLIMITED_FILES, 'accepted_types' => '*', 'context' => $context); $email = file_prepare_standard_editor($email, 'message', $editor_options, $context, 'block_quickmail', $type, $email->id); $selected = array(); if (!empty($email->mailto)) {