Fix controllo impostazione Attiva aggiornamenti

This commit is contained in:
Luca 2022-09-23 16:50:56 +02:00
parent eb83eba45c
commit 2678a7db87
2 changed files with 24 additions and 11 deletions

View File

@ -44,7 +44,11 @@ switch (filter('op')) {
break; break;
case 'upload': case 'upload':
if (setting('Attiva aggiornamenti')){
include base_dir().'/modules/aggiornamenti/upload_modules.php'; include base_dir().'/modules/aggiornamenti/upload_modules.php';
}else{
flash()->error(tr('Non è permesso il caricamento di aggiornamenti o moduli!'));
}
break; break;

View File

@ -92,7 +92,6 @@ if (!function_exists('base_dir')) {
} }
// Aggiornamenti // Aggiornamenti
if (setting('Attiva aggiornamenti')) {
$alerts = []; $alerts = [];
if (!extension_loaded('zip')) { if (!extension_loaded('zip')) {
@ -184,19 +183,22 @@ function search(button) {
} }
</script> </script>
<div class="row"> <div class="row">';
echo'
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-success"> <div class="box box-success">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title"> <h3 class="box-title">
'.tr('Carica un aggiornamento').' <span class="tip" title="'.tr('Form di caricamento aggiornamenti del gestionale e innesti di moduli e plugin').'."><i class="fa fa-question-circle-o"></i></span> '.tr('Carica aggiornamenti o nuovi moduli').' <span class="tip" title="'.tr('Form di caricamento aggiornamenti del gestionale e innesti di moduli e plugin').'."><i class="fa fa-question-circle-o"></i></span>
</h3> </h3>
</div> </div>
<div class="box-body"> <div class="box-body">
<form action="'.base_path().'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" id="update"> <form action="'.base_path().'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" id="update">
<input type="hidden" name="op" value="upload"> <input type="hidden" name="op" value="upload">
{[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]} {[ "type": "file", "name": "blob", "required": 1, "accept": ".zip", "disabled": '.(setting('Attiva aggiornamenti')? 0 : 1).' ]}
'; ';
@ -218,12 +220,16 @@ echo '
<button type="button" class="btn btn-primary pull-right '.$disabled.'" id="aggiorna" onclick="update()"> <button type="button" class="btn btn-primary pull-right '.$disabled.'" id="aggiorna" onclick="update()">
<i class="fa fa-upload"></i> '.tr('Carica').' <i class="fa fa-upload"></i> '.tr('Carica').'
</button> </button>';
echo '
</form> </form>
</div> </div>
</div> </div>
</div> </div>';
echo '
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border"> <div class="box-header with-border">
@ -245,7 +251,9 @@ echo '
</button> </button>
</div> </div>
</div> </div>
</div> </div>';
echo '
<div class="col-md-4"> <div class="col-md-4">
<div class="box box-info"> <div class="box box-info">
@ -267,9 +275,10 @@ echo '
echo ' </div> echo ' </div>
</div> </div>
</div>
</div>'; </div>';
}
echo '
</div>';
// Requisiti // Requisiti
echo ' echo '