|
@@ -49,6 +49,7 @@ class AppearanceImport extends RowAction
|
|
|
DistAppearanceTemplate::deleteTemplates(0, $appearanceId);
|
|
|
|
|
|
$this->readDirectory($path);
|
|
|
+
|
|
|
DistAppearance::setStatusToImported($appearanceId);
|
|
|
|
|
|
return $this->response()->success("Successfully imported")->refresh();
|
|
@@ -90,15 +91,16 @@ class AppearanceImport extends RowAction
|
|
|
|
|
|
|
|
|
$filePath = str_replace($this->sourcePath, '', $fullPath);
|
|
|
- $newParentId = DistAppearanceTemplate::insertTemplateFolder(0, $this->appearanceId, $filePath, $parentId);
|
|
|
+ $fileName = basename($fullPath);
|
|
|
+ $newParentId = DistAppearanceTemplate::insertTemplateFolder(0, $this->appearanceId, $filePath,$fileName, $parentId);
|
|
|
$this->readDirectory($fullPath,$newParentId);
|
|
|
} else {
|
|
|
|
|
|
$content = file_get_contents($fullPath);
|
|
|
$filePath = str_replace($this->sourcePath, '', $fullPath);
|
|
|
- $filePath = str_replace('/' .$file, '', $filePath);
|
|
|
+ $fileName = basename($fullPath);
|
|
|
|
|
|
- DistAppearanceTemplate::insertTemplateContent(0, $this->appearanceId, $filePath,$file, $parentId, $content);
|
|
|
+ DistAppearanceTemplate::insertTemplateContent(0, $this->appearanceId, $filePath,$fileName, $parentId, $content);
|
|
|
}
|
|
|
}
|
|
|
|