コード例 #1
0
ファイル: export.php プロジェクト: martinliao/attcontrol
 * @copyright  2011 Artem Andreev <*****@*****.**>
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once dirname(__FILE__) . '/../../config.php';
require_once dirname(__FILE__) . '/locallib.php';
require_once dirname(__FILE__) . '/export_form.php';
require_once dirname(__FILE__) . '/renderables.php';
require_once dirname(__FILE__) . '/renderhelpers.php';
$id = required_param('id', PARAM_INT);
$cm = get_coursemodule_from_id('attcontrol', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$att = $DB->get_record('attcontrol', array('id' => $cm->instance), '*', MUST_EXIST);
require_login($course, true, $cm);
$att = new attcontrol($att, $cm, $course, $PAGE->context);
$att->perm->require_export_capability();
$PAGE->set_url($att->url_export());
//Changed page heading
$PAGE->set_title($course->shortname . ": " . $att->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_cacheable(true);
$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'attcontrol'));
$PAGE->navbar->add(get_string('export', 'quiz'));
$formparams = array('course' => $course, 'cm' => $cm, 'modcontext' => $PAGE->context);
$mform = new mod_attcontrol_export_form($att->url_export(), $formparams);
if ($mform->is_submitted()) {
    $formdata = $mform->get_data();
    $pageparams = new att_page_with_filter_controls();
    $pageparams->init($cm);
    $pageparams->group = $formdata->group;
    $pageparams->set_current_sesstype($formdata->group ? $formdata->group : att_page_with_filter_controls::SESSTYPE_ALL);
    if (isset($formdata->includeallsessions)) {