Commit f176da93 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add archive to nasty hardcoded artefacttype places

parent 8dc3a580
...@@ -214,11 +214,12 @@ class PluginArtefactFile extends PluginArtefact { ...@@ -214,11 +214,12 @@ class PluginArtefactFile extends PluginArtefact {
'file' => array('file'), 'file' => array('file'),
'image' => array('file', 'image'), 'image' => array('file', 'image'),
'profileicon' => array('image'), 'profileicon' => array('image'),
'archive' => array('file'),
); );
} }
public static function get_attachment_types() { public static function get_attachment_types() {
return array('file', 'image'); return array('file', 'image', 'archive');
} }
} }
......
...@@ -562,6 +562,7 @@ class HtmlExportOutputFilter { ...@@ -562,6 +562,7 @@ class HtmlExportOutputFilter {
return '<a href="' . $this->basepath . '/files/blog/' . PluginExportHtml::text_to_path($artefact->get('title')) . '/' . $page . '.html">' . $matches[5] . '</a>'; return '<a href="' . $this->basepath . '/files/blog/' . PluginExportHtml::text_to_path($artefact->get('title')) . '/' . $page . '.html">' . $matches[5] . '</a>';
case 'file': case 'file':
case 'image': case 'image':
case 'archive':
$folderpath = $this->get_folder_path_for_file($artefact); $folderpath = $this->get_folder_path_for_file($artefact);
return '<a href="' . $this->basepath . '/files/file/' . $folderpath . PluginExportHtml::sanitise_path($artefact->get('title')) . '">' . $matches[5] . '</a>'; return '<a href="' . $this->basepath . '/files/file/' . $folderpath . PluginExportHtml::sanitise_path($artefact->get('title')) . '">' . $matches[5] . '</a>';
default: default:
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
{foreach from=$data.artefacts item=artefact} {foreach from=$data.artefacts item=artefact}
{if $artefact->artefacttype == 'blog'} {if $artefact->artefacttype == 'blog'}
<li><a href="{$WWWROOT}artefact/blog/view/?id={$artefact->id}">{$artefact->title|escape}</a></li> <li><a href="{$WWWROOT}artefact/blog/view/?id={$artefact->id}">{$artefact->title|escape}</a></li>
{elseif $artefact->artefacttype == 'file' || $artefact->artefacttype == 'image'} {elseif $artefact->artefacttype == 'file' || $artefact->artefacttype == 'image' || $artefact->artefacttype == 'archive'}
<li><a href="{$WWWROOT}artefact/file/download.php?file={$artefact->id}">{$artefact->title|escape}</a></li> <li><a href="{$WWWROOT}artefact/file/download.php?file={$artefact->id}">{$artefact->title|escape}</a></li>
{elseif $artefact->artefacttype == 'folder'} {elseif $artefact->artefacttype == 'folder'}
<li><a href="{$WWWROOT}artefact/file/?folder={$artefact->id}">{$artefact->title|escape}</a></li> <li><a href="{$WWWROOT}artefact/file/?folder={$artefact->id}">{$artefact->title|escape}</a></li>
......
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