Commit ea894ba6 authored by Nigel McNie's avatar Nigel McNie
Browse files

Removed a bunch of unnecessary methods - get_metadata, file_url etc. for artefacts

parent 3a3cf5e3
......@@ -461,21 +461,6 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
protected function get_metadata($options=array()) {
$data = parent::get_metadata($options);
unset($data['description']);
unset($data['size']);
$data['type']['value'] = get_string($this->get('artefacttype'), 'artefact.blog');
$data['attachments'] = array('name' => get_string('attachments', 'artefact.blog'),
'value' => $this->count_attachments() . ' '
. get_string('files', 'artefact.file'));
if (isset($options['viewid']) && artefact_in_view($id = $this->get('id'), $options['viewid'])) {
$data['title']['value'] = '<a href="' . get_config('wwwroot') . 'view/view.php?view=' . $options['viewid'] . '&artefact=' . $id . '">' . $data['title']['value'] . '</a>';
}
return $data;
}
public static function get_icon($id=0) {
}
......
......@@ -676,27 +676,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
return floor(($bytes / 1048576) * 10 + 0.5) / 10 . 'M';
}
private function file_url($options) {
$result = get_config('wwwroot') . 'artefact/file/download.php?file=' . $this->get('id');
if (isset($options['viewid'])) {
$result .= '&view=' . $options['viewid'];
}
return $result;
}
public function linkself() {
return '<a href="' . $this->file_url() . '">' . get_string('download', 'artefact.file') . '</a>';
}
protected function get_metadata($options=array()) {
$data = parent::get_metadata($options);
$data['size'] = array('name' => get_string('size', 'artefact.file'),
'value' => $this->get('size') . ' ' . get_string('bytes', 'artefact.file'));
$data['download'] = array('name' => get_string('download', 'artefact.file'),
'value' => make_link($this->file_url($options)));
return $data;
}
public static function get_links($id) {
$wwwroot = get_config('wwwroot');
......@@ -795,13 +774,6 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
return $record->id;
}
protected function get_metadata($options=array()) {
$data = parent::get_metadata($options);
$data['size'] = array('name' => get_string('size', 'artefact.file'),
'value' => $this->count_children() . ' ' . get_string('files', 'artefact.file'));
return $data;
}
public static function get_links($id) {
$wwwroot = get_config('wwwroot');
......
Markdown is supported
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