v9.0.0 : import d'une archive

This commit is contained in:
fredtempez 2018-12-27 20:06:03 +01:00
parent 8089a9c6ea
commit 5cd358633b
2 changed files with 52 additions and 9 deletions

View File

@ -447,6 +447,33 @@ class theme extends common {
* Import du thème * Import du thème
*/ */
public function manage() { public function manage() {
if($this->isPost() ) {
if ($this->getInput('themeManageImport') !== '') {
if ($this->import($this->getInput('themeManageImport'))) {
// import ok
$this->addOutput([
'notification' => 'Thème ' . $this->getInput('themeManageImport'). ' importé',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
} else {
$this->addOutput([
'notification' => 'Archive incorrecte',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
}
} else {
$this->addOutput([
'notification' => 'Error ',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
}
}
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Gestion des thèmes', 'title' => 'Gestion des thèmes',
@ -561,6 +588,7 @@ class theme extends common {
* Import du thème * Import du thème
*/ */
public function import() { public function import() {
} }

View File

@ -1,17 +1,32 @@
<?php ?> <?php echo template::formOpen('themeManageForm'); ?>
<div class="col2"> <div class="row">
<?php echo template::button('themeFooterBack', [ <div class="col2">
'class' => 'buttonGrey', <?php echo template::button('themeManageBack', [
'href' => helper::baseUrl() . 'theme', 'class' => 'buttonGrey',
'ico' => 'left', 'href' => helper::baseUrl() . 'theme',
'value' => 'Retour' 'ico' => 'left',
]); ?> 'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('themeImportSubmit', [
'value' => 'Importer'
]); ?>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4>Importer les données du thème</h4> <h4>Importer les données du thème</h4>
<?php echo template::file('themeManageImport', [
'label' => 'Archive à importer',
'type' => 2
]); ?>
<div class="col5 offset3"> <div class="col5 offset3">
<?php echo template::submit('themeImportSubmit', [
'value' => 'Importer'
]); ?>
<p \>
<?php echo template::button('themeImport', [ <?php echo template::button('themeImport', [
'href' => helper::baseUrl() . 'theme/import', 'href' => helper::baseUrl() . 'theme/import',
'value' => 'Importer les données du thème' 'value' => 'Importer les données du thème'
@ -32,4 +47,4 @@
</div> </div>
</div> </div>
</div> </div>
<?php?> <?php echo template::formClose(); ?>