Skip to content

Commit

Permalink
Fix import (creation of folders in new archive zip)
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Jul 26, 2015
1 parent 5f5bf89 commit 85be33a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion website_code/php/import/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ function make_new_template($type,$zip_path){

delete_loop($zip_path);

while($delete_folder = array_pop($delete_folder_array)){
foreach($delete_folder_array as $delete_folder){

rmdir($delete_folder);

}
$delete_folder_array = null;

rmdir($zip_path);

Expand Down Expand Up @@ -484,6 +485,15 @@ function folder_loop($path){
if($file_to_create[2]=="media"){

if ($file_to_create[0] != "") {
$pos = strrpos($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0], '/');
if ($pos > 0 ) {
$dir = substr($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0], 0, $pos);

if (!file_exists($dir)) {
mkdir($dir, 0777, true);
}
}

$fp = fopen($xerte_toolkits_site->import_path . $this_dir . $file_to_create[0], "w");

fwrite($fp, $file_to_create[1]);
Expand Down

0 comments on commit 85be33a

Please sign in to comment.