/** * Sets up form elements specific to this assignment type for use in a special section * of the activity editing form * * @param object $mform The form to update in-place with additional fields */ function setup_elements(&$mform) { $repo = $this->get_repository_object(); if ($repo === false) { //core repository error message $message = get_string('errorrepository', 'assignment_backpack'); //wrap it with helpful instructions $message = get_string('errorrepositoryconfig', 'assignment_backpack', $message); //this will set text color to red $message = '<span class="notifyproblem">' . $message . '</span>'; //add the message as text $mform->addElement('static', 'repositoryerror', '', $message); } else { //config is ok, so add the appropriate elements return parent::setup_elements($mform); } }