Skip to content
Snippets Groups Projects
Commit a5285c61 authored by Elke Kreim's avatar Elke Kreim
Browse files

Start cleaning code

parent 9e26dd24
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,10 @@
* Time: 10:48
*/
$string['pluginname'] = 'Kontaktformular';
$string['pluginname'] = 'HsH Anpassungen';
$string['shortnamecourse'] = 'Gekürzter Kurstitel';
$string['coursespending'] = 'Ihre beantragten Kurse (Freischaltung in Arbeit)';
$string['formtitle'] = 'Kontakt zum Servicezentrum Lehre';
$string['intro_1'] = 'Sie haben Fragen zu Moodle oder benötigen Unterstützung bei der Umsetzung Ihrer digitalen Lehre?';
$string['intro_2'] = 'Schreiben Sie uns Ihr Anliegen über das Kontaktformular. Wir melden uns zeitnah bei Ihnen.';
......
......@@ -4,7 +4,11 @@
* Date: 19.01.2015
* Time: 10:48
*/
$string['pluginname'] = 'HSH edits';
$string['pluginname'] = 'HSH Edits';
$string['shortnamecourse'] = 'Course shortened name';
$string['formtitle'] = 'Contact the <i>Servicezentrum Lehre</i> (Service Center for Teaching)';
$string['intro_1'] = 'Do you have questions about Moodle or need support in implementing digital teaching?';
$string['intro_2'] = 'Send us your request using the contact form. We will process your request and contact you as soon as possible.';
......@@ -58,7 +62,7 @@ $string['courserequest'] = 'Course request';
$string['courserequestdetails'] = 'Course details';
$string['fullnamecourse'] = 'Full title of course';
$string['fullnamecourse_help'] = 'The full name of the course is displayed at the top of each page in the course and in the list of courses.';
$string['shortnamecourse'] = 'Course shortened name';
$string['shortnamecourse_help'] = 'The short name of the course is displayed in the navigation and is used in the subject line of course email messages.';
$string['enrolmentkey'] = 'Enrolment key';
$string['enrolmentkey_help'] = 'Please choose a string which is not part of any of the following course data: full title / short title of course, description.';
......
......@@ -42,10 +42,10 @@ $PAGE->set_url($url);
// Check permissions.
require_login(null, false);
if (isguestuser()) {
print_error('guestsarenotallowed', '', $returnurl);
throw new \moodle_exception('guestsarenotallowed', '', $returnurl);
}
if (empty($CFG->enablecourserequests)) {
print_error('courserequestdisabled', '', $returnurl);
throw new \moodle_exception('courserequestdisabled', '', $returnurl);
}
if ($CFG->lockrequestcategory) {
......
......@@ -45,7 +45,7 @@ require_once($CFG->dirroot . '/local/hsh/lib.php');
*/
class course_request_hsh_form extends moodleform {
function definition() {
protected function definition() {
global $CFG, $DB, $USER;
$mform =& $this->_form;
......@@ -62,12 +62,12 @@ class course_request_hsh_form extends moodleform {
$mform->addElement('header', 'coursedetails', get_string('courserequestdetails'));
$mform->addElement('text', 'fullname', get_string('fullnamecourse', 'local_hsh'), 'maxlength="254" size="34"');
$mform->addElement('text', 'fullname', get_string('fullnamecourse'), 'maxlength="254" size="50"');
$mform->addHelpButton('fullname', 'fullnamecourse', 'local_hsh');
$mform->addRule('fullname', get_string('missingfullname', 'local_hsh'), 'required', null, 'client');
$mform->setType('fullname', PARAM_TEXT);
$mform->addElement('text', 'shortname', get_string('shortnamecourse', 'local_hsh'), 'maxlength="25" size="34"');
$mform->addElement('text', 'shortname', get_string('shortnamecourse', 'local_hsh'), 'maxlength="100" size="50"');
$mform->addHelpButton('shortname', 'shortnamecourse', 'local_hsh');
$mform->addRule('shortname', get_string('missingshortname', 'local_hsh'), 'required', null, 'client');
$mform->setType('shortname', PARAM_TEXT);
......@@ -97,8 +97,6 @@ class course_request_hsh_form extends moodleform {
$fieldcontroller = \core_customfield\field_controller::create($field->id);
$datacontroller = \core_customfield\data_controller::create(0, null, $fieldcontroller);
$datacontroller->instance_form_definition($mform);
$mform->setDefault($shortname, 27);
}
$mform->addElement('header', 'moodlesupport', get_string('elcsupportheader', 'local_hsh'));
......@@ -121,9 +119,6 @@ class course_request_hsh_form extends moodleform {
$mform->addElement('editor', 'summary_editor', get_string('summary', 'local_hsh'), null, course_request_hsh::summary_editor_options());
$mform->addHelpButton('summary_editor', 'summary', 'local_hsh');
$mform->setType('summary_editor', PARAM_RAW, array('rows' => '25', 'cols' => '30'));
//$mform->addElement('header','requestreason', get_string('courserequestreason'));
//$mform->addElement('textarea', 'reason', get_string('courserequestsupport'), array('rows'=>'15', 'cols'=>'50'));
//$mform->addRule('reason', get_string('missingreqreason'), 'required', null, 'client');
$this->add_action_buttons(true, get_string('requestcourse'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment