import_form.php
来自「很棒的在线教学系统」· PHP 代码 · 共 61 行
PHP
61 行
<?php // $Id: import_form.php,v 1.5.2.1 2007/11/23 22:12:35 skodak Exp $require_once($CFG->libdir.'/formslib.php');class course_import_activities_form_1 extends moodleform { function definition() { global $CFG; $mform =& $this->_form; $text = $this->_customdata['text']; $options = $this->_customdata['options']; $courseid = $this->_customdata['courseid']; $mform->addElement('header', 'general', '');//fill in the data depending on page params //later using set_data $mform->addElement('select', 'fromcourse', $text, $options); // buttons $submit_string = get_string('usethiscourse'); $this->add_action_buttons(false, $submit_string); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $mform->setConstants(array('id'=> $courseid)); } function validation($data, $files) { return parent::validation($data, $files); }}class course_import_activities_form_2 extends moodleform { function definition() { global $CFG; $mform =& $this->_form; $courseid = $this->_customdata['courseid']; $mform->addElement('header', 'general', '');//fill in the data depending on page params //later using set_data $mform->addElement('text', 'fromcoursesearch', get_string('searchcourses')); // buttons $this->add_action_buttons(false, get_string('searchcourses')); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $mform->setConstants(array('id'=> $courseid)); } function validation($data, $files) { return true; }}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?