Commit 97e1d8fc authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Get child artefacts when html exporting views; link folder names in html export (bug #522035)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 183457ce
......@@ -562,6 +562,7 @@ class HtmlExportOutputFilter {
$page = ($page == 1) ? 'index' : $page;
return '<a href="' . $this->basepath . '/files/blog/' . PluginExportHtml::text_to_path($artefact->get('title')) . '/' . $page . '.html">' . $matches[5] . '</a>';
case 'file':
case 'folder':
case 'image':
case 'archive':
$folderpath = $this->get_folder_path_for_file($artefact);
......@@ -660,10 +661,10 @@ class HtmlExportOutputFilter {
*
* The path is pre-sanitised so it can be used when generating the export
*
* @param ArtefactTypeFileBase $file The file to get the folder path for
* @param $file The file or folder to get the folder path for
* @return string
*/
private function get_folder_path_for_file(ArtefactTypeFileBase $file) {
private function get_folder_path_for_file($file) {
if ($this->folderdata === null) {
$this->folderdata = get_records_select_assoc('artefact', "artefacttype = 'folder' AND owner = ?", array($file->get('owner')));
if ($this->folderdata) {
......
......@@ -224,6 +224,7 @@ abstract class PluginExport extends Plugin {
// Some artefacts are not inside the view, but still need to be exported with it
$tmpartefacts = array_unique(array_merge($tmpartefacts, $this->get_view_extra_artefacts()));
$tmpartefacts = artefact_get_descendants($tmpartefacts);
}
if ($artefacts == self::EXPORT_ARTEFACTS_FOR_VIEWS) {
$this->artefactexportmode = $artefacts;
......
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