Import theme ok

This commit is contained in:
fredtempez 2018-12-28 22:38:32 +01:00
parent 2697788377
commit c4b1274187

View File

@ -26,7 +26,6 @@ class theme extends common {
'site' => self::GROUP_ADMIN, 'site' => self::GROUP_ADMIN,
'manage' => self::GROUP_ADMIN, 'manage' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN, 'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN 'save' => self::GROUP_ADMIN
]; ];
public static $aligns = [ public static $aligns = [
@ -450,12 +449,18 @@ class theme extends common {
public function manage() { public function manage() {
if($this->isPost() ) { if($this->isPost() ) {
$zipFilename = $this->getInput('themeManageImport', helper::FILTER_STRING_SHORT, true); $zipFilename = $this->getInput('themeManageImport', helper::FILTER_STRING_SHORT, true);
$zip = new ZipArchive(); $zip = new ZipArchive();
if ($zip->open($zipFilename) === TRUE) { if ($zip->open('site/file/source/'.$zipFilename) === TRUE) {
echo $zip->extractTo('site/'); $zip->extractTo('.');
die();
$zip->close(); $zip->close();
} }
// Valeurs en sortie
$this->addOutput([
'notification' => 'Archive <b>'.$zipFilename.'</b> sauvegardée dans fichiers',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
} }
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -534,14 +539,4 @@ class theme extends common {
]); ]);
} }
/**
* Import du thème
*/
public function import() {
}
} }