amélioration plugins

This commit is contained in:
fredtempez 2022-03-16 12:56:58 +01:00
parent c9ad1e1ef0
commit 2c0304369f
4 changed files with 57 additions and 48 deletions

View File

@ -233,7 +233,7 @@ class plugin extends common {
} }
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Téléverser un module', 'title' => 'Installer un module',
'view' => 'upload' 'view' => 'upload'
]); ]);
} }
@ -310,18 +310,18 @@ class plugin extends common {
// Module non installé // Module non installé
$ico = template::ico('download'); $ico = template::ico('download');
$class = ''; $class = '';
$help = 'Télécharger le module'; $help = 'Télécharger le module dans le gestionnaire de fichiers';
// Le module est installé // Le module est installé
if (array_key_exists($key,$infoModules) === true) { if (array_key_exists($key,$infoModules) === true) {
$class = 'buttonGreen'; $class = 'buttonGreen';
$ico = template::ico('update'); $ico = template::ico('update');
$help = 'Mettre à jour ce module'; $help = 'Mettre à jour le module orphelin';
} }
// Le module est installé et utilisé // Le module est installé et utilisé
if (in_array($key,$inPages) === true) { if (in_array($key,$inPages) === true) {
$class = 'buttonRed'; $class = 'buttonRed';
$ico = template::ico('update'); $ico = template::ico('update');
$help = 'Mettre à jour le module'; $help = 'Mettre à jour le module attaché, une sauvegarde des données de module est recommandée !';
} }
self::$storeList [] = [ self::$storeList [] = [
$store[$key]['category'], $store[$key]['category'],

View File

@ -17,6 +17,30 @@
* admin.css * admin.css
*/ */
/* Style the tab */
.tab {
margin-top: 1.8em;
overflow: hidden;
text-align: center;
}
.tab ~ .tabContent {
margin-top: -10px;
}
.buttonTab {
display: inline-block;
transition: 0.3s;
border-radius: 10px 10px 0px 0px;
width: 160px;
margin: 0 1px;
}
.buttonTab:hover {
filter : brightness(140%);
}
.activeButton { .activeButton {
filter : brightness(150%); filter : brightness(70%);
} }

View File

@ -15,51 +15,30 @@
'help' => 'Consulter l\'aide en ligne' 'help' => 'Consulter l\'aide en ligne'
]); ?> ]); ?>
</div> </div>
</div> <div class="col3 offset7">
<div class="row"> <?php echo template::button('configModulesStore', [
<div class="col12"> 'href' => helper::baseUrl() . 'plugin/store',
<div class="row textAlignCenter"> 'ico' => 'shopping-basket',
<div class="col3"> 'value' => 'Catalogue en ligne'
<?php echo template::button('configManageModuleButton', [ ]); ?>
'value' => 'Modules installés',
'class' => 'activeButton'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configManageDatasButton', [
'value' => 'Données des modules'
]); ?>
</div>
</div>
</div>
</div>
<div id="manageModules">
<div class="row">
<div class="col12">
<div class="block">
<h4>Installation / mise à jour d'un module</h4>
<div class="row textAlignCenter">
<div class="col4">
<?php echo template::button('configModulesStore', [
'href' => helper::baseUrl() . 'plugin/store',
'value' => template::ico('shopping-basket') . ' Catalogue en ligne'
]); ?>
</div>
<div class="col4">
<?php echo template::button('configStoreUpload', [
'href' => helper::baseUrl() . 'plugin/upload',
'value' => template::ico('upload') . ' Depuis une archive ZIP'
]); ?>
</div>
</div>
</div>
</div>
</div> </div>
</div>
<div class="tab">
<?php echo template::button('configManageModuleButton', [
'value' => 'Modules installés',
'class' => ' buttonTab activeButton'
]); ?>
<?php echo template::button('configManageDatasButton', [
'value' => 'Données des modules',
'class' => 'buttonTab'
]); ?>
</div>
<div class="tabContent" id="manageModules">
<?php if($module::$modulesInstalled): ?> <?php if($module::$modulesInstalled): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Sauvegarde des modules installés</h4> <h4>Sauvegarde</h4>
<?php echo template::table([2, 2, 1, 5, 1, 1], $module::$modulesInstalled, [ 'Modules', 'moduleId', 'Versions', '', '', '']); ?> <?php echo template::table([2, 2, 1, 5, 1, 1], $module::$modulesInstalled, [ 'Modules', 'moduleId', 'Versions', '', '', '']); ?>
</div> </div>
</div> </div>
@ -71,14 +50,14 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Désinstallation des modules orphelins</h4> <h4>Modules orphelins</h4>
<?php echo template::table([2, 2, 1, 6, 1], $module::$modulesOrphan, [ 'Modules', 'moduleId', 'Versions', '', '']); ?> <?php echo template::table([2, 2, 1, 6, 1], $module::$modulesOrphan, [ 'Modules', 'moduleId', 'Versions', '', '']); ?>
</div> </div>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div id="manageDatas" class="displayNone"> <div class="tabContent displayNone" id="manageDatas">
<?php if($module::$modulesData): ?> <?php if($module::$modulesData): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">

View File

@ -6,6 +6,12 @@
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>
<div class="col2 offset9">
<?php echo template::button('configStoreUpload', [
'href' => helper::baseUrl() . 'plugin/upload',
'value' => 'Installer'
]); ?>
</div>
</div> </div>
<?php if($module::$storeList): ?> <?php if($module::$storeList): ?>
<?php echo template::table([2, 2, 1, 2, 2, 1], $module::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Pages', '']); ?> <?php echo template::table([2, 2, 1, 2, 2, 1], $module::$storeList, ['Catégorie', 'Module', 'Version', 'Date', 'Pages', '']); ?>