Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 22... Línea 22...
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
23
 */
Línea 24... Línea 24...
24
 
24
 
25
require_once(__DIR__ . '/../config.php');
25
require_once(__DIR__ . '/../config.php');
-
 
26
require_once("{$CFG->libdir}/adminlib.php");
Línea 26... Línea 27...
26
require_once("{$CFG->libdir}/adminlib.php");
27
require_once("tool/task/lib.php");
27
 
28
 
Línea 28... Línea 29...
28
use core_admin\reportbuilder\local\systemreports\task_logs;
29
use core_admin\reportbuilder\local\systemreports\task_logs;
Línea 47... Línea 48...
47
    $log = $DB->get_record('task_log', ['id' => $logid], '*', MUST_EXIST);
48
    $log = $DB->get_record('task_log', ['id' => $logid], '*', MUST_EXIST);
Línea 48... Línea 49...
48
 
49
 
49
    if ($download) {
50
    if ($download) {
50
        $filename = str_replace('\\', '_', $log->classname) . "-{$log->id}.log";
51
        $filename = str_replace('\\', '_', $log->classname) . "-{$log->id}.log";
-
 
52
        header("Content-Disposition: attachment; filename=\"{$filename}\"");
-
 
53
        readstring_accel($log->output, 'text/plain');
51
        header("Content-Disposition: attachment; filename=\"{$filename}\"");
54
        exit;
Línea -... Línea 55...
-
 
55
    }
-
 
56
 
-
 
57
    try {
-
 
58
        $class = new $log->classname;
-
 
59
        $title = $class->get_name();
-
 
60
    } catch (Exception $e) {
-
 
61
        $title = $log->classname;
-
 
62
    }
-
 
63
    $title .= " ($log->id)";
-
 
64
 
-
 
65
    $PAGE->navbar->add($title, '');
-
 
66
    echo $OUTPUT->header();
52
    }
67
    echo html_writer::start_tag('pre', ['class' => 'task-output', 'style' => 'min-height: 24lh']);
-
 
68
 
-
 
69
    echo tool_task_mtrace_wrapper($log->output);
-
 
70
    echo html_writer::end_tag('pre');
-
 
71
    echo $OUTPUT->action_link(
-
 
72
        new moodle_url('/admin/tasklogs.php'),
-
 
73
        $strheading,
-
 
74
        null,
-
 
75
        null,
-
 
76
        new pix_icon('i/log', ''),
-
 
77
    );
-
 
78
    echo ' ';
-
 
79
    echo $OUTPUT->action_link(
-
 
80
        new moodle_url('/admin/tasklogs.php', ['logid' => $log->id, 'download' => true]),
-
 
81
        new lang_string('download'),
-
 
82
        null,
-
 
83
        null,
-
 
84
        new pix_icon('t/download', ''),
-
 
85
    );
53
 
86
 
54
    readstring_accel($log->output, 'text/plain');
87
    echo $OUTPUT->footer();
Línea 55... Línea 88...
55
    exit;
88
    exit;
56
}
89
}