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.
115 righe
5.8 KiB
115 righe
5.8 KiB
<? |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->gerarchia < 100) { |
|
$moduli = $_SESSION["utente"]->moduliDisponibili(); |
|
ob_start(); |
|
?> |
|
<div id="main-tools" class="collapse tools text-secondary p-sm-5"> |
|
<div class="container-fluid"> |
|
<div class="row py-3"> |
|
<div class="col-12"> |
|
<div class="float-right"> |
|
<? if ($_SESSION["utente"]->isSupportoOrRoot()) { |
|
if ($_SESSION["utente"]->hasSuperPowers()) { |
|
?> |
|
<button onclick="elimina(<?= $_SESSION["utente"]->codice ?>,'utenti/ascend');" class="ignore-lock btn btn-sm btn-warning"> |
|
<span class="fa fa-clock fa-spin"></span> |
|
<?= __("Blocca modifiche") ?> (<span id="superPowersButtonLabel"><?= $_SESSION["utente"]->superPowers - time() ?></span> <?= __("secondi rimanenti") ?>) |
|
</button> |
|
<script> |
|
var countDown = setInterval(function() { |
|
$("#superPowersButtonLabel").html(parseInt($("#superPowersButtonLabel").html()) - 1); |
|
},1000) |
|
</script> |
|
<? |
|
} else { ?> |
|
<button class="btn btn-sm btn-danger ignore-lock" onclick="showModalWithURL('/backend/utenti/ascend/form.php')"> |
|
<span class="fa fa-unlock"></span> <?= __("Richiedi sblocco modifiche") ?> |
|
</button> |
|
<? } |
|
} |
|
DGUE::printUploadButton() ?> |
|
</div> |
|
<h4 class="card-title text-white"><?= strtoupper(__("strumenti")) ?></h4> |
|
</div> |
|
</div> |
|
<? |
|
if(! empty($moduli)) { |
|
?><div class="flex-row d-md-flex py-3"><? |
|
$types = Modulo::getTipologie(); |
|
$tools_array = $tmpTools = []; |
|
foreach($types AS $tipologia => $tipo) { |
|
if (!empty($moduli[$tipologia])) { |
|
$tools = $moduli[$tipologia]; |
|
$style = []; |
|
$style["container"] = $style["tool"] = ""; |
|
if(! empty($tipo["style-container"]) && is_array($tipo["style-container"])) { |
|
foreach($tipo["style-container"] as $property => $value) { |
|
$style["container"] .= "{$property}: {$value};"; |
|
} |
|
} |
|
if(! empty($tipo["style-tool"]) && is_array($tipo["style-tool"])) { |
|
foreach($tipo["style-tool"] as $property => $value) { |
|
$style["tool"] .= "{$property}: {$value};"; |
|
} |
|
} |
|
?> |
|
<div class="col-12 flex-md-fill text-center"> |
|
<div class="mx-1 pb-2" style="<?= $style["container"] ?>"> |
|
<?if (!empty($tipo["icon"])) { echo "<span class='".$tipo["icon"]." fa-2x'></span>"; } ?><br> |
|
<strong><?= __($tipo["titolo"]) ?></strong> |
|
</div> |
|
<ul class="list-group list-group-flush"> |
|
<? |
|
$sth = $pdo->prepare("SELECT * FROM b_tools_preferiti WHERE codice_utente = :codice_utente AND id_modulo = :id_modulo "); |
|
$sth->bindValue(':codice_utente', $_SESSION["utente"]->codice); |
|
uasort($tools, function($a, $b) { |
|
return $a['titolo'] <=> $b['titolo']; |
|
}); |
|
foreach ($tools as $id_tool => $tool) { |
|
if ($tool["completed"] != "N") { |
|
$active = false; |
|
$tool["preferito"] = 0; |
|
$sth->bindValue(':id_modulo', $id_tool); |
|
$sth->execute(); |
|
if($sth->rowCount() == 1) { $tool["preferito"] = 1; } |
|
if ($radice == $id_tool) { $active = true; } |
|
?> |
|
<li class="list-group-item d-flex<?= $active ? ' active' : null ?>"> |
|
<a href="/backend/<?= $id_tool ?>/" title="<?= $tool["descrizione"] ?>" style="<?= $style["tool"] ?>" class="w-100 text-left"> |
|
<?if (!empty($tool["icon"])) { echo "<span class='".$tool["icon"]."'></span>"; } ?> |
|
<?= ($tool["completed"] == "N") ? "<del class='text-danger'>" : "" ?> |
|
<strong class="<?= ($tool["completed"] == "W" && $_SESSION["utente"]->gerarchia === 1) ? "text-warning" : "" ?>"><?= __($tool["titolo"]) ?></strong> |
|
<?= ($tool["completed"] == "N") ? "</del>" : "" ?> |
|
<? |
|
$rad_tool = $id_tool; |
|
if (strpos($id_tool,"ordini-")!==false) { $rad_tool = "ordini"; } |
|
if (strpos($id_tool,"network-")!==false) { $rad_tool = "network"; } |
|
if (file_exists("{$beRoot}/{$rad_tool}/badge.php")) { ?> |
|
<span class="badge-container" data-target="/<?= $rad_tool; ?>/badge.php"> |
|
<? include($beRoot."/". $rad_tool ."/badge.php"); ?> |
|
</span> |
|
<? } ?> |
|
</a> |
|
<button class="btn btn-sm ml-auto <?= ($tool["preferito"]) ? "text-warning" : "text-light" ?>" onclick="setPreferito('<?= $id_tool ?>')" id="star-<?= $id_tool ?>"><span class="fa fa-star"></span></button> |
|
</li> |
|
<? |
|
$tools_array[$id_tool] = $tool; |
|
} |
|
} |
|
?> |
|
</ul> |
|
</div> |
|
<? |
|
} |
|
} |
|
$tools = $tools_array; |
|
unset($tools_array); |
|
?></div><? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
$__layout_main_tools = ob_get_clean(); |
|
} |
|
?>
|
|
|