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

Dodgy artefact render_metadata() stub

parent c3659b8a
......@@ -75,7 +75,7 @@ class ArtefactTypeFileBase extends ArtefactType {
return $this->title;
}
if ($format == FORMAT_ARTEFACT_RENDERMETADATA) {
return '';
return $this->render_metadata($options);
}
//@todo: This should be an invalid render format exception
throw new Exception('invalid render format');
......@@ -133,7 +133,7 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
return '';
}
if ($format == FORMAT_ARTEFACT_RENDERMETADATA) {
return '';
return $this->render_metadata($options);
}
if ($format == FORMAT_ARTEFACT_RENDERFULL) {
return '';
......@@ -168,7 +168,7 @@ class ArtefactTypeImage extends ArtefactTypeFile {
return $this->title;
}
if ($format == FORMAT_ARTEFACT_RENDERMETADATA) {
return '';
return $this->render_metadata($options);
}
if ($format == FORMAT_ARTEFACT_RENDERFULL) {
return '';
......
......@@ -404,6 +404,19 @@ abstract class ArtefactType {
*/
public abstract function render($format, $options);
/**
* render instance to given format
* @param int $format format type (constant)
* @param array $options options for format
*/
public function render_metadata($options) {
$html = '<table><tbody>';
$html .= '<tr><td>' . get_string('title') . '</td><td>' . $this->title. '</td></tr>';
$html .= '<tr><td>' . get_string('owner') . '</td><td>' . display_name($this->owner) . '</td></tr>';
$html .= '</tbody></table>';
return $html;
}
/**
* returns path to icon
* can be called statically but not defined so
......
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