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

Unconditionally make the static/profileicons/ directory in the HTML export.

Thanks to Howard Miller for the report.
(cherry picked from commit feb89b5fd038de1f8f29881814fd5b4c7971b62a)
parent b067ff35
......@@ -89,17 +89,12 @@ class HtmlExportFile extends HtmlExportArtefactPlugin {
* Puts all profile icons in the static/profileicons/ directory
*/
private function populate_profileicons() {
$madeprofileiconsdir = false;
$profileiconsdir = $this->exporter->get('exportdir') . '/' . $this->exporter->get('rootdir') . '/static/profileicons/';
$removekeys = array();
foreach ($this->artefactdata as $artefactid => $artefact) {
if ($artefact->get('artefacttype') == 'profileicon') {
$removekeys[] = $artefactid;
if (!$madeprofileiconsdir) {
check_dir_exists($profileiconsdir);
}
if (!copy($artefact->get_path(), $profileiconsdir . PluginExportHtml::sanitise_path($artefact->get('title')))) {
throw new SystemException("Unable to copy profile icon $artefactid into export");
}
......
......@@ -71,7 +71,7 @@ class PluginExportHtml extends PluginExport {
$this->rootdir = 'portfolio-for-' . self::text_to_path($user->get('username'));
// Create basic required directories
foreach (array('files', 'views', 'static', 'static/smilies') as $directory) {
foreach (array('files', 'views', 'static', 'static/smilies', 'static/profileicons') as $directory) {
$directory = "{$this->exportdir}/{$this->rootdir}/{$directory}/";
if (!check_dir_exists($directory)) {
throw new SystemException("Couldn't create the temporary export directory $directory");
......
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