<?php

/*
 * Squelette : plugins/ckeditor-spip-plugin/spiptags-json.html
 * Date :      Fri, 03 Jul 2020 11:43:34 GMT
 * Compile :   Thu, 09 Jul 2020 06:53:55 GMT
 * Boucles :   _valeurs, _si2, _params, _tags, _si
 */ 

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

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['source'] = array(interdire_scripts(preg_split(eval('return '.'"~\\s*;;\\s*~"'.';'),table_valeur(table_valeur($Pile["vars"], (string)'param_valeurs', null),interdire_scripts($Pile[$SP-1]['cle'])))));
	$command['sourcemode'] = 'table';
	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_valeurs';
		$command['from'] = array();
		$command['type'] = array();
		$command['groupby'] = array();
		$command['select'] = array(".valeur");
		$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/ckeditor-spip-plugin/spiptags-json.html','html_9319ed25ca650492a9978b4e67fe7711','_valeurs',26,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	
	// COMPTEUR
	$Numrows['_valeurs']['compteur_boucle'] = 0;
	$Numrows['_valeurs']['total'] = @intval($iter->count());
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$Numrows['_valeurs']['compteur_boucle']++;
		$t0 .= (
'
			' .
interdire_scripts(json_encode($Pile[$SP]['valeur'])) .
(($Numrows['_valeurs']['compteur_boucle'] != $Numrows['_valeurs']['total']) ? ',':''));
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+(float)microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_valeurs @ plugins/ckeditor-spip-plugin/spiptags-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


function BOUCLE_si2html_9319ed25ca650492a9978b4e67fe7711(&$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'][] = (strlen(table_valeur(table_valeur($Pile["vars"], (string)'param_valeurs', null),interdire_scripts($Pile[$SP]['cle']))) != '0');

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_si2';
		$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/ckeditor-spip-plugin/spiptags-json.html','html_9319ed25ca650492a9978b4e67fe7711','_si2',25,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
			' .
BOUCLE_valeurshtml_9319ed25ca650492a9978b4e67fe7711($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_si2 @ plugins/ckeditor-spip-plugin/spiptags-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


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

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['source'] = array(table_valeur($Pile["vars"], (string)'param_noms', null));
	$command['sourcemode'] = 'table';
	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_params';
		$command['from'] = array();
		$command['type'] = array();
		$command['groupby'] = array();
		$command['select'] = array(".cle",
		".valeur");
		$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/ckeditor-spip-plugin/spiptags-json.html','html_9319ed25ca650492a9978b4e67fe7711','_params',20,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	
	// COMPTEUR
	$Numrows['_params']['compteur_boucle'] = 0;
	$Numrows['_params']['total'] = @intval($iter->count());
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$Numrows['_params']['compteur_boucle']++;
		$t0 .= (
'
			' .
vide($Pile['vars'][$_zzz=(string)'infoparam'] = table_valeur(table_valeur($Pile["vars"], (string)'param_ids', null),interdire_scripts($Pile[$SP]['cle']))) .
vide($Pile['vars'][$_zzz=(string)'delim'] = (table_valeur($Pile["vars"], (string)'infoparam', null) ? '|':'')) .
vide($Pile['vars'][$_zzz=(string)'val'] = interdire_scripts(concat($Pile[$SP]['valeur'],table_valeur($Pile["vars"], (string)'delim', null),table_valeur($Pile["vars"], (string)'infoparam', null)))) .
json_encode(table_valeur($Pile["vars"], (string)'val', null)) .
':[
		' .
BOUCLE_si2html_9319ed25ca650492a9978b4e67fe7711($Cache, $Pile, $doublons, $Numrows, $SP) .
'
			]' .
(($Numrows['_params']['compteur_boucle'] != $Numrows['_params']['total']) ? ',':''));
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+(float)microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_params @ plugins/ckeditor-spip-plugin/spiptags-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


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

	static $command = array();
	static $connect;
	$command['connect'] = $connect = '';
	$command['source'] = array(interdire_scripts((include_spip('inc/config')?lire_config('ckeditor/tags',null,false):'')));
	$command['sourcemode'] = 'table';
	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_tags';
		$command['from'] = array();
		$command['type'] = array();
		$command['groupby'] = array();
		$command['select'] = array(".cle",
		".valeur");
		$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/ckeditor-spip-plugin/spiptags-json.html','html_9319ed25ca650492a9978b4e67fe7711','_tags',4,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	
	// COMPTEUR
	$Numrows['_tags']['compteur_boucle'] = 0;
	$Numrows['_tags']['total'] = @intval($iter->count());
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$Numrows['_tags']['compteur_boucle']++;
		$t0 .= (
'
' .
vide($Pile['vars'][$_zzz=(string)'modele'] = interdire_scripts(replace($Pile[$SP]['cle'],'xx$'))) .
vide($Pile['vars'][$_zzz=(string)'type_modele'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'type'))) .
vide($Pile['vars'][$_zzz=(string)'type_num'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'nombre'))) .
vide($Pile['vars'][$_zzz=(string)'intitule'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'intitule'))) .
vide($Pile['vars'][$_zzz=(string)'info'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'info'))) .
vide($Pile['vars'][$_zzz=(string)'param_noms'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'noms'))) .
vide($Pile['vars'][$_zzz=(string)'param_valeurs'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'valeurs'))) .
vide($Pile['vars'][$_zzz=(string)'param_ids'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'ids'))) .
vide($Pile['vars'][$_zzz=(string)'fermante'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'fermante'))) .
vide($Pile['vars'][$_zzz=(string)'syntaxe'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'syntaxe'))) .
vide($Pile['vars'][$_zzz=(string)'echappe_car'] = interdire_scripts(table_valeur($Pile[$SP]['valeur'],'echappe_car'))) .
'[
		' .
interdire_scripts(json_encode($Pile[$SP]['cle'])) .
',
		' .
json_encode(table_valeur($Pile["vars"], (string)'intitule', null)) .
',
		' .
json_encode(table_valeur($Pile["vars"], (string)'info', null)) .
',
		{' .
BOUCLE_paramshtml_9319ed25ca650492a9978b4e67fe7711($Cache, $Pile, $doublons, $Numrows, $SP) .
'
		}, 
		' .
json_encode(table_valeur($Pile["vars"], (string)'type_num', null)) .
',
		' .
json_encode(table_valeur($Pile["vars"], (string)'type_modele', null)) .
',
		' .
json_encode((table_valeur($Pile["vars"], (string)'fermante', null) ? '1':'0')) .
',
		' .
json_encode(table_valeur($Pile["vars"], (string)'syntaxe', null)) .
',
		' .
json_encode(table_valeur($Pile["vars"], (string)'echappe_car', null)) .
'
	]' .
(($Numrows['_tags']['compteur_boucle'] != $Numrows['_tags']['total']) ? ',':''));
	}
	$iter->free();
	}
	if (defined("_BOUCLE_PROFILER")
	AND 1000*($timer = (time()+(float)microtime())-$timer) > _BOUCLE_PROFILER)
		spip_log(intval(1000*$timer)."ms BOUCLE_tags @ plugins/ckeditor-spip-plugin/spiptags-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}


function BOUCLE_sihtml_9319ed25ca650492a9978b4e67fe7711(&$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(invalideur_session($Cache, (table_valeur($GLOBALS["visiteur_session"], (string)'statut', null) < '2')));

	if (!isset($command['table'])) {
		$command['table'] = '';
		$command['id'] = '_si';
		$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/ckeditor-spip-plugin/spiptags-json.html','html_9319ed25ca650492a9978b4e67fe7711','_si',3,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
[' .
BOUCLE_tagshtml_9319ed25ca650492a9978b4e67fe7711($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_si @ plugins/ckeditor-spip-plugin/spiptags-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}

//
// Fonction principale du squelette plugins/ckeditor-spip-plugin/spiptags-json.html
// Temps de compilation total: 9.792 ms
//

function html_9319ed25ca650492a9978b4e67fe7711($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 = (
'<'.'?php header("X-Spip-Cache: 0"); ?'.'>'.'<'.'?php header("Cache-Control: no-cache, must-revalidate"); ?'.'><'.'?php header("Pragma: no-cache"); ?'.'>' .
'<'.'?php header(' . _q((	'Content-type: application/json' .
	(($t2 = strval(interdire_scripts($GLOBALS['meta']['charset'])))!=='' ?
			('; charset=' . $t2) :
			''))) . '); ?'.'>
' .
BOUCLE_sihtml_9319ed25ca650492a9978b4e67fe7711($Cache, $Pile, $doublons, $Numrows, $SP) .
'
');

	return analyse_resultat_skel('html_9319ed25ca650492a9978b4e67fe7711', $Cache, $page, 'plugins/ckeditor-spip-plugin/spiptags-json.html');
}
?>