diff options
Diffstat (limited to 'mod/file/views/rss')
-rw-r--r-- | mod/file/views/rss/file/enclosure.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mod/file/views/rss/file/enclosure.php b/mod/file/views/rss/file/enclosure.php new file mode 100644 index 000000000..fb4a899d9 --- /dev/null +++ b/mod/file/views/rss/file/enclosure.php @@ -0,0 +1,16 @@ +<?php +/** + * Link to download the file + * + * @uses $vars['entity'] + */ + +if (elgg_instanceof($vars['entity'], 'object', 'file')) { + $download_url = elgg_get_site_url() . 'file/download/' . $vars['entity']->getGUID(); + $size = $vars['entity']->size(); + $mime_type = $vars['entity']->getMimeType(); + echo <<<END + + <enclosure url="$download_url" length="$size" type="$mime_type" />"; +END; +} |