Esempio n. 1
0
function inc_informer_dist($id, $col, $exclus, $rac, $type, $do = 'aff')
{
    include_spip('inc/texte');
    if ($type == "rubrique") {
        $row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = {$id}");
        if ($row) {
            $titre = typo($row["titre"]);
            $descriptif = propre($row["descriptif"]);
        } else {
            $titre = _T('info_racine_site');
        }
    } else {
        $titre = '';
    }
    $res = '';
    if ($type == "rubrique" and $GLOBALS['spip_display'] != 1 and isset($GLOBALS['meta']['image_process'])) {
        if ($GLOBALS['meta']['image_process'] != "non") {
            $chercher_logo = charger_fonction('chercher_logo', 'inc');
            if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
                list($fid, $dir, $nom, $format) = $res;
                include_spip('inc/filtres_images_mini');
                $res = image_reduire("<img src='{$fid}' alt='' />", 100, 48);
                if ($res) {
                    $res = "<div style='float: " . $GLOBALS['spip_lang_right'] . "; margin-" . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>{$res}</div>";
                }
            }
        }
    }
    $rac = spip_htmlentities($rac);
    # ce lien provoque la selection (directe) de la rubrique cliquee
    # et l'affichage de son titre dans le bandeau
    $titre = strtr(str_replace("'", "&#8217;", str_replace('"', "&#34;", textebrut($titre))), "\n\r", "  ");
    $js_func = $do . '_selection_titre';
    return "<div style='display: none;'>" . "<input type='text' id='" . $rac . "_sel' value='{$id}' />" . "<input type='text' id='" . $rac . "_sel2' value=\"" . entites_html($titre) . "\" />" . "</div>" . "<div class='informer' style='padding: 5px; border-top: 0px;'>" . (!$res ? '' : $res) . "<p><b>" . safehtml($titre) . "</b></p>" . (!$descriptif ? '' : "<div>" . safehtml($descriptif) . "</div>") . "<div style='text-align: " . $GLOBALS['spip_lang_right'] . ";'>" . "<input type='submit' class='fondo' value='" . _T('bouton_choisir') . "'\nonclick=\"{$js_func}('{$titre}',{$id},'selection_rubrique','id_parent'); return false;\" />" . "</div>" . "</div>";
}
Esempio n. 2
0
function  configuration_bloc_votre_site()
{
	$adresse_site = entites_html($GLOBALS['meta']["adresse_site"]);
	$nom_site = entites_html($GLOBALS['meta']["nom_site"]);
	$email_webmaster = entites_html($GLOBALS['meta']["email_webmaster"]);
	$descriptif_site = entites_html($GLOBALS['meta']["descriptif_site"]);

	return debut_cadre_relief("", true, "", "<label for='nom_site'>"._T('info_nom_site')."</label>".aide ("confnom"))
	. "<input type='text' name='nom_site' id='nom_site' value=\"$nom_site\" size='40' class='forml' />"
	. fin_cadre_relief(true)

	. debut_cadre_relief("", true, "", "<label for='adresse_site'>"._T('info_adresse_url')."</label>")
	. "<input type='text' name='adresse_site' id='adresse_site' value=\"$adresse_site/\" size='40' class='forml' />"
	. fin_cadre_relief(true)

	. debut_cadre_relief("", true, "","<label for='descriptif_site'>". _T('entree_description_site')."</label>")
	. "<textarea name='descriptif_site' id='descriptif_site' class='forml' rows='4' cols='40'>$descriptif_site</textarea>"
	. fin_cadre_relief(true)

	. "<div>&nbsp;</div>"
	
	. debut_cadre_relief("", true, "", "<label for='email_webmaster'>"._T('info_email_webmestre')."</label>")
	. "<input type='text' name='email_webmaster' id='email_webmaster' value=\"$email_webmaster\" size='40' class='formo' />"
	. fin_cadre_relief(true);
}
function html_f3666965c018303599bb64189cbac96c($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 = ' <div' . (($t1 = strval(interdire_scripts(entites_html(sinon(table_valeur(@$Pile[0], (string) 'divclass', null), 'spip-admin-bloc'), true)))) !== '' ? ' class="' . $t1 . '"' : '') . ' id=\'spip-admin\' dir="' . lang_dir(@$Pile[0]['lang'], 'ltr', 'rtl') . '">' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'analyser', null), true)))) !== '' ? '
	<a href="' . $t1 . ('" class="spip-admin-boutons"
		id="analyser">' . _T('public|spip|ecrire:analyse_xml') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'xhtml_error', null), true)))) !== '' ? ' (' . $t2 . ')' : '') . '</a>') : '') . '
	' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true) ? ' ' : ''))) !== '' ? $t1 . ('
		' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id_objet', null), true)))) !== '' ? '<a href="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) ('voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true))), null), true)) . '" class="spip-admin-boutons"
		id="voir_' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true)) . '">' . interdire_scripts(_T(objet_info(entites_html(table_valeur(@$Pile[0], (string) 'objet', null), true), 'texte_objet'))) . '
			(' . $t2 . ')</a>' : '') . '
	') : '') . '<!--extra-->' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'ecrire', null), true)))) !== '' ? '
	<a href="' . $t1 . ('" class="spip-admin-boutons"
		id="ecrire">' . _T('public|spip|ecrire:espace_prive') . '</a>') : '') . '
	<a href="' . parametre_url(self(), 'var_mode', interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'calcul', null), true))) . '" class="spip-admin-boutons"
		id="var_mode">' . _T('public|spip|ecrire:admin_recalculer') . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'use_cache', null), true)) . '</a>' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'preview', null), true)))) !== '' ? '
	<a href="' . $t1 . ('" class="spip-admin-boutons"
		id="preview">' . _T('public|spip|ecrire:previsualisation') . '</a>') : '') . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'debug', null), true)))) !== '' ? '
	<a href="' . $t1 . ('" class="spip-admin-boutons"
		id="debug">' . _T('public|spip|ecrire:admin_debug') . '</a>') : '') . '
</div>
';
    return analyse_resultat_skel('html_f3666965c018303599bb64189cbac96c', $Cache, $page, 'squelettes-dist/formulaires/administration.html');
}
function html_9d96364ed1d79895affe5b2e3d246085($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 = '<div class="formulaire_spip formulaire_ecrire_auteur ajax" id="formulaire_ecrire_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">
<br class=\'bugajaxie\' />
' . (($t1 = strval(interdire_scripts(table_valeur(@$Pile[0], (string) 'message_ok', null)))) !== '' ? '<p class="reponse_formulaire reponse_formulaire_ok">' . $t1 . '</p>' : '') . '
' . (($t1 = strval(interdire_scripts(table_valeur(@$Pile[0], (string) 'message_erreur', null)))) !== '' ? '<p class="reponse_formulaire reponse_formulaire_erreur">' . $t1 . '</p>' : '') . '
' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'editable', null), true)))) !== '' ? $t1 . ('
<form method=\'post\' action=\'' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true)) . '#formulaire_ecrire_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '\' enctype=\'multipart/form-data\'>
	
	' . '<div>' . form_hidden(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true))) . '<input name=\'formulaire_action\' type=\'hidden\'
		value=\'' . @$Pile[0]['form'] . '\' />' . '<input name=\'formulaire_action_args\' type=\'hidden\'
		value=\'' . @$Pile[0]['formulaire_args'] . '\' />' . (!empty($Pile[0]['_hidden']) ? @$Pile[0]['_hidden'] : '') . '</div>
	' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'previsu') ? ' ' : ''))) !== '' ? $t2 . ('
	<fieldset class="previsu">
		<legend>' . _T('public|spip|ecrire:previsualisation') . '</legend>
		<ul>
			<li><strong>' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'sujet_message_auteur', null), true)) . '</strong> - <em>' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'email_message_auteur', null), true)) . '</em></li>
			<li>' . interdire_scripts(nl2br(entites_html(table_valeur(@$Pile[0], (string) 'texte_message_auteur', null), true))) . '</li>
		</ul>
		<p class="boutons"><input type="submit" class="submit" name="confirmer" value="' . _T('public|spip|ecrire:form_prop_confirmer_envoi') . '" /></p>
	</fieldset>
	') : '') . '
	
	<fieldset>
		<legend>' . _T('public|spip|ecrire:envoyer_message') . '</legend>
		<ul class="editer-groupe">
			<li class=\'editer saisie_email_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'email_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'>
				<label for="email_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:entree_adresse_email') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label>
				' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'email_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . '
				<input' . (($t2 = strval('' ? 'required="required" type="email" class="text email"' : 'type="text" class="text"')) !== '' ? ' ' . $t2 : '') . ' name="email_message_auteur" id="email_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'email_message_auteur', null), true)) . '" size="30" />
			</li>
			<li class=\'editer saisie_sujet_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'sujet_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'>
				<label for="sujet_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:form_prop_sujet') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label>
				' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'sujet_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . '
				<input type="text" class="text" name="sujet_message_auteur" id="sujet_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'sujet_message_auteur', null), true)) . '" size="30"' . ' />
			</li>
			<li class=\'editer saisie_texte_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'texte_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'>
				<label for="texte_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:info_texte_message') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label>
				' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'texte_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . '
				<textarea name="texte_message_auteur" id="texte_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" rows="10" cols="60">' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'texte_message_auteur', null), true)) . '</textarea>
			</li>
		</ul>
	</fieldset>
	
	<p style="display: none;">
		<label for="nobot">' . _T('public|spip|ecrire:antispam_champ_vide') . '</label>
		<input type="text" class="text" name="nobot" id="nobot" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'nobot', null), true)) . '" size="10" />
	</p>
	<p class="boutons"><input type="submit" class="submit" name="valide" value="' . _T('public|spip|ecrire:form_prop_envoyer') . '" /></p>
</form>
') : '') . '
</div>
';
    return analyse_resultat_skel('html_9d96364ed1d79895affe5b2e3d246085', $Cache, $page, 'squelettes-dist/formulaires/ecrire_auteur.html');
}
function BOUCLE_documenthtml_b8a8020987dd01f8087ad24f961857eb(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    $in = array();
    if (!is_array($a = @$Pile[0]['mode'])) {
        $in[] = $a;
    } else {
        $in = array_merge($in, $a);
    }
    if (!isset($command['table'])) {
        $command['table'] = 'documents';
        $command['id'] = '_document';
        $command['from'] = array('documents' => 'spip_documents', 'L1' => 'spip_types_documents');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("documents.id_document", "L1.titre AS type_document", "documents.taille", "documents.mode", "documents.largeur", "documents.hauteur", "documents.titre", "L1.mime_type");
        $command['orderby'] = array();
        $command['join'] = array('L1' => array('documents', 'extension'));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(array('(documents.taille > 0 OR documents.distant=\'oui\')'), array('=', 'documents.id_document', sql_quote(@$Pile[0]['id_document'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')), !(is_array(@$Pile[0]['mode']) ? count(@$Pile[0]['mode']) : strlen(@$Pile[0]['mode'])) ? '' : (is_array(@$Pile[0]['mode']) ? sql_in('documents.mode', sql_quote($in)) : array('=', 'documents.mode', sql_quote(@$Pile[0]['mode'], '', 'varchar(10) NOT NULL DEFAULT \'document\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('plugins-dist/medias/modeles/img.html', 'html_b8a8020987dd01f8087ad24f961857eb', '_document', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            $t0 .= '

' . vide($Pile['vars'][$_zzz = (string) 'image'] = interdire_scripts(($a = match(entites_html(sinon(table_valeur(@$Pile[0], (string) 'mode_force', null), interdire_scripts($Pile[$SP]['mode'])), true), 'image|vignette') or is_string($a) and strlen($a)) ? $a : interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'embed', null), true)) ? ' ' : '')) . (($t1 = strval(table_valeur($Pile["vars"], (string) 'image', null))) !== '' ? $t1 . ('
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . ';\'' : '') . '>
' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true)))) !== '' ? '<a href="' . $t2 . ('"' . (($t3 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien_class', null), true)))) !== '' ? ' class="' . $t3 . '"' : '') . '>') : '') . '<img src=\'' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true))) . '\'' . (($t2 = strval(interdire_scripts($Pile[$SP]['largeur']))) !== '' ? ' width="' . $t2 . '"' : '') . (($t2 = strval(interdire_scripts($Pile[$SP]['hauteur']))) !== '' ? ' height="' . $t2 . '"' : '') . ' alt="' . interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '"' . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . ' />' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '</a>' : '') . '</span>
') : '') . (!table_valeur($Pile["vars"], (string) 'image', null) ? ' ' . ('
	' . vide($Pile['vars'][$_zzz = (string) 'fichier'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'src')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'width'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'width')) . '
	' . vide($Pile['vars'][$_zzz = (string) 'height'] = extraire_attribut(quete_logo_document(quete_document($Pile[$SP]['id_document'], ''), '', '', '', 0, 0, ''), 'height')) . '
<span class=\'spip_document_' . $Pile[$SP]['id_document'] . ' spip_documents' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true)))) !== '' ? ' spip_documents_' . $t2 : '') . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t2 : '') . ' spip_lien_ok\'' . (($t2 = strval(interdire_scripts(match(entites_html(table_valeur(@$Pile[0], (string) 'align', null), true), 'left|right')))) !== '' ? '
 style=\'float:' . $t2 . (';' . (($t3 = strval(table_valeur($Pile["vars"], (string) 'width', null))) !== '' ? ' width:' . $t3 . 'px;' : '') . '\'') : '') . '><a href="' . interdire_scripts(($a = entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) or is_string($a) and strlen($a)) ? $a : vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_document'], 'document', '', '', true)))) . '"' . (($t2 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lien', null), true) ? '' : 'type="' . interdire_scripts($Pile[$SP]['mime_type']) . '"'))) !== '' ? '
 ' . $t2 : '') . (($t2 = strval(interdire_scripts(texte_backend(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) !== '' ? ' title="' . $t2 . '"' : '') . '><img src=\'' . table_valeur($Pile["vars"], (string) 'fichier', null) . '\' width=\'' . table_valeur($Pile["vars"], (string) 'width', null) . '\' height=\'' . table_valeur($Pile["vars"], (string) 'height', null) . '\' alt=\'' . interdire_scripts(attribut_html(strlen(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) ? interdire_scripts(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])) . ' {' . interdire_scripts($Pile[$SP]['type_document']) . '}' : interdire_scripts($Pile[$SP]['type_document']))) . '\' /></a></span>
') : '');
        }
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_document @ plugins-dist/medias/modeles/img.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Esempio n. 6
0
function produire_image_math($tex) {
	global $traiter_math;
	switch ($traiter_math) {
		// Attention: mathml desactiv'e pour l'instant
		case 'mathml':
			$ext = '.xhtml';
			$server = $GLOBALS['mathml_server'];
			break;
		case 'tex':
			$ext = '.png';
			$server = $GLOBALS['tex_server'];
			break;
		default:
			return $tex;
	}

	// Regarder dans le repertoire local des images TeX et blocs MathML
	if (!@is_dir($dir_tex = _DIR_VAR.'cache-TeX/'))
		@mkdir ($dir_tex, _SPIP_CHMOD);
	$fichier = $dir_tex .md5(trim($tex)).$ext;
	

	if (!@file_exists($fichier)) {
		// Aller chercher l'image sur le serveur
		if ($server) {
			spip_log($url = $server.'?'.rawurlencode($tex));
			include_spip('inc/distant');
			recuperer_page($url,$fichier);
		}
	}


	// Composer la reponse selon presence ou non de l'image
	$tex = entites_html($tex);
	if (@file_exists($fichier)) {

		// MathML
		if ($traiter_math == 'mathml') {
			return join(file("$fichier"),"");
		}

		// TeX
		else {
			list(,,,$size) = @getimagesize($fichier);
			$alt = "alt=\"$tex\" title=\"$tex\""; 
			return "<img src=\"$fichier\" style=\"vertical-align:middle;\" $size $alt />";
		}

	}
	else // pas de fichier
		return "<tt><span class='spip_code' dir='ltr'>$tex</span></tt>";

}
Esempio n. 7
0
function afficher_textarea_barre($texte, $forum=false, $form='')
{
	global $spip_display, $spip_ecran;
	$rows = ($spip_ecran == "large") ? 28 : 15;
	
	$class = 'formo' . ($forum ? ' textarea_forum':'');
	return 
	  "<textarea name='texte' id='texte' "
	. " rows='$rows' class='$class' cols='40'>"
	. entites_html($texte)
	. "</textarea>\n";
}
Esempio n. 8
0
function inc_safehtml_dist($t) {
	static $process, $test;

	if (!$test) {
		$process = false;
		if ($f = find_in_path('lib/safehtml/classes')) {
			define('XML_HTMLSAX3', $f.'/');
			require_once XML_HTMLSAX3.'safehtml.php';
			$process = new safehtml();
			$process->deleteTags[] = 'param'; // sinon bug Firefox
		}
		if ($process)
			$test = 1; # ok
		else
			$test = -1; # se rabattre sur une fonction de securite basique
	}

	if ($test > 0) {
		# autoriser des trucs
		# ex: l'embed de youtube
		if (
		false !== strpos($t, 'iframe')) {
			foreach (extraire_balises($t, 'iframe') as $iframe) {
				if (preg_match(',^http://(www\.)?(youtube\.com|(player\.)?vimeo\.com)/.*,', extraire_attribut($iframe, 'src'))) {
					$re = '___IFRAME___'.md5($iframe);
					$ok[$re] = $iframe;
					$t = str_replace($iframe, $re, $t);
				}
			}
		}

		# reset ($process->clear() ne vide que _xhtml...),
		# on doit pouvoir programmer ca plus propremement
		$process->_counter = array();
		$process->_stack = array();
		$process->_dcCounter = array();
		$process->_dcStack = array();
		$process->_listScope = 0;
		$process->_liStack = array();
#		$process->parse(''); # cas particulier ?
		$process->clear();
		$t = $process->parse($t);

		# reinserer les trucs autorises
		if ($ok)
		foreach ($ok as $re => $v)
			$t = str_replace($re, $v, $t);
	}
	else
		$t = entites_html($t); // tres laid, en cas d'erreur

	return $t;
}
Esempio n. 9
0
function protege_champ($texte){
	if (is_array($texte))
		$texte = array_map('protege_champ',$texte);
	else {
		// ne pas corrompre une valeur serialize
		if ((preg_match(",^[abis]:\d+[:;],", $texte) AND unserialize($texte)!=false) OR is_null($texte))
			return $texte;
		$texte = entites_html($texte);
		$texte = str_replace("'","&#39;",$texte);
	}
	return $texte;
}
Esempio n. 10
0
function cextras_enum($enum, $val='', $type='valeur', $name='') {
	$enums = array();
	foreach ($vals = explode("\n", $enum) as $x) {
		list($cle, $desc) = explode(',', trim($x), 2);
		$enums[$cle] = _T($desc);
	}

	$val_t = explode(',', $val);

	foreach($enums as $cle => $desc) {
		switch($type) {
			case 'valeur':
				$enums[$cle] = 
					($cle == $val
					OR in_array($cle, $val_t))
						? sinon(sinon($desc,$cle),_T('cextra:cextra_par_defaut'))
						: '';
				break;
			case 'option':
				$enums[$cle] = '<option value="'.entites_html($cle).'"'
					. ($cle == $val
						? " selected='selected'"
						: ''
					) .'> '.sinon(sinon($desc,$cle),_T('cextra:cextra_par_defaut'))
					.'</option>'
					."\n";
				break;
			case 'radio':
				$enums[$cle] = "<div class='choix'><input type='radio' name='$name' id='${name}_$cle' value=\"".entites_html($cle).'"'
					. ($cle == $val
						? " checked='checked'"
						: ''
					) ."><label for='${name}_$cle'>"
					. sinon(sinon($desc,$cle),_T('cextra:cextra_par_defaut'))
					.'</label></div>'
					."\n";
				break;
			case 'cases':
				$enums[$cle] = "<div class='choix'><input type='checkbox' name='${name}[]' id='${name}_$cle' value=\"".entites_html($cle).'"'
					. (in_array($cle, $val_t)
						? " checked='checked'"
						: ''
					) ." /><label for='${name}_$cle'>"
					. sinon(sinon($desc,$cle),_T('cextra:cextra_par_defaut'))
					.'</label></div>'
					."\n";
				break;
		}
	}
	
	return trim(join("\n", $enums));
}
Esempio n. 11
0
/**
 * Protéger les saisies d'un champ de formulaire
 * 
 * Proteger les ' et les " dans les champs que l'on va injecter,
 * sans toucher aux valeurs sérialisées
 *
 * @see entites_html()
 * @param string|array $texte
 *     Saisie à protéger
 * @return string|array
 *     Saisie protégée
**/
function protege_champ($texte)
{
    if (is_array($texte)) {
        $texte = array_map('protege_champ', $texte);
    } else {
        // ne pas corrompre une valeur serialize
        if (preg_match(",^[abis]:\\d+[:;],", $texte) and unserialize($texte) != false or is_null($texte)) {
            return $texte;
        }
        $texte = entites_html($texte);
    }
    return $texte;
}
Esempio n. 12
0
function cextras_enum($enum, $val='', $type='valeur', $name='', $class='') {

	// transformer la saisie utilisateur en tableau
	$enums = cextras_enum_array($enum);

	$val_t = explode(',', $val);
	$class = $class ? " class='$class'" : '';
	foreach($enums as $cle => $desc) {
		switch($type) {
			case 'valeur':
				$enums[$cle] =
					($cle == $val
					OR in_array($cle, $val_t))
						? sinon(sinon($desc,$cle),_T('cextras:cextra_par_defaut'))
						: '';
				break;
			case 'option':
				$enums[$cle] = '<option value="'.entites_html($cle).'"'
					. ($cle == $val
						? " selected='selected'"
						: ''
					) .'> '.sinon(sinon($desc,$cle),_T('cextras:cextra_par_defaut'))
					.'</option>'
					."\n";
				break;
			case 'radio':
				$enums[$cle] = "<div class='choix'><input type='radio' name='$name'$class id='${name}_$cle' value=\"".entites_html($cle).'"'
					. ($cle == $val
						? " checked='checked'"
						: ''
					) ."><label for='${name}_$cle'>"
					. sinon(sinon($desc,$cle),_T('cextras:cextra_par_defaut'))
					.'</label></div>'
					."\n";
				break;
			case 'cases':
				$enums[$cle] = "<div class='choix'><input type='checkbox' name='${name}[]'$class id='${name}_$cle' value=\"".entites_html($cle).'"'
					. (in_array($cle, $val_t)
						? " checked='checked'"
						: ''
					) ." /><label for='${name}_$cle'>"
					. sinon(sinon($desc,$cle),_T('cextras:cextra_par_defaut'))
					.'</label></div>'
					."\n";
				break;
		}
	}

	return trim(join("\n", $enums));
}
Esempio n. 13
0
function inc_tourner_dist($id_document, $document, $script, $flag, $type)
{
	global $spip_lang_right;

	if (!$document) {
		// retour d'Ajax
		$document = sql_fetsel("*", "spip_documents", "id_document = " . intval($id_document));
	}

	$prim = 'id_' . $type;
	// si pas de doc le hash sera inutilisable
	$id = intval(sql_getfetsel('id_objet', 'spip_documents_liens', "objet=".sql_quote($type)." AND id_document = " . intval($id_document)));

	$titre = $document['titre'];
	$id_vignette = $document['id_vignette'];
	$fichier = entites_html($document['fichier']);

	if (isset($document['url']))
		$url = $document['url'];
	else {
		$url = generer_url_entite($id_document, 'document');
	}

	$res = '';

	// Indiquer les documents manquants avec un panneau de warning

	if ($document['distant'] != 'oui') {
		if (!@file_exists(get_spip_doc($document['fichier']))){
			$c = _T('fichier_introuvable',
					array('fichier'=>basename($document['fichier'])));
			$res = "<img src='" . chemin_image('warning-24.gif')
				."'\n\tstyle='float: right;'\n\talt=\"$c\"\n\ttitle=\"$c\" />";
		} else {
			if ($flag AND !$id_vignette) 
				$res = boutons_rotateurs($document, $type, $id, $id_document,$script);
		}
	} else {
		$res = "\n<div class='verdana1' style='float: $spip_lang_right; text-align: $spip_lang_right;'>";
		
		// Signaler les documents distants par une icone de trombone
		$res .= "<img src='" . chemin_image('attachment.gif') . "'\n\t \n\talt=\"$fichier\"\n\ttitle=\"$fichier\" />\n";
		// Bouton permettant de copier en local le fichier
		$res .= bouton_copier_local($document, $type, $id, $id_document, $script);
		
		$res .= "</div>\n";
	}
	return tourner_greffe($id_document, $document, $url, $res);
}
function BOUCLE_articleshtml_ce97d1249b67fffb20134bd49b8a9e29(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_articles';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_auteurs_liens');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.titre", "articles.id_article", "articles.lang", "articles.texte", "articles.descriptif", "articles.chapo", "articles.date");
        $command['orderby'] = array('articles.titre');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')));
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L1.id_auteur', sql_quote($Pile[$SP]['id_auteur'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/auteur.html', 'html_ce97d1249b67fffb20134bd49b8a9e29', '_articles', 39, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t1 = '
			<h3><a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '/spip.php?action=converser&amp;redirect=' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '%2F' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" hreflang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a></h3>
			<div class="detail">
				' . interdire_scripts(nom_jour(normaliser_date($Pile[$SP]['date']))) . ' ' . interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))) . '
			</div>
		';
            $t0 .= (strlen($t1) && strlen($t0) ? '<br />' : '') . $t1;
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_articles @ squelettes/auteur.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_art_agendahtml_78503d8cb0bd66f2d97f4b9c0f7d329a(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'articles';
        $command['id'] = '_art_agenda';
        $command['from'] = array('articles' => 'spip_articles', 'L1' => 'spip_mots_liens', 'L2' => 'spip_mots');
        $command['type'] = array();
        $command['groupby'] = array("articles.id_article");
        $command['select'] = array("articles.date_redac", "articles.id_article", "articles.texte", "articles.descriptif", "articles.chapo", "articles.titre", "articles.lang");
        $command['orderby'] = array('articles.date_redac');
        $command['join'] = array('L1' => array('articles', 'id_objet', 'id_article', 'L1.objet=' . sql_quote('article')), 'L2' => array('L1', 'id_mot'));
        $command['limit'] = '0,5';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('articles.statut', 'publie,prop,prepa/auteur', 'publie', ''), array('=', 'L2.titre', "'Agenda'"), array('<', 'TIMESTAMPDIFF(HOUR,articles.date_redac,NOW())/24', "1"), array('=', 'articles.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-menu-agenda.html', 'html_78503d8cb0bd66f2d97f4b9c0f7d329a', '_art_agenda', 4, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
				<li>' . (($t1 = strval(affdate(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? '<span>' . $t1 . (' ' . (($t2 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])) != '0' ? (($t3 = strval(heures(normaliser_date($Pile[$SP]['date_redac'])))) !== '' ? $t3 . ':' : '') . minutes(normaliser_date($Pile[$SP]['date_redac'])) : '')) !== '' ? '- ' . $t2 : '') . '</span>') : '') . '
					<a class="lien' . interdire_scripts(@$Pile[0]['exposer']) . ' article" href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_article'], 'article', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist($Pile[$SP]['descriptif'], strlen($Pile[$SP]['descriptif']) ? '' : $Pile[$SP]['chapo'] . "\n\n" . $Pile[$SP]['texte'], 500, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>

				</li>
		';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_art_agenda @ squelettes/inc/inc-menu-agenda.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_langueshtml_9491858aea5af6033788aa1936ebca8d(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_langues';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.lang", "rubriques.titre");
        $command['orderby'] = array('rubriques.lang');
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_parent', 0), array('NOT', array('=', 'rubriques.lang', sql_quote(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lang', null), true)), '', 'varchar(10) NOT NULL DEFAULT \'\''))));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-bas_menu-lang.html', 'html_9491858aea5af6033788aa1936ebca8d', '_langues', 18, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= ($t1 = strval(traduire_nom_langue(unique(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']))))) !== '' ? '
		<span lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '">| 
		<a href="spip.php?action=converser&amp;var_lang=' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '&amp;redirect=/" rel="alternate"  title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . traduire_nom_langue(spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang'])) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">' . $t1 . '</a>
		</span>
' : '';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_langues @ squelettes/inc/inc-bas_menu-lang.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function BOUCLE_breves_rubriqueshtml_11157eacea3e766769d2031f1e2eed04(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'breves';
        $command['id'] = '_breves_rubriques';
        $command['from'] = array('breves' => 'spip_breves');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("breves.date_heure", "breves.date_heure AS date", "breves.id_breve", "breves.texte", "breves.titre", "breves.lang");
        $command['orderby'] = array('breves.date_heure DESC');
        $command['join'] = array();
        $command['limit'] = '0,10';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('breves.statut', 'publie,prop', 'publie', ''), array('=', 'breves.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL DEFAULT \'0\'')), array('=', 'breves.lang', sql_quote($GLOBALS['spip_lang'], '', 'varchar(10) NOT NULL DEFAULT \'\'')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/inc/inc-breves.html', 'html_11157eacea3e766769d2031f1e2eed04', '_breves_rubriques', 2, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], '', $Pile[$SP]['titre']);
            $t0 .= '
          	<li>' . (($t1 = strval(interdire_scripts(affdate(normaliser_date($Pile[$SP]['date']))))) !== '' ? '<span>' . $t1 . '</span>' : '') . '
              <a href="' . vider_url(urlencode_1738(generer_url_entite($Pile[$SP]['id_breve'], 'breve', '', '', true))) . '" ' . (($t1 = strval(interdire_scripts(entites_html(textebrut(filtre_introduction_dist('', $Pile[$SP]['texte'], 300, $connect, null)))))) !== '' ? 'title="' . $t1 . '"' : '') . '>' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</a>
          	</li>
            ';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_breves_rubriques @ squelettes/inc/inc-breves.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
function html_541d8d0e325a80d1e837a45e506f5e26($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 = '<div class="formulaire_spip formulaire_recherche' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'class', null), true)))) !== '' ? ' ' . $t1 : '') . '" id="formulaire_recherche">
<form action="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true)) . '" method="get"><div>
	' . interdire_scripts(form_hidden(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true))) . '
	' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'lang', null), true)))) !== '' ? '<input type="hidden" name="lang" value="' . $t1 . '" />' : '') . '
	<label for="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) '_id_champ', null), true)) . '">' . _T('public|spip|ecrire:info_rechercher_02') . '</label>
	<input type="' . ('' ? 'search' : 'text') . '" class="search text" size="10" name="recherche" id="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) '_id_champ', null), true)) . '"' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'recherche', null), true)))) !== '' ? ' value="' . $t1 . '"' : '') . ' accesskey="4" autocapitalize="off" autocorrect="off"
	/><input type="submit" class="submit" value="&gt;&gt;" title="' . _T('public|spip|ecrire:info_rechercher') . '" />
</div></form>
</div>
';
    return analyse_resultat_skel('html_541d8d0e325a80d1e837a45e506f5e26', $Cache, $page, 'squelettes-dist/formulaires/recherche.html');
}
function formulaires_configurer_relayeur_verifier_dist()
{
    $erreurs = array();
    $http_proxy = relayeur_saisie_ou_config(_request('http_proxy'), lire_config('http_proxy', ''));
    $http_noproxy = _request('http_noproxy');
    if ($http_proxy and !tester_url_absolue($http_proxy)) {
        $erreurs['http_proxy'] = _T('info_url_proxy_pas_conforme');
    }
    if (!isset($erreurs['http_proxy']) and _request('tester_proxy')) {
        if (!$http_proxy) {
            $erreurs['http_proxy'] = _T('info_obligatoire');
        } else {
            include_spip('inc/distant');
            $test_proxy = _request('test_proxy');
            $t = parse_url($test_proxy);
            if (!@$t['host']) {
                $erreurs['test_proxy'] = _T('info_adresse_non_indiquee');
            } else {
                include_spip('inc/texte');
                // pour aide, couper, lang
                $info = "";
                if (!need_proxy($t['host'], $http_proxy, $http_noproxy)) {
                    $info = "<strong>" . _T('page_pas_proxy') . "</strong><br />";
                }
                // il faut fausser le proxy actuel pour faire le test !
                $cur_http_proxy = $GLOBALS['meta']['http_proxy'];
                $cur_http_noproxy = $GLOBALS['meta']['http_noproxy'];
                $GLOBALS['meta']['http_proxy'] = $http_proxy;
                $GLOBALS['meta']['http_noproxy'] = $http_noproxy;
                $page = recuperer_page($test_proxy, true);
                $GLOBALS['meta']['http_proxy'] = $cur_http_proxy;
                $GLOBALS['meta']['http_noproxy'] = $cur_http_noproxy;
                if ($page) {
                    $erreurs['message_ok'] = _T('info_proxy_ok') . "<br />{$info}\n<tt>" . couper(entites_html($page), 300) . "</tt>";
                    $erreurs['message_erreur'] = '';
                } else {
                    $erreurs['message_erreur'] = $info . _T('info_impossible_lire_page', array('test_proxy' => "<tt>{$test_proxy}</tt>")) . " <b><tt>" . no_password_proxy_url($http_proxy) . "</tt></b>." . aide('confhttpproxy');
                }
            }
        }
    }
    return $erreurs;
}
Esempio n. 20
0
function saisie_url_syndic($url_syndic, $name = 'url_syndic', $id = 'url_syndic')
{
    $res = "";
    if (strlen($url_syndic) < 8) {
        $url_syndic = "http://";
    }
    // cas d'une liste de flux detectee par feedfinder : menu
    if (preg_match(',^select: (.+),', $url_syndic, $regs)) {
        $feeds = explode(' ', $regs[1]);
        $res .= "<select name='{$name}' id='{$id}'>\n";
        foreach ($feeds as $feed) {
            $res .= '<option value="' . entites_html($feed) . '">' . $feed . "</option>\n";
        }
        $res .= "</select>\n";
    } else {
        $res .= "<input type='text' class='text' name='{$name}' id='{$id}' value=\"{$url_syndic}\" size='40' />\n";
    }
    return $res;
}
Esempio n. 21
0
function inc_safehtml_dist($t)
{
    static $process, $test;
    if (!$test) {
        $process = false;
        if ($f = find_in_path('lib/safehtml/classes')) {
            define('XML_HTMLSAX3', $f . '/');
            require_once XML_HTMLSAX3 . 'safehtml.php';
            $process = new safehtml();
            $process->deleteTags[] = 'param';
            // sinon bug Firefox
        }
        if ($process) {
            $test = 1;
        } else {
            $test = -1;
        }
        # se rabattre sur une fonction de securite basique
    }
    if ($test > 0) {
        # reset ($process->clear() ne vide que _xhtml...),
        # on doit pouvoir programmer ca plus propremement
        $process->_counter = array();
        $process->_stack = array();
        $process->_dcCounter = array();
        $process->_dcStack = array();
        $process->_listScope = 0;
        $process->_liStack = array();
        #		$process->parse(''); # cas particulier ?
        $process->clear();
        $t = $process->parse($t);
    } else {
        $t = entites_html($t);
    }
    // tres laid, en cas d'erreur
    // supprimer un <li></li> provenant d'un <li> ouvrant seul+safehtml
    // cf http://core.spip.org/issues/2201
    $t = str_replace("<li></li>", "", $t);
    return $t;
}
Esempio n. 22
0
function configuration_transcodeur_dist()
{
	$charset = $GLOBALS['meta']["charset"];

	$res =  _T('texte_jeu_caractere') .
	  "<blockquote class='spip'>\n<p>"
	  . _T('texte_jeu_caractere_3') .
	  "</p>\n<div style='text-align: center'><b><tt>"
	  .entites_html($charset)
	  ."</tt></b></div><p>" 
	  ."<label for='charset'>" 
	  ._T('texte_jeu_caractere_4') 
	  ."</label>"
	  ." &nbsp; <input type='text' name='charset' id='charset'
			value=\"".entites_html($charset)."\" />" .
	  "<br />\n(".
	  _T('texte_jeu_caractere_2').")" .
		"</p></blockquote>\n";

	// faudrait dire si le charset est inconnu
	// ca eviterait l'erreur sur array_flip dans inc/charsets
	if ($charset != 'utf-8' AND load_charset($charset))
		$res .= _T('texte_jeu_caractere_conversion',
			array('url' => generer_url_ecrire('convert_utf8'))
		);

	$res = ajax_action_post('configurer',
				'transcodeur',
				'config_lang',
				'',
				$res);

	$res = debut_cadre_relief("breve-24.gif", true, "", _T('info_jeu_caractere')) .
	  $res .
	  fin_cadre_relief(true);

	return ajax_action_greffe("configurer-transcodeur", '', $res);
}
Esempio n. 23
0
function configuration_contenu_forums_dist(){
	global $spip_lang_left;

	$forums_titre = $GLOBALS['meta']["forums_titre"];
	$forums_texte = $GLOBALS['meta']["forums_texte"];
	$forums_urlref = $GLOBALS['meta']["forums_urlref"];
	$forums_afficher_barre = $GLOBALS['meta']["forums_afficher_barre"];

	$res = "<table border='0' cellspacing='1' cellpadding='3' width=\"100%\">"

	. "<tr><td colspan='2' class='verdana2'>"
	. typo(_T('config_activer_champs').':')
	. "</td></tr>"

	. "<tr>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. _T('info_titre')
	. "</td>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. afficher_choix('forums_titre', $forums_titre,
		array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ")
	. "</td></tr>\n"

	. "<tr>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. typo(_T('info_texte').':')
	. "</td>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. afficher_choix('forums_texte', $forums_texte,
		array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ")
	. "</td></tr>\n"

	. "<tr>"
	. "<td align='$spip_lang_left' class='verdana2'>- "
	. _T('info_barre_outils')
	. "</td>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. afficher_choix('forums_afficher_barre', $forums_afficher_barre,
		array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ")
	. "</td></tr>\n"

	. "<tr>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. _T('info_urlref')
	. "</td>"
	. "<td align='$spip_lang_left' class='verdana2'>"
	. afficher_choix('forums_urlref', $forums_urlref,
		array('oui' => _T('item_oui'), 'non' => _T('item_non')), " &nbsp; ")
	. "</td></tr>\n"


	. "<tr>"
	. "<td align='$spip_lang_left' class='verdana2' colspan='2'>"
	. _T('info_question_visiteur_ajout_document_forum')
	. "<div class='spip_xx-small'>"
	. _T('info_question_visiteur_ajout_document_forum_format')
	. "</div><br />"
	. "<input type='text' name='formats_documents_forum' id='formats_documents_forum' size='40' class='forml' value=\""
		.entites_html($GLOBALS['meta']['formats_documents_forum'])
		."\" />"
	. "</td></tr>\n"


	. "</table>";

	$res = debut_cadre_trait_couleur("forum-public-24.gif", true, "", _T('titre_forum'))
	. ajax_action_post('configurer', 'contenu_forums', 'configuration','',$res)
	. fin_cadre_trait_couleur(true);

	return ajax_action_greffe('configurer-contenu_forums', '', $res);

}
Esempio n. 24
0
/**
 * Affiche le code d'un raccourcis de document, tel que <doc123|left>
 *
 * Affiche un code de raccourcis de document, et l'insère
 * dans le textarea principal de l'objet (champ 'texte') sur un double-clic 
 *
 * @param string $doc
 * 		Type de raccourcis : doc,img,emb...
 * @param int $id
 * 		Identifiant du document
 * @param string $align
 * 		Alignement du document : left,center,right
 * 
 * @return string
 * 		Texte du raccourcis
**/
function affiche_raccourci_doc($doc, $id, $align)
{
    static $num = 0;
    $pipe = $onclick = "";
    if ($align) {
        $pipe = "|{$align}";
        $onclick = "\nondblclick=\"barre_inserer('\\x3C{$doc}{$id}{$pipe}&gt;', \$('textarea[name=texte]')[0]);\"\ntitle=\"" . str_replace('&amp;', '&', entites_html(_T('medias:double_clic_inserer_doc'))) . "\"";
    } else {
        $align = 'center';
    }
    return "\n<div style='text-align: {$align}'{$onclick}>&lt;{$doc}{$id}{$pipe}&gt;</div>\n";
}
Esempio n. 25
0
/**
 * Retourne un formulaire (POST par défaut) vers un script exec
 * de l’interface privée
 *
 * @param string $script
 *     Nom de la page exec
 * @param string $corps
 *     Contenu du formulaire
 * @param string $atts
 *     Si présent, remplace les arguments par défaut (method=post) par ceux indiqués
 * @param string $submit
 *     Si indiqué, un bouton de soumission est créé avec texte sa valeur.
 * @return string
 *     Code HTML du formulaire
**/
function generer_form_ecrire($script, $corps, $atts = '', $submit = '')
{
    global $spip_lang_right;
    $script1 = explode('&', $script);
    $script1 = reset($script1);
    return "<form action='" . ($script ? generer_url_ecrire($script) : '') . "' " . ($atts ? $atts : " method='post'") . "><div>\n" . "<input type='hidden' name='exec' value='{$script1}' />" . $corps . (!$submit ? '' : "<div style='text-align: {$spip_lang_right}'><input class='fondo' type='submit' value=\"" . entites_html($submit) . "\" /></div>") . "</div></form>\n";
}
Esempio n. 26
0
function form_hidden($action)
{
    $contexte = array();
    include_spip('inc/urls');
    if ($p = urls_decoder_url($action, '') and reset($p)) {
        $fond = array_shift($p);
        if ($fond != '404') {
            $contexte = array_shift($p);
            $contexte['page'] = $fond;
            $action = preg_replace('/([?]' . preg_quote($fond) . '[^&=]*[0-9]+)(&|$)/', '?&', $action);
        }
    }
    // defaire ce qu'a injecte urls_decoder_url : a revoir en modifiant la signature de urls_decoder_url
    if (defined('_DEFINIR_CONTEXTE_TYPE') and _DEFINIR_CONTEXTE_TYPE) {
        unset($contexte['type']);
    }
    if (defined('_DEFINIR_CONTEXTE_TYPE_PAGE') and _DEFINIR_CONTEXTE_TYPE_PAGE) {
        unset($contexte['type-page']);
    }
    // on va remplir un tableau de valeurs en prenant bien soin de ne pas
    // ecraser les elements de la forme mots[]=1&mots[]=2
    $values = array();
    // d'abord avec celles de l'url
    if (false !== ($p = strpos($action, '?'))) {
        foreach (preg_split('/&(amp;)?/S', substr($action, $p + 1)) as $c) {
            list($var, $val) = explode('=', $c, 2);
            if ($var) {
                $val = rawurldecode($val);
                $var = rawurldecode($var);
                // decoder les [] eventuels
                if (preg_match(',\\[\\]$,S', $var)) {
                    $values[] = array($var, $val);
                } else {
                    if (!isset($values[$var])) {
                        $values[$var] = array($var, $val);
                    }
                }
            }
        }
    }
    // ensuite avec celles du contexte, sans doublonner !
    foreach ($contexte as $var => $val) {
        if (preg_match(',\\[\\]$,S', $var)) {
            $values[] = array($var, $val);
        } else {
            if (!isset($values[$var])) {
                $values[$var] = array($var, $val);
            }
        }
    }
    // puis on rassemble le tout
    $hidden = array();
    foreach ($values as $value) {
        list($var, $val) = $value;
        $hidden[] = '<input name="' . entites_html($var) . '"' . (is_null($val) ? '' : ' value="' . entites_html($val) . '"') . ' type="hidden"' . "\n/>";
    }
    return join("", $hidden);
}
Esempio n. 27
0
/**
 * http://code.spip.net/@traiter_tableau
 *
 * @param sring $bloc
 * @return string
 */
function traiter_tableau($bloc)
{
    // id "unique" pour les id du tableau
    $tabid = substr(md5($bloc), 0, 4);
    // Decouper le tableau en lignes
    preg_match_all(',([|].*)[|]\\n,UmsS', $bloc, $regs, PREG_PATTERN_ORDER);
    $lignes = array();
    $debut_table = $summary = '';
    $l = 0;
    $numeric = true;
    // Traiter chaque ligne
    $reg_line1 = ',^(\\|(' . _RACCOURCI_TH_SPAN . '))+$,sS';
    $reg_line_all = ',^(' . _RACCOURCI_TH_SPAN . ')$,sS';
    $hc = $hl = array();
    foreach ($regs[1] as $ligne) {
        $l++;
        // Gestion de la premiere ligne :
        if ($l == 1) {
            // - <caption> et summary dans la premiere ligne :
            //   || caption | summary || (|summary est optionnel)
            if (preg_match(',^\\|\\|([^|]*)(\\|(.*))?$,sS', rtrim($ligne, '|'), $cap)) {
                $l = 0;
                if ($caption = trim($cap[1])) {
                    $debut_table .= "<caption>" . $caption . "</caption>\n";
                }
                $summary = ' summary="' . entites_html(trim($cap[3])) . '"';
            } else {
                if (preg_match($reg_line1, $ligne, $thead)) {
                    preg_match_all('/\\|([^|]*)/S', $ligne, $cols);
                    $ligne = '';
                    $cols = $cols[1];
                    $colspan = 1;
                    for ($c = count($cols) - 1; $c >= 0; $c--) {
                        $attr = '';
                        if ($cols[$c] == '<') {
                            $colspan++;
                        } else {
                            if ($colspan > 1) {
                                $attr = " colspan='{$colspan}'";
                                $colspan = 1;
                            }
                            // inutile de garder le strong qui n'a servi que de marqueur
                            $cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);
                            $ligne = "<th id='id{$tabid}_c{$c}'{$attr}>{$cols[$c]}</th>{$ligne}";
                            $hc[$c] = "id{$tabid}_c{$c}";
                            // pour mettre dans les headers des td
                        }
                    }
                    $debut_table .= "<thead><tr class='row_first'>" . $ligne . "</tr></thead>\n";
                    $l = 0;
                }
            }
        }
        // Sinon ligne normale
        if ($l) {
            // Gerer les listes a puce dans les cellules
            // on declenche simplement sur \n- car il y a les
            // -* -# -? -! (qui produisent des -&nbsp;!)
            if (strpos($ligne, "\n-") !== false) {
                $ligne = traiter_listes($ligne);
            }
            // tout mettre dans un tableau 2d
            preg_match_all('/\\|([^|]*)/S', $ligne, $cols);
            // Pas de paragraphes dans les cellules
            foreach ($cols[1] as &$col) {
                if (strlen($col = trim($col))) {
                    $col = preg_replace("/\n{2,}/S", "<br /> <br />", $col);
                    if (_AUTOBR) {
                        $col = str_replace("\n", _AUTOBR . "\n", $col);
                    }
                }
            }
            // assembler le tableau
            $lignes[] = $cols[1];
        }
    }
    // maintenant qu'on a toutes les cellules
    // on prepare une liste de rowspan par defaut, a partir
    // du nombre de colonnes dans la premiere ligne.
    // Reperer egalement les colonnes numeriques pour les cadrer a droite
    $rowspans = $numeric = array();
    $n = count($lignes[0]);
    $k = count($lignes);
    // distinguer les colonnes numeriques a point ou a virgule,
    // pour les alignements eventuels sur "," ou "."
    $numeric_class = array('.' => 'point', ',' => 'virgule');
    for ($i = 0; $i < $n; $i++) {
        $align = true;
        for ($j = 0; $j < $k; $j++) {
            $rowspans[$j][$i] = 1;
            if ($align and preg_match('/^[+-]?(?:\\s|\\d)*([.,]?)\\d*$/', trim($lignes[$j][$i]), $r)) {
                if ($r[1]) {
                    $align = $r[1];
                }
            } else {
                $align = '';
            }
        }
        $numeric[$i] = $align ? " class='numeric " . $numeric_class[$align] . "'" : '';
    }
    for ($j = 0; $j < $k; $j++) {
        if (preg_match($reg_line_all, $lignes[$j][0])) {
            $hl[$j] = "id{$tabid}_l{$j}";
            // pour mettre dans les headers des td
        } else {
            unset($hl[0]);
        }
    }
    if (!isset($hl[0])) {
        $hl = array();
    }
    // toute la colonne ou rien
    // et on parcourt le tableau a l'envers pour ramasser les
    // colspan et rowspan en passant
    $html = '';
    for ($l = count($lignes) - 1; $l >= 0; $l--) {
        $cols = $lignes[$l];
        $colspan = 1;
        $ligne = '';
        for ($c = count($cols) - 1; $c >= 0; $c--) {
            $attr = $numeric[$c];
            $cell = trim($cols[$c]);
            if ($cell == '<') {
                $colspan++;
            } elseif ($cell == '^') {
                $rowspans[$l - 1][$c] += $rowspans[$l][$c];
            } else {
                if ($colspan > 1) {
                    $attr .= " colspan='{$colspan}'";
                    $colspan = 1;
                }
                if (($x = $rowspans[$l][$c]) > 1) {
                    $attr .= " rowspan='{$x}'";
                }
                $b = ($c == 0 and isset($hl[$l])) ? 'th' : 'td';
                $h = (isset($hc[$c]) ? $hc[$c] : '') . ' ' . (($b == 'td' and isset($hl[$l])) ? $hl[$l] : '');
                if ($h = trim($h)) {
                    $attr .= " headers='{$h}'";
                }
                // inutile de garder le strong qui n'a servi que de marqueur
                if ($b == 'th') {
                    $attr .= " id='" . $hl[$l] . "'";
                    $cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);
                }
                $ligne = "\n<{$b}" . $attr . '>' . $cols[$c] . "</{$b}>" . $ligne;
            }
        }
        // ligne complete
        $class = alterner($l + 1, 'odd', 'even');
        $html = "<tr class='row_{$class} {$class}'>{$ligne}</tr>\n{$html}";
    }
    return "\n\n<table" . $GLOBALS['class_spip_plus'] . $summary . ">\n" . $debut_table . "<tbody>\n" . $html . "</tbody>\n" . "</table>\n\n";
}
function BOUCLE_rubrique_principalhtml_0caead67327defaf94febb642f511490(&$Cache, &$Pile, &$doublons, &$Numrows, $SP)
{
    static $command = array();
    static $connect;
    $command['connect'] = $connect = '';
    if (!isset($command['table'])) {
        $command['table'] = 'rubriques';
        $command['id'] = '_rubrique_principal';
        $command['from'] = array('rubriques' => 'spip_rubriques');
        $command['type'] = array();
        $command['groupby'] = array();
        $command['select'] = array("rubriques.id_rubrique", "rubriques.lang", "rubriques.titre", "rubriques.id_secteur", "rubriques.texte", "rubriques.descriptif");
        $command['orderby'] = array();
        $command['join'] = array();
        $command['limit'] = '';
        $command['having'] = array();
    }
    $command['where'] = array(quete_condition_statut('rubriques.statut', '!', 'publie', ''), array('=', 'rubriques.id_rubrique', sql_quote(@$Pile[0]['id_rubrique'], '', 'bigint(21) NOT NULL AUTO_INCREMENT')));
    if (defined("_BOUCLE_PROFILER")) {
        $timer = time() + microtime();
    }
    $t0 = "";
    // REQUETE
    $iter = IterFactory::create("SQL", $command, array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 1, $GLOBALS['spip_lang']));
    if (!$iter->err()) {
        lang_select($GLOBALS['spip_lang']);
        $SP++;
        // RESULTATS
        while ($Pile[$SP] = $iter->fetch()) {
            lang_select_public($Pile[$SP]['lang'], 'oui', $Pile[$SP]['titre']);
            $t0 .= '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" lang="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . '" dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '">
<head>
	<title>[' . interdire_scripts(textebrut(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0]))) . '] : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '</title>
	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-meta') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',7,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	<link rel="alternate" type="application/rss+xml" title="' . _T('public|spip|ecrire:syndiquer_rubrique') . ' : ' . interdire_scripts(entites_html(textebrut(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))))) . '" href="' . interdire_scripts(parametre_url(generer_url_public('backend', ''), 'id_rubrique', $Pile[$SP]['id_rubrique'])) . '" />

	' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('styles') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',10,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
</head>
<body dir="' . lang_dir($Pile[$SP]['lang'], 'ltr', 'rtl') . '" class="' . spip_htmlentities($Pile[$SP]['lang'] ? $Pile[$SP]['lang'] : $GLOBALS['spip_lang']) . ' rubrique sect' . $Pile[$SP]['id_secteur'] . ' ' . BOUCLE_rubriques_bodyhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP) . ' rub' . $Pile[$SP]['id_rubrique'] . '">
<div id="page" class="rubrique rub' . $Pile[$SP]['id_rubrique'] . '">

<!-- *****************************************************************
	Bandeau, titre du site et menu langue
	Header and main menu (top and right) 
    ************************************************************* -->
	
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bandeau') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',20,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

<!-- *****************************************************************
	Contenu principal (centre)
	Main content (center) 
    ************************************************************* -->
	<div id="bloc-contenu">
		<h5>
		<a href="' . spip_htmlspecialchars(sinon($GLOBALS['meta']['adresse_site'], '.')) . '" title="' . _T('public|spip|ecrire:accueil_site') . ' : ' . interdire_scripts(typo($GLOBALS['meta']['nom_site'], "TYPO", $connect, $Pile[0])) . '">' . _T('public|spip|ecrire:accueil_site') . '</a>
    ' . (($t1 = BOUCLE_rubriques_cheminhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? '
    ' . $t1 . '
	' : '') . '
		' . (($t1 = strval(interdire_scripts(couper(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0])), '60')))) !== '' ? '<b class=\'separateur\'>&gt;</b> ' . $t1 : '') . '
		</h5>
		<div class="ligne-debut"></div><!-- ligne-debut -->
    	' . (($t1 = strval(filtrer('image_graver', filtrer('image_reduire', !is_array($l = quete_logo('id_rubrique', 'ON', $Pile[$SP]['id_rubrique'], quete_parent($Pile[$SP]['id_rubrique']), 0)) ? '' : "<img class=\"spip_logo spip_logos\" alt=\"\" src=\"{$l['0']}\"" . $l[2] . ($l[1] ? " onmouseover=\"this.src='{$l['1']}'\" onmouseout=\"this.src='{$l['0']}'\"" : "") . ' />', '120', '0')))) !== '' ? '<div class="logo-liste-art">
    		' . $t1 . '
    	</div>' : '') . '
    <h1 class="titre-article">' . interdire_scripts(supprimer_numero(typo(supprimer_numero($Pile[$SP]['titre']), "TYPO", $connect, $Pile[0]))) . '</h1>
	' . (($t1 = strval(interdire_scripts(($a = filtrer('image_graver', filtrer('image_reduire', propre($Pile[$SP]['texte'], $connect, $Pile[0]), '560', '0')) or is_string($a) and strlen($a)) ? $a : interdire_scripts(propre($Pile[$SP]['descriptif'], $connect, $Pile[0]))))) !== '' ? '<div class="chapo ' . interdire_scripts($Pile[$SP]['texte'] ? '' : '') . '" id="description">
        ' . $t1 . ('
        ' . (($t2 = strval(interdire_scripts(calculer_notes()))) !== '' ? '<div class="notes" style="padding: 0 1.5em;">' . $t2 . '</div>' : '') . '
	</div><!-- chapo -->') : '') . '
	

		' . recuperer_fond('inc/inc-rub-documents', array_merge($Pile[0], array('id_rubrique' => $Pile[$SP]['id_rubrique'])), array('compil' => array('squelettes/rubrique.html', 'html_0caead67327defaf94febb642f511490', '_rubrique_principal', 43, $GLOBALS['spip_lang'])), _request('connect')) . '
	


		' . (($t1 = BOUCLE_type_miniplanhtml_0caead67327defaf94febb642f511490($Cache, $Pile, $doublons, $Numrows, $SP)) !== '' ? $t1 . '
		' : '


		' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-rub-articles') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',63,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
		
		') . '
		
		<br class="nettoyeur" />
	</div><!-- bloc-contenu -->
	
<!-- *****************************************************************
	Menus contextuels (droite)
	Contextual menus (right) 
    ************************************************************* -->
  <div id="encart">  

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-annonces') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',76,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-breves') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',78,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-syndic') . ', array_merge(' . var_export($Pile[0], 1) . ',array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'self\' => ' . argumenter_squelette(self()) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . ')), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',80,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
	
  </div><!-- encart -->

<!-- *****************************************************************
	Navigation principale et rubriques (haut et/ou gauche)
	Main and Sections Navigation (top and/orleft) 
    ************************************************************* -->
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-menu') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',88,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>
<!-- *****************************************************************
	Pied de page - Footer
    ************************************************************* -->
' . '<' . '?php echo recuperer_fond( ' . argumenter_squelette('inc/inc-bas') . ', array(\'id_rubrique\' => ' . argumenter_squelette($Pile[$SP]['id_rubrique']) . ',
	\'id_secteur\' => ' . argumenter_squelette($Pile[$SP]['id_secteur']) . ',
	\'lang\' => ' . argumenter_squelette($GLOBALS["spip_lang"]) . '), array("compil"=>array(\'squelettes/rubrique.html\',\'html_0caead67327defaf94febb642f511490\',\'\',92,$GLOBALS[\'spip_lang\'])), _request("connect"));
?' . '>

</div><!-- page -->
</body>
</html>
';
            lang_select();
        }
        lang_select();
        $iter->free();
    }
    if (defined("_BOUCLE_PROFILER") and 1000 * ($timer = time() + microtime() - $timer) > _BOUCLE_PROFILER) {
        spip_log(intval(1000 * $timer) . "ms BOUCLE_rubrique_principal @ squelettes/rubrique.html", "profiler" . _LOG_AVERTISSEMENT);
    }
    return $t0;
}
Esempio n. 29
0
function legender_corps($ancre, $flag, $id, $id_document, $script, $type, $document, $label, $taille)
{
	include_spip('inc/editer');

	$contenu = '';
	$descriptif = $document['descriptif'];
	if ($descriptif)
	  $contenu .=  "<p>".PtoBR(lignes_longues(propre($descriptif),25)) . "</p>\n";
	if ($document['largeur'] OR $document['hauteur'])
	  $contenu .= _T('info_largeur_vignette',
		     array('largeur_vignette' => $document['largeur'],
			   'hauteur_vignette' => $document['hauteur']))
			 . ' &mdash; ';

	  $contenu .= taille_en_octets($document['taille']);

	$date = $document['date'];
	if ($date AND ($GLOBALS['meta']["documents_date"] == 'oui'))
		$contenu .= "<br />\n" . affdate($date);

	$corps = (!$contenu ? '' :
		  "<div class='verdana1' style='text-align: center; margin-bottom: 10px;'>$contenu</div>") .
	  "<div class='formulaire_spip formulaire_spip_compact'><ul><li class='editer_titre'><label for='titre_document$id_document'>$label</label>\n" .

	  "<input type='text' name='titre_document' id='titre_document$id_document' class='text' value=\"".entites_html($document['titre']).
	  "\" size='40'	onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\" /></li>\n"
	  . (($GLOBALS['meta']["documents_date"] == 'oui')
	  	? "<li class='editer_date'>".date_formulaire_legender($date, $id_document)."</li>"
	  	:'' )
	  . "<li class='editer_descriptif'><label for='descriptif_document$id_document'>".
	  _T('info_description_2').
	  "</label>\n" .
	  "<textarea name='descriptif_document' id='descriptif_document$id_document' rows='4' class='textarea' cols='*' onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\">" .
	    entites_html($descriptif) .
	  "</textarea></li></ul></div>\n" .
	  $taille
	  
	  .controles_md5($document);

	$att_bouton = "";

	$att_span = " id='valider_doc$id_document' "
	. ($flag == 'ajax' ? '' : "class='display_au_chargement'")
	.  " style='text-align:"
	.  $GLOBALS['spip_lang_right']
	. ($flag == 'ajax' ? ';display:block' : "")
	. "'";

	if (test_espace_prive())
		return ajax_action_post("legender", $id_document, $script, "show_docs=$id_document&id_$type=$id#legender-$id_document", $corps, _T('bouton_enregistrer'), $att_bouton, $att_span, "&id_document=$id_document&id=$id&type=$type&ancre=$ancre")
		  . "<div class='nettoyeur'></div>";
	else {
		$corps = "<div class='boutons'>"
		       . $corps 
		       . "<span"
		       . $att_span
		       . "><input type='submit' value='"
		       . _T('bouton_enregistrer')
		       ."' /></span></div>";
		$redirect = parametre_url($script,'show_docs',$id_document,'&');
		$redirect = parametre_url($redirect,"id_$type",$id,'&');
		$redirect = parametre_url($redirect,"id_$type",$id,'&');
		$redirect = ancre_url($redirect,"legender-$id_document");
		return generer_action_auteur("legender", $id_document, $redirect, $corps, "\nmethod='post'");
	}
}
Esempio n. 30
0
/**
 * Vérifie le formatage d'un xml
 *
 * @see valider_resultats()
 * @see valider_dir()
 * @see valider_pseudo_url()
 *
 * @param string $url
 * @param string $req_ext
 * @param int $limit
 * @param array|bool $rec
 *
 **/
function valider_xml_ok($url, $req_ext, $limit, $rec)
{
    $url = urldecode($url);
    $rec = !$rec ? false : array();
    if (!$limit) {
        $limit = 200;
    }
    $titre = _T('analyse_xml');
    if (!$url) {
        $url_aff = 'http://';
        $onfocus = "this.value='';";
        $texte = $bandeau = $err = '';
    } else {
        include_spip('inc/distant');
        if (is_dir($url)) {
            $dir = substr($url, -1, 1) === '/' ? $url : "{$url}/";
            $ext = !preg_match('/^[.*\\w]+$/', $req_ext) ? 'php' : $req_ext;
            $files = preg_files($dir, "{$ext}\$", $limit, $rec);
            if (!$files and $ext !== 'html') {
                $files = preg_files($dir, 'html$', $limit, $rec);
                if ($files) {
                    $ext = 'html';
                }
            }
            if ($files) {
                $res = valider_dir($files, $ext, $url);
                list($err, $res) = valider_resultats($res, $ext === 'html');
                $err = ' (' . $err . '/' . count($files) . ')';
            } else {
                $res = _T('texte_vide');
                $err = '';
            }
            $bandeau = $dir . '*' . $ext . $err;
        } else {
            if (preg_match('@^((?:[.]/)?[^?]*)[?]([0-9a-z_]+)=([^&]*)(.*)$@', $url, $r)) {
                list(, $server, $dir, $script, $args) = $r;
                if ((!$server or $server == './' or strpos($server, url_de_base()) === 0) and is_dir($dir)) {
                    $url = $script;
                    // Pour quand le validateur saura simuler
                    // une query-string...
                    // $args = preg_split('/&(amp;)?[a-z0-9_]+=/', $args);
                    $args = true;
                }
            } else {
                $dir = 'exec';
                $script = $url;
                $args = true;
            }
            $transformer_xml = charger_fonction('valider', 'xml');
            $onfocus = "this.value='" . addslashes($url) . "';";
            if (preg_match(',^[a-z][0-9a-z_]*$,i', $url)) {
                $res = $transformer_xml(charger_fonction($url, $dir), $args);
                $url_aff = valider_pseudo_url($dir, $script);
            } else {
                $res = $transformer_xml(recuperer_page($url));
                $url_aff = entites_html($url);
            }
            list($texte, $err) = emboite_texte($res);
            if (!$err) {
                $err = '<h3>' . _T('spip_conforme_dtd') . '</h3>';
            }
            $res = "<div style='text-align: center'>" . $err . "</div>" . "<div style='margin: 10px; text-align: left'>" . $texte . '</div>';
            $bandeau = "<a href='{$url_aff}'>{$url}</a>";
        }
    }
    $commencer_page = charger_fonction('commencer_page', 'inc');
    $debut = $commencer_page($titre);
    $jq = http_script("", 'jquery.js');
    echo str_replace('<head>', "<head>{$jq}", $debut);
    $onfocus = '<input type="text" size="70" value="' . $url_aff . '" name="var_url" id="var_url" onfocus="' . $onfocus . '" />';
    $onfocus = generer_form_ecrire('valider_xml', $onfocus, " method='get'");
    echo "<h1>", $titre, '<br>', $bandeau, '</h1>', "<div style='text-align: center'>", $onfocus, "</div>", $res, fin_page();
}