Commit 6ddde1d7 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add download link to file metadata

parent 14666835
......@@ -36,6 +36,7 @@ $string['deletefile?'] = 'Are you sure you want to delete this file?';
$string['deletefolder?'] = 'Are you sure you want to delete this folder?';
$string['description'] = 'Description';
$string['destination'] = 'Destination';
$string['download'] = 'Download';
$string['editfile'] = 'Edit file';
$string['editfolder'] = 'Edit folder';
$string['file'] = 'File';
......
......@@ -464,6 +464,9 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
$data = parent::get_metadata();
$data['size'] = array('name' => get_string('size', 'artefact.file'),
'value' => $this->size);
$url = get_config('wwwroot') . 'artefact/file/download.php?file=' . $this->get('id');
$data['download'] = array('name' => get_string('download', 'artefact.file'),
'value' => make_link($url));
return $data;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment