Index: install.php =================================================================== --- install.php (revision 14188) +++ install.php (working copy) @@ -846,13 +846,21 @@ FROM ' . $theme_table . ' WHERE ' . $theme_idfield . ' = ' . $theme_id; $theme_name = $this->Conn->GetOne($sql); + $site_path = $this->Application->ConfigValue('Site_Path'); + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + foreach ($this->Application->ModuleInfo as $module_name => $module_info) { if ($module_name == 'In-Portal') { continue; } - $this->toolkit->RunSQL('/themes' . '/' . $theme_name . '/' . $module_info['TemplatePath'] . '_install/install_data.sql', '{ThemeId}', $theme_id); + $template_path = '/themes' . '/' . $theme_name . '/' . $module_info['TemplatePath']; + $this->toolkit->RunSQL( $template_path . '_install/install_data.sql', Array('{ThemeId}', '{SitePath}'), Array($theme_id, $site_path) ); + + // copy theme demo images into writable path accessible by FCKEditor + $file_helper->copyFolderRecursive(FULL_PATH . $template_path . '_install/images' . DIRECTORY_SEPARATOR, WRITEABLE . '/user_files/Images'); } } break; Index: units/helpers/file_helper.php =================================================================== --- units/helpers/file_helper.php (revision 14194) +++ units/helpers/file_helper.php (working copy) @@ -299,8 +299,8 @@ $dir = opendir($source); $result = $this->CheckFolder($destination); - if (!$result) { - // failed to create target directory + if (!$result || !is_resource($dir)) { + // failed to create target directory OR failed to open source directory return false; } @@ -344,8 +344,8 @@ $dir = opendir($source); $result = $this->CheckFolder($destination); - if (!$result) { - // failed to create target directory + if (!$result || !is_resource($dir)) { + // failed to create target directory OR failed to open source directory return false; }