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.
83 righe
3.3 KiB
83 righe
3.3 KiB
<? |
|
if (isset($this->id)) { |
|
if ($this->modal) { |
|
ob_start(); |
|
foreach($this->types AS $type => $info) { |
|
if (isset($this->alerts[$type])) { |
|
?><span class='bg-<?= $info["color-class"] ?> text-white p-1'><span class='<?= $info["icon"] ?>'></span> <?= count($this->alerts[$type]); ?></span><? |
|
} |
|
} |
|
$buttonLabel = ob_get_clean(); |
|
?> |
|
<script> |
|
$("#alertManagerModalButton<?= $this->id ?>").removeClass("d-none"); |
|
$("#alertManagerBadge<?= $this->id ?>").html("<?= $buttonLabel ?>"); |
|
</script> |
|
<div id="alertManagerModal<?= $this->id ?>" class="modal fade" tabindex="-1" aria-labelledby="alertsModalLabel<?= $this->id ?>" aria-hidden="true"> |
|
<div class="modal-dialog modal-lg"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<h5 class="modal-title" id="alertsModalLabel<?= $this->id ?>"><?= __("Avvisi") ?></h5> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<div class="modal-body"> |
|
<? } ?> |
|
<ul class="nav nav-pills mb-2" role="tablist"> |
|
<? |
|
$active = "active"; |
|
foreach($this->types AS $type => $info) { |
|
if (isset($this->alerts[$type])) { |
|
?> |
|
<li role="presentation" class="nav-item"> |
|
<a href="#alerts<?= $this->id ?>-<?= $type ?>" |
|
class="nav-link <?= $active ?>" aria-controls="alerts<?= $this->id ?>-<?= $type ?>" role="tab" data-toggle="tab"> |
|
<span class="<?= $info["icon"] ?>"></span> |
|
<?= __($info["label"]) ?> |
|
<span class="badge"><?= count($this->alerts[$type]) ?></span> |
|
</a> |
|
</li> |
|
<? |
|
$active = ""; |
|
} |
|
} |
|
?> |
|
</ul> |
|
<div class="tab-content"> |
|
<? |
|
$active = "active"; |
|
foreach($this->types AS $type => $info) { |
|
if (isset($this->alerts[$type])) { |
|
?> |
|
<div role="tabpanel" class="tab-pane <?= $active ?>" id="alerts<?= $this->id ?>-<?= $type ?>"> |
|
<? |
|
foreach($this->alerts[$type] AS $msg) { |
|
?> |
|
<? if (!empty($msg["href"])) { ?> |
|
<a href="<?= $msg["href"] ?>" title="<?= __("Modifica") ?>"> |
|
<? } ?> |
|
<div class="alert mb-1 alert-<?= $info["color-class"] ?> clear-fix"> |
|
<span class="<?= $info["icon"] ?>"></span> |
|
<?= $msg["text"] ?> |
|
</div> |
|
<? if (!empty($msg["href"])) { ?> |
|
</a> |
|
<? |
|
} |
|
} |
|
?> |
|
</div> |
|
<? |
|
$active = ""; |
|
} |
|
} |
|
?> |
|
</div> |
|
<? if ($this->modal) { ?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? } |
|
} ?>
|