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
*/
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
$this->addOutput([
'title' => 'Gestion des thèmes',
@ -561,6 +588,7 @@ class theme extends common {
* Import du thème
*/
public function import() {
}

View File

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