Skip to content
Extraits de code Groupes Projets
Valider 4e21169e rédigé par esj's avatar esj
Parcourir les fichiers

menage

parent 75360d16
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -226,73 +226,65 @@ function calculer_langues_rubriques() {
function enfant_rub($collection){
global $les_enfants, $couleur_foncee, $lang_dir;
global $couleur_foncee, $lang_dir;
global $spip_display, $spip_lang_left, $spip_lang_right, $spip_lang;
global $connect_id_auteur;
$query2 = "SELECT * FROM spip_rubriques WHERE id_parent='$collection' ORDER BY 0+titre,titre";
$result2 = spip_query($query2);
if ($spip_display == 4) $les_enfants .= "<ul>";
$voir_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non");
if ($voir_logo) include_spip('inc/logos');
if ($voir_logo) {
$voir_logo = "float: $spip_lang_right; margin-$spip_lang_right: -6px; margin-top: -6px;";
include_spip('inc/logos');
}
while($row=spip_fetch_array($result2)){
$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'];
$bouton_layer = bouton_block_invisible("enfants$id_rubrique");
$les_sous_enfants = sous_enfant_rub($id_rubrique);
changer_typo($row['lang']);
$descriptif=propre($row['descriptif']);
if ($spip_display == 4) $les_enfants .= "<li>";
$les_enfants.= "<div class='enfants'>";
if ($id_parent == "0") $logo_rub = "secteur-24.gif";
else $logo_rub = "rubrique-24.gif";
$les_enfants .= debut_cadre_sous_rub($logo_rub, true);
if ($voir_logo)
$les_enfants .= baliser_logo("rub", $id_rubrique, 48, 36, "float: $spip_lang_right; margin-$spip_lang_right: -6px; margin-top: -6px;");
if (strlen($les_sous_enfants) > 0){
$les_enfants .= $bouton_layer;
}
if (acces_restreint_rubrique($id_rubrique))
$les_enfants .= http_img_pack("admin-12.gif", '', "width='12' height='12'", _T('image_administrer_rubrique'));
$les_enfants.= "<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>";
if (strlen($descriptif)) {
$les_enfants .= "<div class='verdana1'>$descriptif</div>";
}
if ($spip_display != 4) $les_enfants .= $les_sous_enfants;
$les_enfants .= "<div class='enfants'>" .
debut_cadre_sous_rub(($id_parent ? "rubrique-24.gif" : "secteur-24.gif"), true) .
(!$voir_logo ? "" :
baliser_logo("rub", $id_rubrique, 48, 36, $voir_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 ? '' : "<div class='verdana1'>$descriptif</div>");
if ($spip_display != 4) $les_enfants .= $les_sous_enfants;
$les_enfants .= "<div style='clear:both;'></div>";
$les_enfants .= "<div style='clear:both;'></div>" .
fin_cadre_sous_rub(true) .
"</div>";
$les_enfants .= fin_cadre_sous_rub(true);
$les_enfants .= "</div>";
if ($spip_display == 4) $les_enfants .= "</li>";
}
if ($spip_display == 4) $les_enfants .= "</ul>";
changer_typo($spip_lang); # remettre la typo de l'interface pour la suite
return (($spip_display == 4) ? "<ul> $les_enfants</ul>" : $les_enfants);
}
function sous_enfant_rub($collection2){
global $lang_dir, $spip_lang_dir, $spip_lang_left;
$query3 = "SELECT * FROM spip_rubriques WHERE id_parent='$collection2' ORDER BY 0+titre,titre";
$result3 = spip_query($query3);
$result3 = spip_query("SELECT * FROM spip_rubriques WHERE id_parent='$collection2' ORDER BY 0+titre,titre");
if (spip_num_rows($result3) > 0){
$retour = debut_block_invisible("enfants$collection2")."\n<ul style='margin: 0px; padding: 0px; padding-top: 3px;'>\n";
......@@ -312,39 +304,45 @@ function sous_enfant_rub($collection2){
}
function afficher_enfant_rub($id_rubrique, $afficher_bouton_creer=false) {
global $les_enfants, $spip_lang_right;
enfant_rub($id_rubrique);
global $spip_lang_right;
$les_enfants2=substr($les_enfants,round(strlen($les_enfants)/2),strlen($les_enfants));
$les_enfants = enfant_rub($id_rubrique);
$n = strlen($les_enfants);
$les_enfants2=substr($les_enfants,round($n/2));
if (strpos($les_enfants2,"<div class='enfants'>")){
$les_enfants2=substr($les_enfants2,strpos($les_enfants2,"<div class='enfants'>"),strlen($les_enfants2));
$les_enfants1=substr($les_enfants,0,strlen($les_enfants)-strlen($les_enfants2));
$les_enfants2=substr($les_enfants2,strpos($les_enfants2,"<div class='enfants'>"));
$n2 = strlen($les_enfants2);
$les_enfants=substr($les_enfants,0,$n-$n2);
}else{
$les_enfants1=$les_enfants;
$les_enfants2="";
}
// Afficher les sous-rubriques
echo "<div>&nbsp;</div>";
echo "<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
echo "<tr><td valign='top' width=50% rowspan=2>$les_enfants1</td>";
echo "<td width='20' rowspan='2'>", http_img_pack("rien.gif", ' ', "width='20'") ."</td>\n";
echo "<td valign='top' width='50%'>$les_enfants2 &nbsp;";
if (strlen($les_enfants2) > 0) echo "<p>";
echo "</td></tr>";
echo "<tr><td style='text-align: $spip_lang_right;' valign='bottom'><div align='$spip_lang_right'>";
echo "<div>&nbsp;</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,
"&nbsp;",
"</td></tr>",
"\n<tr><td style='text-align: ",
$spip_lang_right,
";' valign='bottom'><div align='",
$spip_lang_right,
"'>";
if ($afficher_bouton_creer) {
if ($id_rubrique == "0") icone(_T('icone_creer_rubrique'), generer_url_ecrire("rubriques_edit","new=oui&retour=nav"), "secteur-24.gif", "creer.gif");
if ($id_rubrique == "0")
icone(_T('icone_creer_rubrique'), generer_url_ecrire("rubriques_edit","new=oui&retour=nav"), "secteur-24.gif", "creer.gif");
else icone(_T('icone_creer_sous_rubrique'), generer_url_ecrire("rubriques_edit","new=oui&retour=nav&id_parent=$id_rubrique"), "rubrique-24.gif", "creer.gif");
echo "<p>";
}
echo "</div></td></tr>";
echo "</table><p />";
//////
echo "</div></td></tr></table>";
}
function calcul_generation ($generation) {
......@@ -387,7 +385,7 @@ function selecteur_rubrique($id_rubrique, $type, $restreint, $idem=0) {
if (false /* mettre true pour desactiver ajax */
OR $_COOKIE['spip_accepte_ajax'] < 1
OR spip_num_rows(
spip_query("SELECT id_rubrique FROM spip_rubriques")) < 20)
spip_query("SELECT id_rubrique FROM spip_rubriques LIMIT 21")) < 20)
return selecteur_rubrique_html($id_rubrique, $type, $restreint, $idem);
else
......@@ -506,18 +504,12 @@ function selecteur_rubrique_html($id_rubrique, $type, $restreint, $idem=0) {
// creer une structure contenant toute l'arborescence
//
# oblige les breves a resider a la racine
if ($type == 'breve') $where = 'WHERE id_parent=0';
$q = spip_query("SELECT
id_rubrique, id_parent, titre, statut, lang, langue_choisie
FROM spip_rubriques
$where
ORDER BY 0+titre,titre");
$q = spip_query("SELECT id_rubrique, id_parent, titre, statut, lang, langue_choisie FROM spip_rubriques " .
($type == 'breve' ? 'WHERE id_parent=0 ' : '') .
"ORDER BY 0+titre,titre");
while ($r = spip_fetch_array($q)) {
// titre largeur maxi a 50
$titre = couper(supprimer_tags(typo(extraire_multi(
$r['titre']
$titre = couper(supprimer_tags(typo(extraire_multi($r['titre']
)))." ", 50);
if ($GLOBALS['meta']['multi_rubriques'] == 'oui'
AND ($r['langue_choisie'] == "oui" OR $r['id_parent'] == 0))
......@@ -560,8 +552,7 @@ function selecteur_rubrique_ajax($id_rubrique, $type, $restreint, $idem=0) {
$exclus = "&exclus=$idem&rac=oui";
if ($id_rubrique)
list($titre_parent) = spip_fetch_array(spip_query(
"SELECT titre FROM spip_rubriques WHERE id_rubrique=$id_rubrique"));
list($titre_parent) = spip_fetch_array(spip_query("SELECT titre FROM spip_rubriques WHERE id_rubrique=$id_rubrique"));
else if ($type == 'auteur')
$titre_parent = '&nbsp;';
else
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter