MDL-22388 Added some checks to kill these scripts dead with an unequivocal notice...
[moodle.git] / course / import / activities / import_form.php
1 <?php
3 if (!defined('MOODLE_INTERNAL')) {
4     die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
5 }
7 require_once($CFG->libdir.'/formslib.php');
9 class course_import_activities_form_1 extends moodleform {
11     function definition() {
13         global $CFG;
14         $mform    =& $this->_form;
15         $text = $this->_customdata['text'];
16         $options = $this->_customdata['options'];
17         $courseid = $this->_customdata['courseid'];
18         $mform->addElement('header', 'general', '');//fill in the data depending on page params
19         //later using set_data
20         $mform->addElement('select', 'fromcourse', $text, $options);
22         // buttons
23         $submit_string = get_string('usethiscourse');
24         $this->add_action_buttons(false, $submit_string);
26         $mform->addElement('hidden', 'id');
27         $mform->setType('id', PARAM_INT);
28         $mform->setConstants(array('id'=> $courseid));
30     }
32     function validation($data, $files) {
33         return parent::validation($data, $files);
34     }
36 }
38 class course_import_activities_form_2 extends moodleform {
40     function definition() {
42         global $CFG;
43         $mform    =& $this->_form;
44         $courseid = $this->_customdata['courseid'];
46         $mform->addElement('header', 'general', '');//fill in the data depending on page params
47         //later using set_data
48         $mform->addElement('text', 'fromcoursesearch', get_string('searchcourses'));
50         // buttons
51         $this->add_action_buttons(false, get_string('searchcourses'));
53         $mform->addElement('hidden', 'id');
54         $mform->setType('id', PARAM_INT);
55         $mform->setConstants(array('id'=> $courseid));
57     }
59     function validation($data, $files) {
60         return true;
61     }
63 }