Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
70 righe
2.4 KiB
70 righe
2.4 KiB
<?php |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->ruolo == "SAD" && !empty($_GET["slug"])) { |
|
|
|
$class_name = Integrazione::unslugify($_GET["slug"]); |
|
$concrete_integrazione = null; |
|
$reference = new $class_name; |
|
foreach ($_SESSION["ente"] as $key => $integrazione): |
|
if ($integrazione instanceof $class_name && $integrazione instanceof Integrazione): |
|
$concrete_integrazione = $integrazione; |
|
endif; |
|
endforeach; |
|
|
|
if (empty($concrete_integrazione)) { |
|
http_response_code(401); |
|
die(); |
|
} |
|
|
|
$tmp_title = "Integrazione " . $class_name; |
|
$breadcrumb = [ |
|
"/impostazioni/" => "Avanzate", |
|
"" => $tmp_title |
|
]; |
|
include_once ($beRoot."/layout/top.php"); |
|
$concrete_integrazione->loadSettings(); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?php |
|
$modulo = ["titolo" => $tmp_title, "icon" => "fas fa-cog"]; |
|
include $root."/inc/views/modulo-header.php"; |
|
?> |
|
</h2> |
|
</div> |
|
</div> |
|
<?php $concrete_integrazione->beforeBody();?> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<strong class="card-title h5"><?= __("Impostazioni") ?></strong> |
|
</div> |
|
<div class="card-body"> |
|
<form method="POST" action="/backend/integrazione/save.php"> |
|
<input type="hidden" name="action" value="save_settings"> |
|
<input type="hidden" name="class" value="<?=$class_name?>"> |
|
<input type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<?php foreach($concrete_integrazione->settings as $key => $value): |
|
if (!empty($concrete_integrazione->validation[$key])): |
|
$val = $concrete_integrazione->validation[$key]; |
|
endif; |
|
?> |
|
<div class="form-group"> |
|
<label for="codice_ente"><?php echo __($val["label"]) ?> </label> |
|
<input value="<?php echo $value?>" title="<?php echo __($val["label"]) ?>" class="form-control" name="<?php echo "{$class_name}[{$key}]"?>" type="<?php echo $val["type"] ?? "text" ?>" rel="<?php echo $val["rel"] ?? ""?>"> |
|
<?php if (!empty($val["example"])):?> |
|
<small class="text-muted">es. <?php echo $val["example"]?></small> |
|
<?php endif;?> |
|
</div> |
|
<?php endforeach;?> |
|
<input class="btn btn-primary" type="submit" value="Salva configurazione"> |
|
</form> |
|
</div> |
|
</div> |
|
<?php |
|
$concrete_integrazione->afterBody(); |
|
include_once ($beRoot . "/layout/bottom.php"); |
|
} |
|
http_response_code(401);
|