<?php

/*
 * Squelette : plugins/ckeditor-spip-plugin/spiplinks-json.html
 * Date :      Fri, 03 Jul 2020 11:43:34 GMT
 * Compile :   Thu, 27 Jul 2023 09:35:31 GMT
 * Boucles :   _si
 */ 

function BOUCLE_sihtml_558b1d85360ae0c9e5c311d0cb98c96c(&$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/spiplinks-json.html','html_558b1d85360ae0c9e5c311d0cb98c96c','_si',3,$GLOBALS['spip_lang'])
	);
	if (!$iter->err()) {
	
	$l1 = _T('ckeditor:type_article');
	$l2 = _T('ckeditor:label_section');
	$l3 = _T('ckeditor:label_article');
	$l4 = _T('ckeditor:type_breve');
	$l5 = _T('ckeditor:label_section');
	$l6 = _T('ckeditor:label_breve');
	$l7 = _T('ckeditor:type_section');
	$l8 = _T('ckeditor:label_section');
	$l9 = _T('ckeditor:type_mot');
	$l10 = _T('ckeditor:label_groupe_mots');
	$l11 = _T('ckeditor:label_mot');
	$l12 = _T('ckeditor:type_auteur');
	$l13 = _T('ckeditor:label_auteur');$SP++;
	// RESULTATS
	while ($Pile[$SP]=$iter->fetch()) {

		$t0 .= (
'
{
	"article":{
		"label":"' .
$l1 .
'",
		"selectCategorie":"?page=rubriques-links-json",
		"nomCategorie":"' .
$l2 .
'",
		"selectItem":"?page=articles-links-json&id_rubrique=",
		"nomItem":"' .
$l3 .
'"
	},

	"breve":{
		"label":"' .
$l4 .
'",
		"selectCategorie":"?page=rubriques-links-json",
		"nomCategorie":"' .
$l2 .
'",
		"selectItem":"?page=breves-links-json&id_rubrique=",
		"nomItem":"' .
$l6 .
'"
	},

	"rubrique":{
		"label":"' .
$l7 .
'",
		"selectCategorie":"?page=rubriques-links-json",
		"nomCategorie":"' .
$l2 .
'"
	},

	"mot":{
		"label":"' .
$l9 .
'",
		"selectCategorie":"?page=groupemots-links-json",
		"nomCategorie":"' .
$l10 .
'",
		"selectItem":"?page=mots-links-json&id_groupe=",
		"nomItem":"' .
$l11 .
'"
	},

	"auteur":{
		"label":"' .
$l12 .
'",
		"selectCategorie":"?page=auteurs-links-json",
		"nomCategorie":"' .
$l13 .
'"
	}
}
');
	}
	$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/spiplinks-json.html","profiler"._LOG_AVERTISSEMENT);
	return $t0;
}

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

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

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