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
$this->addOutput([
'title' => 'Téléverser un module',
'title' => 'Installer un module',
'view' => 'upload'
]);
}
@ -310,18 +310,18 @@ class plugin extends common {
// Module non installé
$ico = template::ico('download');
$class = '';
$help = 'Télécharger le module';
$help = 'Télécharger le module dans le gestionnaire de fichiers';
// Le module est installé
if (array_key_exists($key,$infoModules) === true) {
$class = 'buttonGreen';
$ico = template::ico('update');
$help = 'Mettre à jour ce module';
$help = 'Mettre à jour le module orphelin';
}
// Le module est installé et utilisé
if (in_array($key,$inPages) === true) {
$class = 'buttonRed';
$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 [] = [
$store[$key]['category'],

View File

@ -17,6 +17,30 @@
* 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 {
filter : brightness(150%);
}
filter : brightness(70%);
}

View File

@ -15,51 +15,30 @@
'help' => 'Consulter l\'aide en ligne'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="row textAlignCenter">
<div class="col3">
<?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 class="col3 offset7">
<?php echo template::button('configModulesStore', [
'href' => helper::baseUrl() . 'plugin/store',
'ico' => 'shopping-basket',
'value' => 'Catalogue en ligne'
]); ?>
</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): ?>
<div class="row">
<div class="col12">
<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', '', '', '']); ?>
</div>
</div>
@ -71,14 +50,14 @@
<div class="row">
<div class="col12">
<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', '', '']); ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div id="manageDatas" class="displayNone">
<div class="tabContent displayNone" id="manageDatas">
<?php if($module::$modulesData): ?>
<div class="row">
<div class="col12">

View File

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