[(#AUTORISER{webmestre}|sinon_interdire_acces)]
<h1><:soyezcreateursprive:configurations_rapides_soyezcreateurs:></h1>
<p class="spip"><:soyezcreateursprive:ieconfig_import_spe:></p>
<?php
	$nom = _request('nom');
	$option = '#ENV{option}';
	if (isset($nom) and isset($option)) {
		include_spip('inc/soyezcreateurs_ieconfig');
		if(!preg_match('[.a-zA-Z0-9_/\]', $nom)) {
			$result = sc_ieconfig_importer_fichier($nom,$option);
		}
	}
?>

<ul class="spip">
<BOUCLE_Types(DATA)
  {source table,#LISTE{ecrase,fusion,fusion_inv}}>
<BOUCLE_repertoires(DATA){source ls, #CHEMIN{cfg_config}/#VALEUR/*.yaml}{par basename}>
	<li><a href="[(#SELF|parametre_url{nom,#FILE}|parametre_url{option,#_Types:VALEUR})]" class="confirmation">[(#FILE|yaml_decode_file|sc_import_nom)]</a></li>
</BOUCLE_repertoires>
</BOUCLE_Types>
</ul>

<?php
	if (isset($result)) {
		$ok = $result['message_ok'];
		echo "<p class=\"spip\">$ok ([(#ENV{nom})] | [(#ENV{option})])</p>";

	}
?>

<script type="text/javascript">
    var elems = document.getElementsByClassName('confirmation');
    var confirmIt = function (e) {
        if (!confirm('Are you sure?')) e.preventDefault();
    };
    for (var i = 0, l = elems.length; i < l; i++) {
        elems[i].addEventListener('click', confirmIt, false);
    }
</script>