next up previous contents
Next: gradeexport_csv.php Up: 成績 Previous: grade_export_csv.php   Contents

index.php

  1. 檔案內有關 txt 字串,都改成 csv。
    [root@moodle grade]# diff -urNwbBE export/txt/index.php export/csv/index.php 
    --- export/txt/index.php	2012-06-26 01:14:18.000000000 +0800
    +++ export/csv/index.php	2013-03-25 15:40:00.000000000 +0800
    @@ -17,11 +17,11 @@
     
     require_once '../../../config.php';
     require_once $CFG->dirroot.'/grade/export/lib.php';
    -require_once 'grade_export_txt.php';
    +require_once 'grade_export_csv.php';
     
     $id = required_param('id', PARAM_INT); // course id
     
    -$PAGE->set_url('/grade/export/txt/index.php', array('id'=>$id));
    +$PAGE->set_url('/grade/export/csv/index.php', array('id'=>$id));
     
     if (!$course = $DB->get_record('course', array('id'=>$id))) {
         print_error('nocourseid');
    @@ -31,12 +31,12 @@
     $context = get_context_instance(CONTEXT_COURSE, $id);
     
     require_capability('moodle/grade:export', $context);
    -require_capability('gradeexport/txt:view', $context);
    +require_capability('gradeexport/csv:view', $context);
     
    -print_grade_page_head($COURSE->id, 'export', 'txt', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_txt'));
    +print_grade_page_head($COURSE->id, 'export', 'csv', get_string('exportto', 'grades') . ' ' . get_string('pluginname', 'gradeexport_csv'));
     
     if (!empty($CFG->gradepublishing)) {
    -    $CFG->gradepublishing = has_capability('gradeexport/txt:publish', $context);
    +    $CFG->gradepublishing = has_capability('gradeexport/csv:publish', $context);
     }
     
     $mform = new grade_export_form(null, array('includeseparator'=>true, 'publishing' => true));
    @@ -51,7 +51,7 @@
     
     // process post information
     if ($data = $mform->get_data()) {
    -    $export = new grade_export_txt($course, $currentgroup, '', false, false, $data->display, $data->decimals, $data->separator, $data->export_onlyactive);
    +    $export = new grade_export_csv($course, $currentgroup, '', false, false, $data->display, $data->decimals, $data->separator, $data->export_onlyactive);
    



2017-08-04