Esempio n. 1
0
/**
 * Insérer au besoin les boutons admins
 * 
 * Cette fonction est appelée par le pipeline affichage_final
 *
 * @param string $texte   Contenu de la page envoyée au navigateur
 * @return string         Contenu de la page envoyée au navigateur
**/
function f_admin($texte)
{
    if (defined('_VAR_PREVIEW') and _VAR_PREVIEW and $GLOBALS['html']) {
        include_spip('inc/filtres');
        // pour http_img_pack
        $x = "<div class='spip-previsu' " . http_style_background('preview-32.png') . ">" . _T('previsualisation') . "</div>";
        if (!($pos = stripos($texte, '</body>'))) {
            $pos = strlen($texte);
        }
        $texte = substr_replace($texte, $x, $pos, 0);
    }
    if (isset($GLOBALS['affiche_boutons_admin']) and $GLOBALS['affiche_boutons_admin']) {
        include_spip('public/admin');
        $texte = affiche_boutons_admin($texte);
    }
    if (_request('var_mode') == 'noajax') {
        $texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims', "\\1\\2", $texte);
    }
    return $texte;
}
Esempio n. 2
0
function f_admin ($texte) {
	if (!$GLOBALS['html']) return $texte;
	if ($GLOBALS['affiche_boutons_admin']) {
		include_spip('public/admin');
		$texte = affiche_boutons_admin($texte);
	}
	if (_request('var_mode')=='noajax'){
		$texte = preg_replace(',(class=[\'"][^\'"]*)ajax([^\'"]*[\'"]),Uims',"\\1\\2",$texte);
	}
	return $texte;
}