<?php

/*
 * Squelette : ../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html
 * Date :      Wed, 23 Dec 2015 12:09:00 GMT
 * Compile :   Fri, 15 Jul 2016 07:46:30 GMT
 * Boucles :   _saisies, _objets, _si_extras
 */ 

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

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['sourcemode'] = 'tableau';

	$command['source'] = array(interdire_scripts(safehtml($Pile[$SP]['valeur'])));

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_saisies';
		$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()+microtime();
	$t0 = "";
	// REQUETE
	$iter = IterFactory::create(
		"DATA",
		$command,
		array('../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html','html_c081cbe2707166c2ad1aecd2344efb29','_saisies',19,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$Numrows['_saisies']['total'] = @intval($iter->count());
	
	$l1 = _T('iextras:action_associer');
	$l2 = _T('iextras:action_associer_title');
	$l3 = _T('iextras:action_supprimer');
	$l4 = _T('iextras:supprimer_reelement');
	$l5 = _T('iextras:action_supprimer_title');$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
					<li class=\'item' .
((($Numrows['_saisies']['total'] == '1'))  ?
		(' ' . 'solo') :
		'') .
'\'>
						<span title="' .
interdire_scripts(attribut_html(safehtml($Pile[$SP]['valeur']))) .
'">
							' .
interdire_scripts(safehtml($Pile[$SP]['cle'])) .
'
						</span>
						' .
bouton_action((	(($t2 = strval(interdire_scripts(filtrer('image_graver',filtrer('image_reduire',chemin_image('formulaire-enregistrer-16'),'12')))))!=='' ?
			($t2 . ' ') :
			'') .
	$l1),invalideur_session($Cache, generer_action_auteur('iextras',(($t3 = strval(interdire_scripts(invalideur_session($Cache, safehtml($Pile[$SP]['cle'])))))!=='' ?
				((	'associer_champ/' .
			interdire_scripts(invalideur_session($Cache, safehtml($Pile[$SP-1]['cle']))) .
			'/') . $t3) :
				''),invalideur_session($Cache, self()))),'link associer','',$l2) .
'
						' .
bouton_action((	(($t2 = strval(interdire_scripts(filtrer('image_graver',filtrer('image_reduire',chemin_image('formulaire-annuler-16'),'12')))))!=='' ?
			($t2 . ' ') :
			'') .
	$l3),invalideur_session($Cache, generer_action_auteur('iextras',(($t3 = strval(interdire_scripts(invalideur_session($Cache, safehtml($Pile[$SP]['cle'])))))!=='' ?
				((	'supprimer_champ/' .
			interdire_scripts(invalideur_session($Cache, safehtml($Pile[$SP-1]['cle']))) .
			'/') . $t3) :
				''),invalideur_session($Cache, self()))),'link supprimer',$l4,$l5) .
'
					</li>
				');
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_saisies @ ../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


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

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['sourcemode'] = 'tableau';

	$command['source'] = array(extras_champs_utilisables(''));

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_objets';
		$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()+microtime();
	$t0 = "";
	// REQUETE
	$iter = IterFactory::create(
		"DATA",
		$command,
		array('../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html','html_c081cbe2707166c2ad1aecd2344efb29','_objets',3,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
		<tr>
			<td>
				' .
filtre_icone_horizontale_dist('',interdire_scripts(_T(table_valeur(lister_tables_objets_sql(safehtml($Pile[$SP]['cle'])),'texte_objets'))),(	interdire_scripts(table_valeur(lister_tables_objets_sql(safehtml($Pile[$SP]['cle'])),'type')) .
	' ')) .
'
			</td>
			<td>
			' .
(($t1 = BOUCLE_saisieshtml_c081cbe2707166c2ad1aecd2344efb29($Cache, $Pile, $doublons, $Numrows, $SP))!=='' ?
		('
				<ul class=\'saisies_objet\'>
				' . $t1 . '
				</ul>
			') :
		'') .
'
			</td>
		</tr>
		');
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_objets @ ../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


function BOUCLE_si_extrashtml_c081cbe2707166c2ad1aecd2344efb29(&$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'][] = extras_champs_utilisables('');

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_si_extras';
		$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()+microtime();
	$t0 = "";
	// REQUETE
	$iter = IterFactory::create(
		"CONDITION",
		$command,
		array('../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html','html_c081cbe2707166c2ad1aecd2344efb29','_si_extras',1,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	
	$l1 = _T('iextras:liste_des_extras_possibles');
	$l2 = _T('iextras:label_table');
	$l3 = _T('iextras:champs_extras');$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
' .
boite_ouvrir($l1, 'simple') .
'
' .
(($t1 = BOUCLE_objetshtml_c081cbe2707166c2ad1aecd2344efb29($Cache, $Pile, $doublons, $Numrows, $SP))!=='' ?
		((	'
<div class=\'champs_extras_objets\'>
	<table>
		<thead>
			<tr>
				<th>' .
		$l2 .
		'</th>
				<th>' .
		$l3 .
		'</th>
			</tr>
		</thead>
		<tbody>
		') . $t1 . '
		</tbody>
	</table>
</div>
') :
		'') .
'
' .
boite_fermer() .
'
');
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_si_extras @ ../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}

//
// Fonction principale du squelette ../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html
// Temps de compilation total: 1.894 ms
//

function html_c081cbe2707166c2ad1aecd2344efb29($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 = (
BOUCLE_si_extrashtml_c081cbe2707166c2ad1aecd2344efb29($Cache, $Pile, $doublons, $Numrows, $SP) .
'
');

	return analyse_resultat_skel('html_c081cbe2707166c2ad1aecd2344efb29', $Cache, $page, '../plugins/champs_extras3_interface/champs_extras3_interface/prive/objets/contenu/champs_extras_possibles.html');
}
?>