<?php

/*
 * Squelette : ../plugins/auto/saisies/v3.41.3/saisies/selection.html
 * Date :      Thu, 25 Jun 2020 04:48:00 GMT
 * Compile :   Thu, 09 Jul 2020 08:18:40 GMT
 * Boucles :   _recursive, _cond, _selection
 */ 

function BOUCLE_recursivehtml_f9dc5a69456f1120699b793adfa349f4(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$save_numrows = (isset($Numrows['_selection']) ? $Numrows['_selection'] : array());
	$t0 = BOUCLE_selectionhtml_f9dc5a69456f1120699b793adfa349f4($Cache, $Pile, $doublons, $Numrows, $SP);
	$Numrows['_selection'] = ($save_numrows);
	return $t0;
}


function BOUCLE_condhtml_f9dc5a69456f1120699b793adfa349f4(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	if (!isset($si_init)) { $command['si'] = array(); $si_init = true; }
	$command['si'][] = interdire_scripts(is_array($Pile[$SP]['valeur']));

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_cond';
		$command['from'] = array();
		$command['type'] = array();
		$command['groupby'] = array();
		$command['select'] = array("1");
		$command['orderby'] = array();
		$command['where'] = 
			array();
		$command['join'] = array();
		$command['limit'] = '';
		$command['having'] = 
			array();
	}
	if (defined("_BOUCLE_PROFILER")) $timer = time()+(float)microtime();
	$t0 = "";
	// REQUETE
	$iter = IterFactory::create(
		"CONDITION",
		$command,
		array('../plugins/auto/saisies/v3.41.3/saisies/selection.html','html_f9dc5a69456f1120699b793adfa349f4','_cond',49,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
		' .
vide($Pile['vars'][$_zzz=(string)'data'] = interdire_scripts($Pile[$SP-1]['valeur'])) .
BOUCLE_recursivehtml_f9dc5a69456f1120699b793adfa349f4($Cache, $Pile, $doublons, $Numrows, $SP) .
'
	');
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+(float)microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_cond @ ../plugins/auto/saisies/v3.41.3/saisies/selection.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


function BOUCLE_selectionhtml_f9dc5a69456f1120699b793adfa349f4(&$Cache, &$Pile, &$doublons, &$Numrows, $SP) {

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['source'] = array(table_valeur($Pile["vars"], (string)'data', null));
	$command['sourcemode'] = 'table';
	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_selection';
		$command['from'] = array();
		$command['type'] = array();
		$command['groupby'] = array();
		$command['select'] = array(".valeur",
		".cle");
		$command['orderby'] = array();
		$command['where'] = 
			array();
		$command['join'] = array();
		$command['limit'] = '';
		$command['having'] = 
			array();
	}
	if (defined("_BOUCLE_PROFILER")) $timer = time()+(float)microtime();
	$t0 = "";
	// REQUETE
	$iter = IterFactory::create(
		"DATA",
		$command,
		array('../plugins/auto/saisies/v3.41.3/saisies/selection.html','html_f9dc5a69456f1120699b793adfa349f4','_selection',48,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
	' .
(($t1 = BOUCLE_condhtml_f9dc5a69456f1120699b793adfa349f4($Cache, $Pile, $doublons, $Numrows, $SP))!=='' ?
		((	'
	<optgroup label="' .
		interdire_scripts($Pile[$SP]['cle']) .
		'">
	') . $t1 . '
	</optgroup>
	') :
		((	'
	<option value="' .
	interdire_scripts($Pile[$SP]['cle']) .
	'"' .
	(($t2 = strval(interdire_scripts(((($Pile[$SP]['cle'] == table_valeur($Pile["vars"], (string)'valeur', null))) ?' ' :''))))!=='' ?
			($t2 . ((strlen(table_valeur($Pile["vars"], (string)'valeur', null)))  ?
				(' ' . 'selected="selected"') :
				'')) :
			'') .
	(($t2 = strval(interdire_scripts(((in_any($Pile[$SP]['cle'],table_valeur($Pile["vars"], (string)'disabled', null))) ?' ' :''))))!=='' ?
			($t2 . ' disabled="disabled"') :
			'') .
	'>' .
	interdire_scripts($Pile[$SP]['valeur']) .
	'</option>
	'))) .
'
');
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+(float)microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_selection @ ../plugins/auto/saisies/v3.41.3/saisies/selection.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}

//
// Fonction principale du squelette ../plugins/auto/saisies/v3.41.3/saisies/selection.html
// Temps de compilation total: 16.728 ms
//

function html_f9dc5a69456f1120699b793adfa349f4($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) {

	if (isset($Pile[0]["doublons"]) AND is_array($Pile[0]["doublons"]))
		$doublons = nettoyer_env_doublons($Pile[0]["doublons"]);

	$connect = '';
	$page = (
'


' .
vide($Pile['vars'][$_zzz=(string)'data'] = interdire_scripts(saisies_chaine2tableau(sinon(table_valeur(@$Pile[0], (string)'data', null), interdire_scripts(table_valeur(@$Pile[0], (string)'datas', null)))))) .
'
' .
vide($Pile['vars'][$_zzz=(string)'valeur'] = interdire_scripts((is_null(entites_html(table_valeur(@$Pile[0], (string)'valeur_forcee', null),true)) ? interdire_scripts((is_null(entites_html(table_valeur(@$Pile[0], (string)'valeur', null),true)) ? interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'defaut', null),true)):interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'valeur', null),true)))):interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'valeur_forcee', null),true))))) .
vide($Pile['vars'][$_zzz=(string)'disabled'] = array()) .
(($t1 = strval(interdire_scripts(((strlen(entites_html(table_valeur(@$Pile[0], (string)'disable_choix', null),true))) ?' ' :''))))!=='' ?
		($t1 . (	' ' .
	vide($Pile['vars'][$_zzz=(string)'disabled'] = interdire_scripts(filtre_explode_dist(entites_html(table_valeur(@$Pile[0], (string)'disable_choix', null),true),','))))) :
		'') .
'

<select ' .
(('')  ?
		(' ' . (($t2 = strval(interdire_scripts((((((entites_html(table_valeur(@$Pile[0], (string)'obligatoire', null),true)) AND (interdire_scripts((entites_html(table_valeur(@$Pile[0], (string)'obligatoire', null),true) != 'non')))) ?' ' :'')) ?' ' :''))))!=='' ?
			($t2 . ' required="required"') :
			'')) :
		'') .
' name="' .
interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'nom', null),true)) .
'" id="champ_' .
interdire_scripts(saisie_nom2classe(entites_html(sinon(table_valeur(@$Pile[0], (string)'id', null), interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'nom', null),true))),true))) .
'"' .
(($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'class', null),true))))!=='' ?
		(' class="' . $t1 . '"') :
		'') .
(($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'disable', null),true))))!=='' ?
		(' disabled="' . $t1 . '"') :
		'') .
(($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'size', null),true))))!=='' ?
		(' size="' . $t1 . '"') :
		'') .
(($t1 = strval(interdire_scripts(table_valeur(@$Pile[0], (string)'attributs', null))))!=='' ?
		(' ' . $t1) :
		'') .
'>

' .
(($t1 = strval(interdire_scripts(((entites_html(table_valeur(@$Pile[0], (string)'cacher_option_intro', null),true)) ?'' :' '))))!=='' ?
		($t1 . (	'<option value="">' .
	interdire_scripts(entites_html(table_valeur(@$Pile[0], (string)'option_intro', null),true)) .
	'</option>')) :
		'') .
'
' .
BOUCLE_selectionhtml_f9dc5a69456f1120699b793adfa349f4($Cache, $Pile, $doublons, $Numrows, $SP) .
'
</select>
');

	return analyse_resultat_skel('html_f9dc5a69456f1120699b793adfa349f4', $Cache, $page, '../plugins/auto/saisies/v3.41.3/saisies/selection.html');
}
?>