Newer
Older
if ($connect_statut == '0minirezo' AND ($row['source'] == 'spip' AND !($row['pass'] AND $row['login'])))
return http_img_pack("visit-12.gif",_T('titre_image_redacteur'), "", _T('titre_image_redacteur'));
return http_img_pack("redac-12.gif",_T('titre_image_redacteur'), "", _T('titre_image_redacteur_02'));
return http_img_pack("poubelle.gif", _T('titre_image_auteur_supprime'), "",_T('titre_image_auteur_supprime'));
return http_img_pack("visit-12.gif", _T('titre_image_visiteur'), "",_T('titre_image_visiteur'));
// La couleur du statut
// http://doc.spip.org/@puce_statut
function puce_statut($statut, $type='article') {
switch ($statut) {
case 'publie':
return 'verte';
case 'prepa':
return 'blanche';
case 'prop':
return 'orange';
case 'refuse':
return 'rouge';
case 'poubelle':
return 'poubelle';
}
}
//
// Afficher les forums
//
// http://doc.spip.org/@afficher_forum
function afficher_forum($request, $retour, $arg, $controle_id_article = false) {
global $spip_display;
static $compteur_forum = 0;
static $nb_forum = array();
static $thread = array();
$nb_forum[$compteur_forum] = spip_num_rows($request);
$thread[$compteur_forum] = 1;
$res = '';
if ($spip_display == 4) $res .= "<ul>";
while($row = spip_fetch_array($request)) {
$statut=$row['statut'];
if ($compteur_forum==1) $res .= "\n<br />";
if (($controle_id_article) ? ($statut!="perso") :
(($statut=="prive" OR $statut=="privrac" OR $statut=="privadm" OR $statut=="perso")
OR ($statut=="publie" AND $id_parent > 0))) {
$res .= afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $thread, $retour, $arg)
. afficher_forum(spip_query("SELECT * FROM spip_forum WHERE id_parent='" . $row['id_forum'] . "'" . ($controle_id_article ? '':" AND statut<>'off'") . " ORDER BY date_heure"), $retour, $arg, $controle_id_article);
$thread[$compteur_forum]++;
if ($spip_display == 4) $res .= "</ul>";
return $res;
// http://doc.spip.org/@afficher_forum_thread
function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $i, $retour, $arg) {
global $spip_lang_rtl, $spip_lang_left, $spip_lang_right, $spip_display;
static $voir_logo = array(); // pour ne calculer qu'une fois
if (is_array($voir_logo)) {
$voir_logo = (($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non") ?
"position: absolute; $spip_lang_right: 0px; margin: 0px; margin-top: -3px; margin-$spip_lang_right: 0px;"
: '');
}
$id_forum=$row['id_forum'];
$id_parent=$row['id_parent'];
$id_rubrique=$row['id_rubrique'];
$id_article=$row['id_article'];
$id_breve=$row['id_breve'];
$id_message=$row['id_message'];
$id_syndic=$row['id_syndic'];
$date_heure=$row['date_heure'];
$titre=$row['titre'];
$texte=$row['texte'];
$email_auteur=$row['email_auteur'];
$nom_site=$row['nom_site'];
$url_site=$row['url_site'];
$statut=$row['statut'];
$ip=$row["ip"];
$id_auteur=$row["id_auteur"];
$res = "<a id='id$id_forum'></a>";
$res .= "<li>".typo($titre)."<br />";
$titre_boite = '';
if ($id_auteur AND $voir_logo) {
$chercher_logo = charger_fonction('chercher_logo', 'inc');
if ($logo = $chercher_logo($id_auteur, 'id_auteur', 'on')) {
list($fid, $dir, $nom, $format) = $logo;
$logo = ratio_image($fid, $nom, $format, 48, 48, "alt=''");
if ($logo)
$titre_boite = "\n<div style='$voir_logo'>$logo</div>" ;
}
$titre_boite .= typo($titre);
$res .= "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
$res .= afficher_forum_4($compteur_forum, $nb_forum, $i);
$res .= afficher_forum_logo($statut, $titre_boite);
else $res .= debut_cadre_thread_forum("", true, "", $titre_boite);
$res .= "\n<div style='border: 2px dashed red; padding: 5px;'>";
}
// Si propose, cadre jaune
else if ($statut=="prop") {
$res .= "\n<div style='border: 1px solid yellow; padding: 5px;'>";
Fil
a validé
// Si original, cadre vert
else if ($statut=="original") {
$res .= "\n<div style='border: 1px solid green; padding: 5px;'>";
}
$res .= "<span class='arial2'>". date_interface($date_heure) . "</span> ";
$formater_auteur = charger_fonction('formater_auteur', 'inc');
$res .= join(' ',$formater_auteur($id_auteur));
} else {
if ($email_auteur) {
if (email_valide($email_auteur))
$email_auteur = "<a href='mailto:"
.htmlspecialchars($email_auteur)
."?subject=".rawurlencode($titre)."'>".$email_auteur
."</a>";
$auteur .= " — $email_auteur";
}
$res .= safehtml("<span class='arial2'> / <b>$auteur</b></span>");
}
$res .= boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip);
$res .= safehtml(justifier(propre($texte)));
$res .= "\n<div align='left' class='verdana2'><b><a href='$url_site'>$nom_site</a></b></div>";
else $res .= "<b>$nom_site</b>";
$tm = rawurlencode($titre);
$res .= "\n<div align='right' class='verdana1'>"
. "<b><a href='"
. generer_url_ecrire("forum_envoi", "id_parent=$id_forum&titre_message=$tm&script=$retour") . '#formulaire'
. "'>"
. _T('lien_repondre_message')
. "</a></b></div>";
$res .= afficher_forum_mots($id_forum);
if ($statut == "off" OR $statut == "prop") $res .= "</div>";
if ($compteur_forum == 1) $res .= fin_cadre_forum(true);
else $res .= fin_cadre_thread_forum(true);
$res .= "</td></tr></table>\n";
}
return $res;
}
// http://doc.spip.org/@afficher_forum_logo
function afficher_forum_logo($statut, $titre_boite)
{
if ($statut == "prive") $logo = "forum-interne-24.gif";
else if ($statut == "privadm") $logo = "forum-admin-24.gif";
else if ($statut == "privrac") $logo = "forum-interne-24.gif";
else $logo = "forum-public-24.gif";
return debut_cadre_forum($logo, true, "", $titre_boite);
}
// http://doc.spip.org/@afficher_forum_mots
function afficher_forum_mots($id_forum)
{
$result = spip_query("SELECT * FROM spip_mots AS mots, spip_mots_forum AS lien WHERE lien.id_forum = '$id_forum' AND lien.id_mot = mots.id_mot");
$res = '<ul>';
while ($row = spip_fetch_array($result)) {
$res .= "<li> <b>"
. propre($row['titre'])
. " :</b> "
. propre($row['type'])
. "</li>";
}
$res .= '</ul>';
return $res;
}
// affiche les traits de liaisons entre les reponses
// http://doc.spip.org/@afficher_forum_4
function afficher_forum_4($compteur_forum, $nb_forum, $thread)
{
$res = '';
for ($j=2;$j<=$compteur_forum AND $j<20;$j++){
$fond[$j]=_DIR_IMG_PACK . 'rien.gif';
if ($thread[$j]!=$nb_forum[$j]){
$fond[$j]=_DIR_IMG_PACK . 'forum-vert.gif';
}
if ($j==$compteur_forum){
$fleche="forum-droite$spip_lang_rtl.gif";
}
$res .= "<td width='10' valign='top' style='background-color: "
. $fond[$j]
. "'>"
. http_img_pack($fleche, "", "width='10' height='13'")
. "</td>\n";
}
return $res . "\n<td width='100%' valign='top'>";
}
// http://doc.spip.org/@envoi_link
function envoi_link($nom_site_spip) {
global $connect_statut, $connect_toutes_rubriques, $spip_display;
global $spip_lang, $couleur_claire, $couleur_foncee;
substr($couleur_claire,1) .
'&couleur_foncee=' .
substr($couleur_foncee,1) .
'<r=' .
$GLOBALS['spip_lang_left'];
// CSS de secours en cas de non fonct de la suivante
$res = '<link rel="stylesheet" type="text/css" href="'
. find_in_path('style_prive_defaut.css')
. '" />' . "\n"
// CSS espace prive : la vraie
. '<link rel="stylesheet" type="text/css" href="'
. generer_url_public('style_prive', $args) .'" />' . "\n"
// CSS calendrier
. find_in_path('agenda.css') .'" />' . "\n"
// CSS imprimante (masque des trucs, a completer)
. '<link rel="stylesheet" type="text/css" href="'
. find_in_path('spip_style_print.css')
. '" media="print" />' . "\n"
Fil
a validé
// CSS "visible au chargement" differente selon js actif ou non
. '<link rel="stylesheet" type="text/css" href="'
. find_in_path('spip_style_'
. (_SPIP_AJAX ? 'invisible' : 'visible')
. '.css')
.'" />' . "\n"
Fil
a validé
// favicon.ico
. url_absolue(find_in_path('favicon.ico'))
. "\" />\n";
$js = debut_javascript($connect_toutes_rubriques,
($GLOBALS['meta']["activer_statistiques"] != 'non'));
if ($spip_display == 4) return $res . $js;
$nom = entites_html($nom_site_spip);
$res .= "<link rel='alternate' type='application/rss+xml' title=\"$nom\" href='"
. generer_url_public('backend') . "' />\n";
$res .= "<link rel='help' type='text/html' title=\""._T('icone_aide_ligne') .
"\" href='"
. generer_url_ecrire('aide_index',"var_lang=$spip_lang")
."' />\n";
if ($GLOBALS['meta']["activer_breves"] != "non")
$res .= "<link rel='alternate' type='application/rss+xml' title=\""
. $nom
. " ("._T("info_breves_03")
. ")\" href='" . generer_url_public('backend-breves') . "' />\n";
return $res . $js;
// http://doc.spip.org/@debut_javascript
function debut_javascript($admin, $stat)
{
global $spip_lang_left, $browser_name, $browser_version;
// tester les capacites JS :
// On envoie un script ajah ; si le script reussit le cookie passera a +1
// on installe egalement un <noscript></noscript> qui charge une image qui
// pose un cookie valant -1
$testeur = generer_url_ecrire('test_ajax', 'var_ajaxcharset=utf-8&js=1');
define('_TESTER_NOSCRIPT',
"<noscript>\n<div style='display:none;'><img src='"
. generer_url_ecrire('test_ajax', 'var_ajaxcharset=utf-8&js=-1')
. "' width='1' height='1' alt='' /></div></noscript>\n");
// envoi le fichier JS de config si browser ok.
$GLOBALS['browser_layer'] .
((isset($_COOKIE['spip_accepte_ajax']) && $_COOKIE['spip_accepte_ajax'] >= 1)
: "$.ajax('GET', '$testeur')") .
"\nvar ajax_image_searching = \n'<div style=\"float: ".$GLOBALS['spip_lang_right'].";\"><img src=\"".url_absolue(_DIR_IMG_PACK."searching.gif")."\" alt=\"\" /></div>';" .
"\nvar stat = " . ($stat ? 1 : 0) .
"\nvar largeur_icone = " .
intval(_LARGEUR_ICONES_BANDEAU) .
"\nvar bug_offsetwidth = " .
// uniquement affichage ltr: bug Mozilla dans offsetWidth quand ecran inverse!
((($spip_lang_left == "left") &&
(($browser_name != "MSIE") ||
($browser_version >= 6))) ? 1 : 0) .
"\nvar confirm_changer_statut = '" .
unicode_to_javascript(addslashes(html2unicode(_T("confirm_changer_statut")))) .
"';\n") .
http_script('',_DIR_JAVASCRIPT . 'presentation.js');
// Fonctions onglets
// http://doc.spip.org/@debut_onglet
function debut_onglet(){
\n<div style='padding: 7px;'><table cellpadding='0' cellspacing='0' border='0' align='center'><tr>
// http://doc.spip.org/@fin_onglet
function fin_onglet(){
// http://doc.spip.org/@onglet
function onglet($texte, $lien, $onglet_ref, $onglet, $icone=""){
$res .= "\n<div style='position: relative;'>";
if ($spip_display != 1) {
if (strlen($icone) > 0) {
$res .= "\n<div style='z-index: 2; position: absolute; top: 0px; $spip_lang_left: 5px;'>" .
esj
a validé
http_img_pack("$icone", "", "") . "</div>";
$style = " top: 7px; padding-$spip_lang_left: 32px; z-index: 1;";
} else {
$style = " top: 7px;";
$res .= "\n<div onmouseover=\"changeclass(this, 'onglet_on');\" onmouseout=\"changeclass(this, 'onglet');\" class='onglet' style='position: relative;$style'><a href='$lien'>$texte</a></div>";
$res .= "\n<div style='position: relative;'>";
if ($spip_display != 1) {
if (strlen($icone) > 0) {
$res .= "\n<div style='z-index: 2; position: absolute; top: 0px; $spip_lang_left: 5px;'>" .
esj
a validé
http_img_pack("$icone", "", "") . "</div>";
$style = " top: 7px; padding-$spip_lang_left: 32px; z-index: 1;";
} else {
$style = " top: 7px;";
$res .= "\n<div class='onglet_off' style='position: relative;$style'>$texte</div>";
// http://doc.spip.org/@icone
global $spip_display;
if ($fonction == "supprimer.gif") {
$style = '-danger';
} else {
$style = '';
if (strlen($fonction) < 3) $fonction = "rien.gif";
}
if ($spip_display == 1){
$hauteur = 20;
esj
a validé
$title = $alt = "";
}
else if ($spip_display == 3){
$hauteur = 30;
$largeur = 30;
$title = "\ntitle=\"$texte\"";
esj
a validé
$alt = $texte;
}
else {
$hauteur = 70;
esj
a validé
$title = '';
esj
a validé
$alt = $texte;
if ($spip_display != 1 AND $spip_display != 4){
if ($fonction != "rien.gif"){
$icone = http_img_pack($fonction, $alt, "$title width='24' height='24'\n" .
esj
a validé
http_style_background($fond, "no-repeat center center"));
}
else {
Fil
a validé
$icone = http_img_pack($fond, $alt, "$title width='24' height='24'");
}
} else $icone = '';
if ($spip_display != 3){
// cas d'ajax_action_auteur: faut defaire le boulot
// (il faudrait fusionner avec le cas $javascript)
if (preg_match(",^<a\shref='([^']*)'([^>]*)>(.*)</a>$,i",$lien,$r))
list($x,$lien,$atts,$texte)= $r;
else $atts = '';
$lien = "\nhref='$lien'$atts";
$icone = "\n<table cellpadding='0' class='pointeur' cellspacing='0' border='0' width='$largeur'"
. ((strlen($align) > 2) ? " align='$align' " : '')
. ">\n<tr><td class='icone36$style' style='text-align:center;'><a"
. $lien
. '>'
. $icone
. "</a></td></tr></table>\n";
if ($afficher == 'oui') echo $icone; else return $icone;
// http://doc.spip.org/@icone_horizontale
function icone_horizontale($texte, $lien, $fond = "", $fonction = "", $af = true, $javascript='') {
global $spip_display;
Fil
a validé
$retour = '';
// cas d'ajax_action_auteur: faut defaire le boulot
// (il faudrait fusionner avec le cas $javascript)
if (preg_match(",^<a href='([^']*)'([^>]*)>(.*)</a>$,i",$lien,$r))
list($x,$lien,$atts,$texte)= $r;
else $atts = '';
$lien = "\nhref='$lien'$atts";
if ($spip_display != 4) {
if ($spip_display != 1) {
$retour .= "\n<table class='cellule-h-table' cellpadding='0' style='vertical-align: middle'>"
. "\n<tr><td><a $javascript$lien class='cellule-h'>"
. "<span class='cell-i'>" ;
if ($fonction){
$retour .= http_img_pack($fonction, $texte, http_style_background($fond, "center center no-repeat"));
}
else {
$retour .= http_img_pack($fond, $texte, "");
}
$retour .= "</span></a></td>"
. "\n<td class='cellule-h-lien'><a $javascript$lien class='cellule-h'>"
. "</a></td></tr></table>\n";
$retour .= "\n<div><a class='cellule-h-texte' $javascript$lien>$texte</a></div>\n";
if ($fonction == "supprimer.gif")
$retour = "\n<div class='danger'>$retour</div>";
$retour = "<li><a$lien>$texte</a></li>";
ARNO*
a validé
}
Fil
a validé
if ($af) echo $retour; else return $retour;
}
// http://doc.spip.org/@gros_titre
function gros_titre($titre, $ze_logo='', $aff=true){
global $couleur_foncee, $spip_display;
if ($spip_display == 4) {
$res = "\n<h1>".typo($titre)."</h1> \n";
}
else {
$res = "\n<div class='verdana2' style='font-size: 18px; color: $couleur_foncee; font-weight: bold;'>" .
(strlen($ze_logo) <= 3 ? '': (http_img_pack($ze_logo, "", "align='middle'") . " ")) .
typo($titre) .
"</div>\n";
if ($aff) echo $res; else return $res;
}
//
// Cadre centre (haut de page)
//
// http://doc.spip.org/@debut_grand_cadre
function debut_grand_cadre($return=false){
global $spip_ecran;
if ($spip_ecran == "large") $largeur = 974;
else $largeur = 750;
$res = "\n<br /><br />\n<table width='$largeur' cellpadding='0' cellspacing='0' border='0'>\n<tr><td width='$largeur' class='serif'>";
if ($return) return $res; else echo $res;
// http://doc.spip.org/@fin_grand_cadre
function fin_grand_cadre($return=false){
$res = "\n</td></tr></table>";
if ($return) return $res; else echo $res;
}
// Cadre formulaires
// http://doc.spip.org/@debut_cadre_formulaire
function debut_cadre_formulaire($style='', $return=false){
$x = "\n<div class='cadre-formulaire'" .
if ($return) return $x; else echo $x;
// http://doc.spip.org/@fin_cadre_formulaire
function fin_cadre_formulaire($return=false){
if ($return) return "</div>\n"; else echo "</div>\n";
}
// http://doc.spip.org/@debut_gauche
function debut_gauche($rubrique = "accueil", $return=false) {
global $connect_statut;
global $options, $spip_display;
global $connect_id_auteur;
global $flag_3_colonnes, $flag_centre_large;
$flag_3_colonnes = false;
$largeur = 200;
// Ecran panoramique ?
if (ereg('((articles|breves|rubriques)_edit|forum_envoi)', $GLOBALS['REQUEST_URI'])) {
$rspan = " rowspan='2'";
$rspan = '';
$res = "<br /><table width='$largeur_ecran' cellpadding='0' cellspacing='0' border='0'>
<tr>\n<td width='$largeur' class='colonne_etroite serif' valign='top' $rspan>
\n<div style='width: ${largeur}px; overflow:hidden;'>
if ($spip_display == 4) $res .= "<!-- ";
if ($return) return $res; else echo $res;
}
//
// Presentation de l''interface privee, marge de droite
//
// http://doc.spip.org/@creer_colonne_droite
function creer_colonne_droite($rubrique="", $return= false){
static $deja_colonne_droite;
global $flag_3_colonnes, $flag_centre_large;
if ((!$flag_3_colonnes) OR $deja_colonne_droite) return '';
$deja_colonne_droite = true;
if ($flag_centre_large) {
$espacement = 17;
} else {
$res = "\n<td width='"
. $espacement
. "' rowspan='2' class='colonne_etroite'> </td>"
. "\n<td rowspan='1' class='colonne_etroite'></td>"
. "\n<td width='"
. $espacement
. "' rowspan='2' class='colonne_etroite'> </td>"
. "\n<td width='"
. $largeur
. "' rowspan='2' align='"
. $spip_lang_left
. "' valign='top' class='colonne_etroite'><p />";
if ($return) return $res; else echo $res;
// http://doc.spip.org/@debut_droite
function debut_droite($rubrique="", $return= false) {
global $options, $spip_ecran, $spip_display;
global $spip_lang_left, $couleur_foncee, $couleur_claire;
global $flag_3_colonnes, $flag_centre_large;
$res = '';
if ($spip_display == 4) $res .= " -->";
$res .= "</div>\n"; # largeur fixe, cf. debut_gauche
if ($options == "avancees") {
$res .= liste_articles_bloques();
$res .= "\n<div> </div></td>";
$res .= "<td width='50'> </td>";
$res .= creer_colonne_droite($rubrique, true)
if ($spip_ecran == 'large' AND $flag_centre_large)
$largeur = 600;
$res .= "\n<td width=\"".$largeur.'" valign="top" align="'.$spip_lang_left.'" rowspan="1" class="serif">';
// touche d'acces rapide au debut du contenu
$res .= "\n<a name='saut' href='#saut' accesskey='s'></a>\n";
if ($return) return $res; else echo $res;
}
Christian Lefebvre
a validé
// http://doc.spip.org/@liste_articles_bloques
function liste_articles_bloques()
{
global $connect_id_auteur, $couleur_foncee;
$res = '';
if ($GLOBALS['meta']["articles_modif"] != "non") {
include_spip('inc/drapeau_edition');
$articles_ouverts = liste_drapeau_edition ($connect_id_auteur, 'article');
if (count($articles_ouverts)) {
$res .= "\n<div> </div>"
. "\n<div class='bandeau_rubriques' style='z-index: 1;'>"
. bandeau_titre_boite2('<b>' . _T('info_cours_edition') . '</b>', "article-24.gif", $couleur_foncee, 'white', false)
. "\n<div class='plan-articles-bloques'>";
foreach ($articles_ouverts as $row) {
$ze_article = $row['id_article'];
$ze_titre = $row['titre'];
$statut = $row["statut"];
$res .= "\n<div class='$statut'><a style='font-size: 10px;' href='"
. generer_url_ecrire("articles","id_article=$ze_article")
. "'>$ze_titre</a>"
. "\n<div style='text-align:right; font-size: 9px;'>"
. debloquer_article($ze_article,_T('lien_liberer'))
. "</div>"
. "</div>";
}
$res .= "</div></div>";
}
}
return $res;
}
//
// Fin de page de l'interface privee.
// Elle comporte une image invisble declenchant une tache de fond
// http://doc.spip.org/@fin_page
function fin_page() {
return "</td></tr></table>"
. debut_grand_cadre(true)
. (($spip_display == 4)
? ("<div><a href='./?set_disp=2'>"
. _T("access_interface_graphique")
. "</a></div>")
: ('<div style="text-align: right; font-family: Verdana; font-size: 8pt">'
. info_copyright()
. "<br />"
. _T('info_copyright_doc')
. '</div>'))
. fin_grand_cadre(true)
. "</div>" // cf. <div center> ouverte dans conmmencer_page()
. $GLOBALS['rejoue_session']
. '<div style="background-image: url(\''
. generer_url_action('cron')
. '\');"></div>'
. (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '')
. "</body></html>\n";
// http://doc.spip.org/@debloquer_article
$lien = parametre_url(self(), 'debloquer_article', $arg, '&');
return "<a href='" .
generer_action_auteur('instituer_collaboration',$arg, _DIR_RESTREINT_ABS . $lien) .
"' title=\"" .
entites_html($texte) .
"\">$texte " .
http_img_pack("croix-rouge.gif", ($arg=='tous' ? "" : "X"),
"width='7' height='7' align='baseline'") .
Christian Lefebvre
a validé
// http://doc.spip.org/@meme_rubrique
function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30)
{
global $options;
if ($options != "avancees") return '';
$table = $type . 's';
$key = 'id_' . $type;
$voss = spip_query("SELECT $key AS id, titre, statut FROM spip_$table WHERE id_rubrique=$id_rubrique AND (statut = 'publie' OR statut = 'prop') AND ($key != $id) ORDER BY $order DESC LIMIT $limit");
if (!spip_num_rows($voss)) return '';
$retour = '';
while($row = spip_fetch_array($voss)) {
$n = $row['id'];
$retour .= afficher_numero_edit($n, $key, $type)
. "<a class='"
. $row['statut']
. "' style='font-size: 10px;' href='"
. generer_url_ecrire($table,"$key=$n")
. "'>"
. typo($row['titre'])
. "</a>";
}
return "\n<div> </div>"
. "\n<div class='bandeau_rubriques' style='z-index: 1;'>"
. bandeau_titre_boite2('<b>' . _T('info_meme_rubrique') . '</b>', "article-24.gif",'','',false)
. "\n<div class='plan-articles'>"
. $retour
. "</div></div>";
}
function afficher_numero_edit($id, $key, $type)
{
global $spip_lang_right, $spip_lang_left;
static $numero , $style='' ;
if (!$style) {
$style = " style='float: $spip_lang_right; padding-$spip_lang_left: 4px;font-size: 10px; color: black; '";
$numero = _T('info_numero_abbreviation');
}
if (!autoriser('modifier',$type,$id)) {
$bal ='span';
$href = '';
} else {
$bal = 'a';
$href = "\nhref='"
. generer_url_ecrire($type . "s_edit","$key=$id")
. "'";
}
return "<$bal$style$href><b>"
. $numero
. $id
. "</b></$bal>";
}
//
// Afficher la hierarchie des rubriques
//
// http://doc.spip.org/@afficher_hierarchie
function afficher_hierarchie($id_rubrique) {
$parents = '';
$style1 = "$spip_lang_left center no-repeat; padding-$spip_lang_left: 15px";
$style2 = "margin-$spip_lang_left: 15px;";
while ($id_rubrique) {
$res = spip_fetch_array(spip_query("SELECT id_parent, titre, lang FROM spip_rubriques WHERE id_rubrique=$id_rubrique"));
if (!$res) break; // rubrique inexistante
$id_parent = $res['id_parent'];
changer_typo($res['lang']);
$logo = (!$id_parent) ? "secteur-12.gif"
: (acces_restreint_rubrique($id_rubrique)
? "admin-12.gif" : "rubrique-12.gif");
$parents = "\n<div class='verdana3' "
. http_style_background($logo, $style1)
. "><a href='"
. generer_url_ecrire("naviguer","id_rubrique=$id_rubrique")
. "'>"
. typo(sinon($res['titre'], _T('ecrire:info_sans_titre')))
. "</a></div>\n<div style='$style2'>"
. $parents
. "</div>";
$id_rubrique = $id_parent;
return "\n<div class='verdana3' " .
http_style_background("racine-site-12.gif", $style1).
"><a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "'><b>"._T('lien_racine_site')."</b></a>".aide ("rubhier")."</div>\n<div style='$style2'>".$parents."</div>";
// http://doc.spip.org/@enfant_rub
function enfant_rub($collection){
global $couleur_foncee, $lang_dir;
global $spip_display, $spip_lang_left, $spip_lang_right, $spip_lang;
$voir_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non");
if ($voir_logo) {
$voir_logo = "float: $spip_lang_right; margin-$spip_lang_right: -6px; margin-top: -6px;";
$chercher_logo = charger_fonction('chercher_logo', 'inc');
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
} else $logo ='';
$les_enfants = "";
$res = spip_query("SELECT id_rubrique, id_parent, titre, descriptif, lang FROM spip_rubriques WHERE id_parent='$collection' ORDER BY 0+titre,titre");
while($row=spip_fetch_array($res)){
$id_rubrique=$row['id_rubrique'];
$id_parent=$row['id_parent'];
$titre=$row['titre'];
$les_sous_enfants = sous_enfant_rub($id_rubrique);
changer_typo($row['lang']);
$descriptif=propre($row['descriptif']);
if ($spip_display == 4) $les_enfants .= "<li>";
if ($voir_logo) {
if ($logo = $chercher_logo($id_rubrique, 'id_rubrique', 'on')) {
list($fid, $dir, $nom, $format) = $logo;
$logo = ratio_image($fid, $nom, $format, 48, 36, "alt=''");
if ($logo)
$logo = "\n<div style='$voir_logo'>$logo</div>";
}
}
$les_enfants .= "\n<div class='enfants'>" .
debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true) .
(is_string($logo) ? $logo : '') .
(!$les_sous_enfants ? "" : bouton_block_invisible("enfants$id_rubrique")) .
(!acces_restreint_rubrique($id_rubrique) ? "" :
http_img_pack("admin-12.gif", '', " width='12' height='12'", _T('image_administrer_rubrique'))) .
" <span dir='$lang_dir'><b><a href='" .
generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") .
"'><font color='$couleur_foncee'>".
typo($titre) .
"</font></a></b></span>" .
(!$descriptif ? '' : "\n<div class='verdana1'>$descriptif</div>");
if ($spip_display != 4) $les_enfants .= $les_sous_enfants;
$les_enfants .= "\n<div style='clear:both;'></div>" .
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
fin_cadre_sous_rub(true) .
"</div>";
if ($spip_display == 4) $les_enfants .= "</li>";
}
changer_typo($spip_lang); # remettre la typo de l'interface pour la suite
return (($spip_display == 4) ? "<ul> $les_enfants</ul>" : $les_enfants);
}
// http://doc.spip.org/@sous_enfant_rub
function sous_enfant_rub($collection2){
global $lang_dir, $spip_lang_dir, $spip_lang_left;
$result3 = spip_query("SELECT * FROM spip_rubriques WHERE id_parent='$collection2' ORDER BY 0+titre,titre");
if (!spip_num_rows($result3)) return '';
$retour = debut_block_invisible("enfants$collection2")."\n<ul style='margin: 0px; padding: 0px; padding-top: 3px;'>\n";
while($row=spip_fetch_array($result3)){
$id_rubrique2=$row['id_rubrique'];
$id_parent2=$row['id_parent'];
$titre2=$row['titre'];
changer_typo($row['lang']);
$retour.="\n<li><div class='arial11' " .
http_style_background('rubrique-12.gif', "left center no-repeat; padding: 2px; padding-$spip_lang_left: 18px; margin-$spip_lang_left: 3px") . "><a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique2") . "'><span dir='$lang_dir'>".typo($titre2)."</span></a></div></li>\n";
}
$retour .= "</ul>\n\n".fin_block()."\n\n";
return $retour;
}
// http://doc.spip.org/@afficher_enfant_rub
function afficher_enfant_rub($id_rubrique, $bouton=false, $return=false) {
global $spip_lang_right;
$les_enfants = enfant_rub($id_rubrique);
$n = strlen($les_enfants);
$les_enfants2=substr($les_enfants,round($n/2));
if (strpos($les_enfants2,"\n<div class='enfants'>")){
$les_enfants2=substr($les_enfants2,strpos($les_enfants2,"\n<div class='enfants'>"));
$n2 = strlen($les_enfants2);
$les_enfants=substr($les_enfants,0,$n-$n2);
}else{
$les_enfants2="";
}
$res = "\n<div> </div>"
. "\n<table cellpadding='0' cellspacing='0' border='0' width='100%'>"
. "\n<tr><td valign='top' width='50%' rowspan='2'>"
. $les_enfants
. "</td>"
. "\n<td width='20' rowspan='2'>"
. http_img_pack("rien.gif", ' ', "width='20'")
. "</td>\n"
. "\n<td valign='top' width='50%'>"
. $les_enfants2
. " "
. "</td></tr>"
. "\n<tr><td style='text-align: "
. $spip_lang_right