<?php
maj::bashFetch();
$checkMaintenance = debug::isFile("maintenance");
$checkDebug = debug::isFile("debug");
?>

<header class="d-flex flex-column flex-md-row align-items-md-center p-3 bg-light ">
    <h2 class="bd-title" id="content">
        <span>Administration : Paramètres</span>
    </h2>
</header>
<?php
echo core::filAriane(array(
    "current" => "Paramètres",
    "arbo" => array(
        "Administration" => NULL,
        "Paramètres" => "/parametres.html"
    )
));
?>

<ul class="nav nav-tabs" id="tab-parametres" role="tablist" style="margin-bottom:20px;">
    <li><a class="nav-link active" href="#parametres-general">Général</a></li>
    <li><a class="nav-link" href="#parametres-restore">Backup & restauration</a></li>
    <li><a class="nav-link" href="#parametres-debug">Debug & développement</a></li>
</ul>

<div class="tab-content">
    <div id="parametres-general" class="tab-pane fade in active show">
        <?php get::page("parametres-general") ?>
    </div>
    <div id="parametres-restore" class="tab-pane fade">
        <?php get::page("parametres-restore") ?>
    </div>
    <div id="parametres-debug" class="tab-pane fade">
        <?php get::page("parametres-debug") ?>
    </div>
</div>


<script>
$(document).ready(function(){

    var fragment = window.location.hash;
    var tmpOnglet = fragment ? fragment.substring(1) : '';
    var onglet = "#" + tmpOnglet;

    if (tmpOnglet !== "" && $(onglet).length) {
        $('#tab-parametres a[href="' + onglet + '"]').tab('show');
    }

    $("#tab-parametres a").click(function(){
        $(this).tab('show');
    });
    $('#tab-parametres a').on('shown.bs.tab', function(event){
        var x = $(event.target).text();
        var y = $(event.relatedTarget).text();
    });
});
</script>

<style>
    h4 {
        margin-top: 15px;
    }

    .element-parametres {
        margin-top: 5px;
    }

    .modal-body {
        position: relative;
        overflow-y: auto;
        max-height: 400px;
        padding: 15px;
    }

    .modal-dialog{
        width: 1005px !important;
    }

    .modal {
        --bs-modal-width: none;
    }

    .autoModal.modal .modal-body {
        max-height: 100%;
    }
</style>