diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 0615675f226..fe3a4b7cf92 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -85,4 +85,5 @@ SubdirOfPage=Sub-directory dedicated to page AliasPageAlreadyExists=Alias page %s already exists CorporateHomePage=Corporate Home page EmptyPage=Empty page -ExternalURLMustStartWithHttp=External URL must start with http:// or https:// \ No newline at end of file +ExternalURLMustStartWithHttp=External URL must start with http:// or https:// +ZipOfWebsitePackageToImport=Zip file of website package \ No newline at end of file diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 24c0b8b6e63..af6b1312cbc 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1301,8 +1301,29 @@ if ($action == 'exportsite') // Import site if ($action == 'importsiteconfirm') { - $object->importWebSite($fileofzip); + $fileofzip = GETPOST('userfile'); + if (empty($fileofzip)) + { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); + $action = 'importsite'; + } + else + { + // TODO + + $result = $object->importWebSite($fileofzip); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'importsite'; + } + else + { + header("Location: aaaaa"); + exit(); + } + } } @@ -2086,8 +2107,24 @@ if ($action == 'createsite') if ($action == 'importsite') { + print '
'; + print '
'; + print_fiche_titre($langs->trans("ImportSite")); + + dol_fiche_head(array(), '0', '', -1); + + print $langs->trans("ZipOfWebsitePackageToImport").'

'; + + print ''; + print ''; + + dol_fiche_end(); + + print '
'; + + print '
'; } if ($action == 'editmeta' || $action == 'createcontainer')