From c4b1274187325e2ed66bc0bc5114ad8c4321092f Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 28 Dec 2018 22:38:32 +0100 Subject: [PATCH] Import theme ok --- core/module/theme/theme.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index fff1ffac..538bdbe5 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -26,7 +26,6 @@ class theme extends common { 'site' => self::GROUP_ADMIN, 'manage' => self::GROUP_ADMIN, 'export' => self::GROUP_ADMIN, - 'import' => self::GROUP_ADMIN, 'save' => self::GROUP_ADMIN ]; public static $aligns = [ @@ -450,12 +449,18 @@ class theme extends common { public function manage() { if($this->isPost() ) { $zipFilename = $this->getInput('themeManageImport', helper::FILTER_STRING_SHORT, true); + $zip = new ZipArchive(); - if ($zip->open($zipFilename) === TRUE) { - echo $zip->extractTo('site/'); - die(); + if ($zip->open('site/file/source/'.$zipFilename) === TRUE) { + $zip->extractTo('.'); $zip->close(); - } + } + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Archive '.$zipFilename.' sauvegardée dans fichiers', + 'redirect' => helper::baseUrl() . 'theme', + 'state' => true + ]); } // Valeurs en sortie $this->addOutput([ @@ -534,14 +539,4 @@ class theme extends common { ]); } - /** - * Import du thème - */ - public function import() { - - } - - - - }