Skip to content
Snippets Groups Projects
Commit acfc7cc5 authored by nino2205's avatar nino2205
Browse files

init

parents
No related branches found
No related tags found
No related merge requests found
<?php
require_once(dirname(__FILE__) . '/../../config.php');
require_once(dirname(__FILE__) . '/contact_form.php');
require_once(dirname(__FILE__) . '/lib.php');
// You will process some page parameters at the top here and get the info about
// what instance of your module and what course you're in etc. Make sure you
// include hidden variable in your forms which have their defaults set in set_data
// which pass these variables from page to page.
global $CFG, $PAGE;
// Setup $PAGE here.
$site = get_site();
$returnurl = new moodle_url('/my');
$url = new moodle_url('/local/contactform/contact.php');
$return = optional_param('return', null, PARAM_ALPHANUMEXT);
$PAGE->set_url($url);
$context = context_system::instance();
$PAGE->set_context($context);
// Set page layout
$PAGE->set_pagelayout('standard');
$requestform = new contact_form($url);
$strtitle = get_string('pluginname','local_contactform');
$PAGE->set_title($strtitle);
$PAGE->set_heading($strtitle);
// Standard form processing if statement.
if ($requestform->is_cancelled()){
redirect($returnurl);
} else if ($data = $requestform->get_data()) {
// we need $_POST for javascript generated entries
$data = $_POST;
$eventdata = new stdClass();
$eventdata->contacttoselect = $_POST["contacttoselect"];
$eventdata->subject = $_POST["subject"];
$eventdata->email = $_POST["email"];
$eventdata->message = $_POST["message"];
$eventdata->lastname = $_POST["lastname"];
$eventdata->firstname = $_POST["firstname"];
$eventdata->telephone = $_POST["telephone"];
contactform::create($eventdata);
//end HsH
// And redirect back to the course listing.
notice(get_string('confirmrequest','local_contactform'), $returnurl);
}
$PAGE->navbar->add($strtitle);
$jsmodule = array(
'name' => 'local_contactform',
'fullpath' => '/local/contactform/module.js',
'requires' => array('base', 'node', 'json', 'io')
);
$jsdata = array(
'instanceid' => $context->id,
'sesskey' => sesskey()
);
$PAGE->requires->js_init_call('M.local_contactform.init',
$jsdata,
false,
$jsmodule);
<<<<<<< HEAD
$PAGE->requires->strings_for_js(array('contacttoelc','recording','clicker','moodle','loncapa','evaexam','eexam','training', 'other','improvement','technical','usercreate','loginprob','pleasechoose','dataloss'),'local_contactform');
=======
$PAGE->requires->strings_for_js(array('contacttoelc','recording','clicker','moodle','loncapa','evaexam','eexam','training', 'other','improvement','technical','usercreate','userdelete','coursedelete','loginprob','pleasechoose','dataloss'),'local_contactform');
>>>>>>> hsh/develop
echo $OUTPUT->header();
echo $OUTPUT->heading($strtitle);
// Show the request form.
$requestform->display();
echo $OUTPUT->footer();
<?php
/**
* User: wernerpe
* Date: 19.01.2015
* Time: 10:43
*/
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->libdir . '/formslib.php');
class contact_form extends moodleform {
function definition() {
global $CFG, $DB, $USER;
$mform = & $this->_form;
$mform->addElement('header', 'personaldetails', get_string('personaldetails', 'local_contactform'));
$mform->addElement('text', 'firstname', get_string('firstname', 'local_contactform'), 'maxlength="254" size="34"');
$mform->addRule('firstname', get_string('firstname_mis', 'local_contactform'), 'required', null, 'client');
$mform->setType('firstname', PARAM_TEXT);
$mform->addElement('text', 'lastname', get_string('lastname', 'local_contactform'), 'maxlength="254" size="34"');
$mform->addRule('lastname', get_string('lastname_mis', 'local_contactform'), 'required', null, 'client');
$mform->setType('lastname', PARAM_TEXT);
$mform->addElement('text', 'email', get_string('email', 'local_contactform'), 'maxlength="254" size="34"');
$mform->addRule('email', get_string('email_mis', 'local_contactform'), 'required', null, 'client');
$mform->addRule('email', get_string('email_mis', 'local_contactform'), 'email', null, 'client');
$mform->setType('email', PARAM_EMAIL);
$mform->addElement('text', 'telephone', get_string('telephone', 'local_contactform'), 'maxlength="254" size="34"');
$mform->setType('telephone', PARAM_TEXT);
$mform->addElement('header', 'messageheader', get_string('message', 'local_contactform'));
$contactto = array();
// $contactto[] = get_string('pleasechoose', 'local_contactform');
$contactto[] = get_string('contacttomoodle', 'local_contactform');
$contactto[] = get_string('contacttoelc', 'local_contactform');
$mform->addElement('select', 'contacttoselect', get_string('contactto', 'local_contactform'), $contactto, ' style="width: 20em;"');
$mform->addRule('contacttoselect', get_string('contactto_mis', 'local_contactform'), 'required', null, 'client');
$values = array(get_string('improvement', 'local_contactform') => get_string('improvement', 'local_contactform'),
get_string('technical', 'local_contactform') => get_string('technical', 'local_contactform'),
get_string('usercreate', 'local_contactform') => get_string('usercreate', 'local_contactform'),
<<<<<<< HEAD
=======
get_string('userdelete', 'local_contactform') => get_string('userdelete', 'local_contactform'),
get_string('coursedelete', 'local_contactform') => get_string('coursedelete', 'local_contactform'),
>>>>>>> hsh/develop
get_string('loginprob', 'local_contactform') => get_string('loginprob', 'local_contactform'),
get_string('dataloss', 'local_contactform') => get_string('dataloss', 'local_contactform'));
sort($values);
array_unshift($values, get_string('pleasechoose', 'local_contactform'));
$values[get_string('other', 'local_contactform')] = get_string('other', 'local_contactform');
$mform->addElement('select', 'subject', get_string('subject', 'local_contactform'), $values, ' style="width: 20em;"');
$mform->addElement('textarea', 'message', get_string('message', 'local_contactform'), 'style="width: 20em;height: 20em"');
$mform->addRule('message', get_string('message_mis', 'local_contactform'), 'required', null, 'client');
if (isloggedin()) {
$mform->setDefault('firstname', $USER->firstname);
$mform->setDefault('lastname', $USER->lastname);
$mform->setDefault('email', $USER->email);
$mform->setDefault('telephone', $USER->phone1);
}
if (!empty($CFG->recaptchapublickey) && !empty($CFG->recaptchaprivatekey)) {
$mform->addElement('recaptcha', 'recaptcha_element', 'style="margin: 10em"');
}
$this->add_action_buttons(true, get_string('submit', 'local_contactform'));
}
function validation($data, $files) {
if(empty($data["lastname"])){
$errors['lastname'] = get_string('missinglastname');
}
if(empty($data["firstname"])){
$errors['firstname'] = get_string('missingfirstname');
}
if(empty($data["message"])){
$errors['message'] = get_string('missingdescription');
}
if (! validate_email($data['email'])) {
$errors['email'] = get_string('invalidemail');
}
$recaptcha_element = $this->_form->getElement('recaptcha_element');
if (!empty($this->_form->_submitValues['recaptcha_challenge_field'])) {
$challenge_field = $this->_form->_submitValues['recaptcha_challenge_field'];
$response_field = $this->_form->_submitValues['recaptcha_response_field'];
if (true !== ($result = $recaptcha_element->verify($challenge_field, $response_field))) {
$errors['recaptcha'] = $result;
}
} else {
$errors['recaptcha'] = get_string('missingrecaptchachallengefield');
}
return $errors;
}
}
<?php
/**
* User: wernerpe
* Date: 19.01.2015
* Time: 10:48
*/
$string['pluginname'] = 'Kontaktformular';
$string['missingfield'] = 'Pflichtfeld!';
$string['contactform'] = 'Kontaktformular';
$string['contactto'] = 'Anfrage an';
$string['contactto_mis'] = 'Bitte w&auml;hlen Sie ein Supportteam aus.';
$string['contacttoelc'] = 'Allgemein (ELC)';
$string['contacttomoodle'] = 'Moodle Support';
$string['personaldetails'] = 'Pers&ouml;nliche Daten';
$string['title'] = 'Anrede';
$string['firstname'] = 'Vorname';
$string['firstname_mis'] = 'Bitte geben Sie Ihren Vornamen ein.';
$string['lastname'] = 'Nachname';
$string['lastname_mis'] = 'Bitte geben Sie Ihren Nachnamen ein.';
$string['email'] = 'E-Mail-Adresse';
$string['email_mis'] = 'Bitte geben Sie eine gültige E-Mail Addresse ein.';
$string['telephone'] = 'Telefon';
$string['yourmessage'] = 'Ihre Mitteilung';
$string['subject'] = 'Betreff';
$string['subject_mis'] = 'Bitte w&auml;hlen Sie einen Betreff.';
$string['message'] = 'Ihre Mitteilung';
$string['message_mis'] = 'Bitte geben Sie Ihre Mitteilung ein.';
$string['pleasechoose'] = 'Bitte w&auml;hlen Sie';
$string['other'] = 'Sonstiges';
// ELC
$string['training'] = 'Beratungsanfrage/Schulung';
$string['eexam'] = 'E-Pr&uuml;fung';
$string['evaexam'] = 'EvaExam';
$string['loncapa'] = 'LON-CAPA';
$string['moodle'] = 'Moodle';
$string['clicker'] = 'Turning Point System (Clicker)';
$string['recording'] = 'Vorlesungsaufzeichnung';
// MOODLE
$string['dataloss'] = 'Datenverlust';
$string['loginprob'] = 'Loginprobleme';
$string['usercreate'] = 'Nutzeranlegung';
<<<<<<< HEAD
$string['technical'] = 'Technisches Problem';
$string['improvement'] = 'Verbesserungsvorschlag';
$string['course'] = 'Moodle course';
=======
$string['userdelete'] = 'Nutzerlöschung';
$string['technical'] = 'Technisches Problem';
$string['improvement'] = 'Verbesserungsvorschlag';
$string['course'] = 'Moodle Kurs';
$string['coursedelete'] = 'Moodle Kurslöschung';
>>>>>>> hsh/develop
$string['submit'] = 'Abschicken';
$string['confirmrequest'] = 'Ihre Anfrage wurde zum zuständigen Support-Team weitergeleitet. In Kürze wird sich jemand mit Ihnen in Verbindung setzen.';
// Course Request Fields
$string['courserequestdetails'] = 'Kursdetails';
$string['fullnamecourse'] = 'Vollst&auml;ndiger Kurstitel';
$string['fullnamecourse_help'] = 'Der vollst&auml;ndige Kurstitel wird auf jeder Kursseite oben und in der Kurs&uuml;bersicht angezeigt.';
$string['shortnamecourse'] = 'Gek&uuml;rzter Kurstitel';
$string['shortnamecourse_help'] = 'Der gek&uuml;rzte Kurstitel wird immer dann verwendet, wenn der vollst&auml;ndige Kurstitel zu lang w&auml;re (z.B. in der Navigation oder in der Betreffzeile von E-Mails).';
$string['enrolmentkey'] = 'Kurspasswort';
$string['enrolmentkey_help'] = 'Mit dem Kurspasswort gelangen Studierende in den Kurs. Bitte tragen Sie hier eine Zeichenfolge ein, welche weder im vollst&auml;ndigen Kurstitel, im gek&uuml;rzten Kurstitel oder in der Kursbeschreibung enthalten ist.';
$string['wrongcategory'] = 'Es ist leider nicht erlaubt diese Kategorie auszuw&auml;hlen.';
$string['containspassword'] = 'Der {$a} und das Kurspasswort haben zu starke &Auml;hnlichkeit. Bitte vergeben Sie ein anderes Kurspasswort!';
$string['reason'] = 'Grund';
$string['reason_help'] = 'Hier k&ouml;nnen Sie (mit eigenen Worten und nicht abgucken!) erl&auml;utern, was der Hintergrund von dem Kurs ist.';
$string['teachername'] = 'Nachname der/des Lehrenden';
$string['missingfullname'] = 'Bitte tragen Sie den vollständigen Kurstitel ein.';
$string['missingshortname'] = 'Bitte tragen Sie den gekürzten Kurstitel ein.';
$string['missingteachername'] = 'Bitte tragen Sie den Nachnamen der/des Lehrenden ein.';
$string['missingsemesterselect'] = 'Bitte tragen Sie den vollständigen Kurstitel ein.';
$string['missingenrolmentkey'] = 'Bitte tragen Sie das Kurspasswort ein.';
$string['wrongchoosesemester']='Bitte wählen Sie ein Semester.';
$string['wrongcategory'] = 'Dieser Kursbereich ist nicht erlaubt.';
$string['teachername_help'] = 'Der Nachname der/des Lehrenden wird an das Ende des Kurstitels angehangen';
$string['morethanone'] = 'semesterunabh&auml;ngig';
$string['choosesemester']='Semester w&auml;hlen';
$string['choosesemester_help']='Bitte w&auml;hlen Sie aus, welchem Semester der Kurs zugeordnet werden soll. Beachten Sie dabei auch die Option "semesterunabh&auml;ngig".';
$string['pleasechoosesemester']='- bitte w&auml;hlen Sie ein Semester -';
$string['summaryhead'] = 'Kursbeschreibung für die Kurs&uuml;bersicht (optional)';
$string['summary'] = 'Kursbeschreibung (optional)';
$string['summary_help'] = 'Die Kursbeschreibung wird in der Kursliste angezeigt und wird bei einer Kurssuche ebenfalls ber&uuml;cksichtigt.';
$string['coursecategory'] = 'Kursbereich';
$string['coursecategory_help'] = 'Diese Zuordnung legt fest, in welchem Kursbereich der Kurs abgelegt wird.';
$string['choosecoursecategory'] = '- bitte w&auml;hlen Sie einen Kursbereich -';
$string['elcsupportheader'] = 'Hinweise an das E-Learning Center';
$string['elcsupportshort'] = 'Anmerkungen';
$string['elcsupporthelp'] = 'Was ist das?';
$string['elcsupportshort_help'] = 'Erstellen Sie den Moodle-Kurs f&uuml;r jemand anderen? Sonstige Hinweise? Gerne!';
$string['elcconsult'] = 'Didaktische Beratung';
$string['elcconsult_help'] = 'Wir vermitteln Ihnen gerne eine Beratung zum Einsatz von Moodle durch das E-Learning-Center. Bitte markieren Sie diese Box, falls Sie eine Beratung wünschen.';
$string['copycourse'] = '&Uuml;bernahme von Kursdaten';
$string['copycourse_help'] = 'Bitte geben Sie den vollst&auml;ndigen Kursnamen oder den Link zum Kurs an.';
$string['courseapprovedemail1'] = 'Sehr geehrte/r {$a->fullname},
der von Ihnen beantragte Kurs "{$a->coursename}" wurde angelegt.
';
$string['coursecopyinform'] = 'HINWEIS: Die gewünschte Datenübernahme wird derzeit von mir ausgeführt und steht Ihnen anschließend zur Verfügung.';
$string['courseapprovedemail2'] = '
Zum neuen Kurs gelangen Sie über {$a->url}.
Bei Rückfragen zur Nutzung der Moodle Plattform beraten wir Sie gerne telefonisch oder per E-Mail elc@hs-hannover.de.
Sie wünschen eine persönliche Beratung zu Moodle oder anderen E-Learning Werkzeugen? Gerne vereinbaren wir einen individuellen Termin.
';
$string['courseapprovedemailfooter'] = 'Mit freundlichen Grüßen
{$a->responser}
{$a->email}
{$a->telefon}
';
$string['courseapprovedsubject'] = 'Der beantragte Kurs, "{$a->coursename}", wurde angelegt.';
$string['courserequestsuccess'] = 'Ihr Kursantrag wurde an das E-Learning Center übertragen und wird so schnell wie möglich (i.d.R. in den nächsten drei Werktagen) bearbeitet. Sie werden umgehend per E-Mail über die Freischaltung informiert. Bei zeitkritischen Anträgen oder Nachfragen wenden Sie sich bitte an: elc@hs-hannover.de oder nutzen Sie unser Kontaktformular. https://moodle.hs-hannover.de/local/contactform/contact.php';
$string['coursespending'] = 'Ihre beantragten Kurse (Freischaltung in Arbeit)';
<?php
/**
* User: wernerpe
* Date: 19.01.2015
* Time: 10:48
*/
$string['pluginname'] = 'Contactformular';
$string['missingfield'] = 'Required field!';
$string['contactform'] = 'Contact us';
$string['contactto'] = 'Request for';
$string['contactto_mis'] = 'Please choose a supportteam.';
$string['contacttoelc'] = 'General (ELC)';
$string['contacttomoodle'] = 'Moodle Support';
$string['personaldetails'] = 'Personal details';
$string['title'] = 'Title';
$string['firstname'] = 'First name';
$string['firstname_mis'] = 'Please enter your first name.';
$string['lastname'] = 'Last name';
$string['lastname_mis'] = 'Please enter your last name.';
$string['email'] = 'E-Mail address';
$string['email_mis'] = 'Please enter a valid e-mail address.';
$string['telephone'] = 'Telephone';
$string['yourmessage'] = 'Your message';
$string['subject'] = 'Subject';
$string['subject_mis'] = 'Please choose a subject.';
$string['message'] = 'Your message';
$string['message_mis'] = 'Please enter a message.';
$string['pleasechoose'] = 'Please choose';
$string['other'] = 'Other';
// ELC
$string['training'] = 'Training';
$string['eexam'] = 'E-Examination';
$string['evaexam'] = 'EvaExam';
$string['loncapa'] = 'LON-CAPA';
$string['moodle'] = 'Moodle';
$string['clicker'] = 'Turning Point System (Clicker)';
$string['recording'] = 'Video recording of courses';
// MOODLE
$string['dataloss'] = 'Data loss';
$string['loginprob'] = 'Login problems';
$string['usercreate'] = 'User creation';
<<<<<<< HEAD
$string['technical'] = 'Technical problem';
$string['improvement'] = 'Suggestion for improvement';
$string['course'] = 'Moodle course';
=======
$string['userdelete'] = 'User deletion';
$string['technical'] = 'Technical problem';
$string['improvement'] = 'Suggestion for improvement';
$string['course'] = 'Moodle course';
$string['coursedelete'] = 'Moodle course deletion';
>>>>>>> hsh/develop
$string['submit'] = 'Submit';
$string['confirmrequest'] = 'Your request has been mailed to our support team. Our supporter will become connected with you.';
// Course Request Fields
$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.';
$string['containspassword'] = '{$a} contains password';
$string['reason'] = 'Reason';
$string['reason_help'] = 'Here you can describe (in a few words), what the purpose of this course will be';
$string['teachername'] = 'Teacher\'s last name';
$string['missingfullname'] = 'Please enter the full title of course.';
$string['missingshortname'] = 'Please enter the course shortened name.';
$string['missingteachername'] = 'Please enter teacher\'s last name';
$string['missingsemesterselect'] = 'Please select a semester.';
$string['missingenrolmentkey'] = 'Please enter an enrolment key.';
$string['wrongchoosesemester']='You have to choose a period.';
$string['wrongcategory'] = 'It\'s not allowed to use this category.';
$string['teachername_help'] = 'The teacher\'s last name will be added to the course title.';
$string['morethanone'] = 'Non-Semester based';
$string['choosesemester']='Choose semester';
$string['choosesemester_help']='Please choose the semester in which the course will be held. You can also define your course as non-semester based.';
$string['pleasechoosesemester']='- please choose a semester -';
$string['summaryhead'] = 'Course summary for the course overview (optional)';
$string['summary'] = 'Course summary (optional)';
$string['summary_help'] = 'The course summary is displayed in the list of courses. The course search includes the course summary text as well as the course title.';
$string['coursecategory'] = 'Course category';
$string['coursecategory_help'] = 'This setting determines the category in which the course will appear in the list of courses.';
$string['choosecoursecategory'] = '- please choose a course category -';
$string['elcsupportheader'] = 'Hints to the E-Learning Center';
$string['elcsupportshort'] = 'Additional comments';
$string['elcsupportshort_help'] = 'Do you create this moodle course for someone else? Would you like course content to be transferred from any of your previous courses? Do you need any other information? Feel free to contact us.';
$string['elcconsult'] = 'Request for training';
$string['elcconsult_help'] = 'We are happy to arrange a Moodle training appointment carried out by the E-Learning Center. Please check this box if you would like to be contacted for individual training.';
$string['copycourse'] = 'Data transfer';
$string['copycourse_help'] = 'Please enter the full course title or the link to the course.';
$string['courseapprovedemail1'] = 'Dear {$a->fullname},
the course "{$a->coursename}" has been set up.
';
$string['coursecopyinform'] = 'INFORMATION: If you have requested an import of course data from a previous moodle course, the import will be completed at any moment.';
$string['courseapprovedemail2'] = '
Please click the following link to access your course {$a->url}.
In case of questions regarding the moodle platform please get in touch with the ELC Team at Hochschule Hannover. We are happy to help via elc@hs-hannover.de or in a quick phone call.
If you need any further assistance or training for Moodle or other E-Learning tools don\'t hesitate to make an individual appointment.
';
$string['courseapprovedemailfooter'] = 'Best regards
{$a->responser}
{$a->email}
{$a->telefon}
';
$string['courseapprovedemailfooter2'] = 'Hochschule Hannover
University of Applied Sciences and Arts
ZSW - E-Learning Center
Expo Plaza 12
30539 Hannover
Raum 3.59: Herr Dr. Tjettmers, Frau Chukhlova, Frau Müller
Raum 3.61: Herr Saatze, Herr Werner
E-Mail: elc@hs-hannover.de
Tel.: ++49 (511) 9296-2655
Fax: ++49 (511) 9296-2603';
$string['courseapprovedsubject'] = 'Your course {$a->coursename} has been approved.';
$string['courserequestsuccess'] = 'Ihr Kursantrag wurde an das E-Learning Center übertragen und wird so schnell wie möglich (i.d.R. in den nächsten drei Werktagen) bearbeitet. Sie werden umgehend per E-Mail über die Freischaltung informiert. Bei zeitkritischen Anträgen oder Nachfragen wenden Sie sich bitte an: elc@hs-hannover.de oder nutzen Sie unser Kontaktformular. https://moodle.hs-hannover.de/local/contactform/contact.php';
$string['coursespending'] = 'Ihre beantragten Kurse (Freischaltung in Arbeit)';
lib.php 0 → 100644
<?php
/**
* Created by PhpStorm.
* User: wernerpe
* Date: 21.01.2015
* Time: 10:45
*/
require_once($CFG->libdir.'/moodlelib.php');
class contactform{
public static function create($eventdata) {
global $CFG;
$mail = get_mailer();
$formatted_subject = "";
if ($eventdata->contacttoselect == 1) {
$formatted_subject .= "[ELC] ";
} else if ($eventdata->contacttoselect == 0) {
$formatted_subject .= "[Moodle] ";
}
$formatted_subject .= $eventdata->subject;
$message = 'Sehr geehrtes E-Learning Center, <br /><br />';
$message .= "\n".$eventdata->message.'<br /><br />';
$message .= 'Mit freundlichen Gr&uuml;&szlig;en <br />';
$message .= $eventdata->firstname.' '.$eventdata->lastname.'<br />';
$message .= 'Telefon: '.$eventdata->telephone;
$mail->Subject = $formatted_subject;
$mail->Body = $message;
$mail->AltBody = $message;
$mail->From = $eventdata->email;
$mail->FromName = $eventdata->lastname.", ".$eventdata->firstname;
$mail->addAddress("elc@hs-hannover.de");
$mail->send();
return $mail;
}
}
M.local_contactform = {
sesskey: null,
init: function (Y, instanceid, sesskey) {
this.Y = Y;
this.sesskey = sesskey;
this.instanceid = instanceid;
this.progress = Y.one('#id_contacttoselect');
var moodlestrings = new Array();
moodlestrings.push(M.util.get_string('dataloss','local_contactform'));
moodlestrings.push(M.util.get_string('loginprob','local_contactform'));
moodlestrings.push(M.util.get_string('usercreate','local_contactform'));
<<<<<<< HEAD
=======
moodlestrings.push(M.util.get_string('userdelete','local_contactform'));
moodlestrings.push(M.util.get_string('coursedelete','local_contactform'));
>>>>>>> hsh/develop
moodlestrings.push(M.util.get_string('technical','local_contactform'));
moodlestrings.push(M.util.get_string('improvement','local_contactform'));
moodlestrings.sort();
moodlestrings.unshift(M.util.get_string('pleasechoose','local_contactform'));
moodlestrings.push(M.util.get_string('other','local_contactform'));
var elcstrings = new Array();
elcstrings.push(M.util.get_string('clicker','local_contactform'));
elcstrings.push(M.util.get_string('eexam','local_contactform'));
elcstrings.push(M.util.get_string('evaexam','local_contactform'));
elcstrings.push(M.util.get_string('loncapa','local_contactform'));
elcstrings.push(M.util.get_string('recording','local_contactform'));
elcstrings.push(M.util.get_string('training','local_contactform'));
elcstrings.sort();
elcstrings.unshift(M.util.get_string('pleasechoose','local_contactform'));
elcstrings.push(M.util.get_string('other','local_contactform'));
Y.one('#id_contacttoselect').on('change', function (e) {
var index = Y.one("#id_contacttoselect").get('selectedIndex');
var value = Y.one("#id_contacttoselect").get("options").item(index).getAttribute('value');
var subject = document.getElementById("id_subject");
var currentarr = new Array();
var i;
for(i=subject.options.length-1;i>=0;i--)
{
subject.remove(i);
}
if (value == 1) {
currentarr = elcstrings;
} else if (value == 0) {
currentarr = moodlestrings;
}
var option;
Y.Array.each(currentarr, function (element) {
option = Y.Node.create('<option>').set('innerHTML', element);
option = Y.Node.set('value',element);
option.appendTo(subject);
});
}, this);
}
}
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'local_contactform';
$plugin->version = 2015042300;
$plugin->release = '2.8 (Build: 2015042300)';
$plugin->requires = 2014051200;
$plugin->maturity = MATURITY_STABLE;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment