removed ooo log output format now replaced by ods

This commit is contained in:
skodak 2007-01-02 09:49:10 +00:00
parent 02023a60e8
commit fc82080170

View File

@ -756,100 +756,6 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
return true;
}
/*
// Relies on $CFG->libdir.'/phpdocwriter/lib/include.php', which is not
// included in the default Moodle distribution.
function print_log_ooo($course, $user, $date, $order='l.time DESC', $modname,
$modid, $modaction, $groupid) {
global $CFG;
require_once($CFG->libdir.'/phpdocwriter/lib/include.php');
if (!$logs = build_logs_array($course, $user, $date, $order, '', '',
$modname, $modid, $modaction, $groupid)) {
return false;
}
if ($course->id == SITEID) {
$courses[0] = '';
if ($ccc = get_courses('all', 'c.id ASC', 'c.id,c.shortname')) {
foreach ($ccc as $cc) {
$courses[$cc->id] = $cc->shortname;
}
}
}
$count=0;
$ldcache = array();
$tt = getdate(time());
$today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]);
$strftimedatetime = get_string("strftimedatetime");
$filename = 'logs_'.userdate(time(),get_string('backupnameformat'),99,false);
$filename .= '.sxw';
import('phpdocwriter.pdw_document');
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Pragma: public");
header("Content-Transfer-Encoding: binary");
$sxw = new pdw_document;
$sxw->SetFileName($filename);
$sxw->SetAuthor('Moodle');
$sxw->SetTitle('logs');
$sxw->SetDescription('logs'.' - '.$filename);
$sxw->SetLanguage('es','ES');
$sxw->SetStdFont("Times New Roman",12);
$sxw->AddPageDef(array('name'=>'Standard', 'margins'=>'1,1,1,1', 'w'=>'29.7', 'h'=>'21'));
$sxw->Write(get_string('savedat').userdate(time(), $strftimedatetime));
$sxw->Ln(3);
$headers = array(get_string('course'), get_string('time'), get_string('ip_address'),
get_string('fullname'), get_string('action'), get_string('info'));
foreach($headers as $key=>$header){
$headers[$key] = eregi_replace ("<br?>", " ",$header);
}
foreach ($logs['logs'] as $log) {
if (isset($ldcache[$log->module][$log->action])) {
$ld = $ldcache[$log->module][$log->action];
} else {
$ld = get_record('log_display', 'module', $log->module, 'action', $log->action);
$ldcache[$log->module][$log->action] = $ld;
}
if ($ld && !empty($log->info)) {
// ugly hack to make sure fullname is shown correctly
if (($ld->mtable == 'user') and ($ld->field == sql_concat('firstname', "' '" , 'lastname'))) {
$log->info = fullname(get_record($ld->mtable, 'id', $log->info), true);
} else {
$log->info = get_field($ld->mtable, $ld->field, 'id', $log->info);
}
}
// Filter log->info
$log->info = format_string($log->info);
$log->url = strip_tags(urldecode($log->url)); // Some XSS protection
$log->info = strip_tags(urldecode($log->info)); // Some XSS protection
$log->url = str_replace('&', '&amp;', $log->url); // XHTML compatibility
$firstField = $courses[$log->course];
$fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
$row = array($firstField, userdate($log->time, $strftimedatetime), $log->ip, $fullname, $log->module.' '.$log->action, $log->info);
$data[] = $row;
}
$sxw->Table($headers,$data);
$sxw->Output();
return true;
}
*/
function print_log_graph($course, $userid=0, $type="course.png", $date=0) {
global $CFG;