Skip to content
Extraits de code Groupes Projets
Valider 059243d7 rédigé par ARNO*'s avatar ARNO*
Parcourir les fichiers

AJAX:

- selection correcte de la racine du site
- bouton choisir en _T()
- cosmetique: affichage des informations de la rubrique
parent 89014564
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -30,20 +30,44 @@ echo "<"."?xml version='1.0' encoding='$charset'?>"; ...@@ -30,20 +30,44 @@ echo "<"."?xml version='1.0' encoding='$charset'?>";
// echo "$type - $id - $rac"; // echo "$type - $id - $rac";
if ($type == "rubrique") { if ($type == "rubrique") {
$res = spip_query("SELECT titre FROM spip_rubriques WHERE id_rubrique = $id"); $res = spip_query("SELECT titre, descriptif FROM spip_rubriques WHERE id_rubrique = $id");
if ($row = spip_fetch_array($res)) { if ($row = spip_fetch_array($res)) {
$titre = addslashes(typo($row["titre"])); $titre = addslashes(typo($row["titre"]));
$descriptif = propre($row["descriptif"]);
} else {
$titre = addslashes(_T('info_racine_site'));
} }
} }
echo "<div style='display: none;'>"; echo "<div style='display: none;'>";
echo "<input type='text' id='".$rac."_sel' value='$id' />"; echo "<input type='text' id='".$rac."_sel' value='$id' />";
echo "<input type='text' id='".$rac."_sel2' value='$titre' />"; echo "<input type='text' id='".$rac."_sel2' value='$titre' />";
echo "</div>"; echo "</div>";
echo "<b>$titre</b>";
include_ecrire ("inc_logos.php3");
echo "<div class='arial2' style='padding: 5px; background-color: white; border: 1px solid $couleur_foncee; border-top: 0px;'>";
if ($type == "rubrique" AND $spip_display != 1 AND $spip_display!=4 AND lire_meta('image_process') != "non") {
include_ecrire("inc_logos.php3");
$logo = decrire_logo("rubon$id");
if ($logo) {
$fichier = $logo[0];
echo "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>";
echo reduire_image_logo(_DIR_IMG.$fichier, 100, 48);
echo "</div>";
}
}
echo "<div><p><b>$titre</b></p></div>";
if (strlen($descriptif) > 0) echo "<div>$descriptif</div>";
echo "</div>";
echo "<div style='text-align: $spip_lang_right;'>"; echo "<div style='text-align: $spip_lang_right;'>";
echo "<input type='button' value='Choisir' class='fondo' onClick=\"sel=findObj_forcer('".$rac."_sel').value; sel2=findObj_forcer('".$rac."_sel2').value; func = findObj('".$rac."_fonc').value; func = func.replace('::sel::', sel); func = func.replace('::sel2::', sel2); eval(func);\">"; echo "<input type='button' value='"._T('bouton_choisir')."' class='fondo' onClick=\"sel=findObj_forcer('".$rac."_sel').value; sel2=findObj_forcer('".$rac."_sel2').value; func = findObj('".$rac."_fonc').value; func = func.replace('::sel::', sel); func = func.replace('::sel2::', sel2); eval(func);\">";
echo "</div>"; echo "</div>";
} }
......
...@@ -138,7 +138,8 @@ function mini_nav ($sel, $rac="", $fonction="document.location='naviguer.php3?id ...@@ -138,7 +138,8 @@ function mini_nav ($sel, $rac="", $fonction="document.location='naviguer.php3?id
$ret .= "</div>\n"; $ret .= "</div>\n";
if ($aff_racine) { if ($aff_racine) {
$ret .= "<div class='arial11 petite-rubrique' style='background-image: url(" . _DIR_IMG_PACK . "racine-site-12.gif); background-color: white; border: 1px solid $couleur_foncee; border-bottom: 0px;'><div class='pashighlight'>"; $onClick .= " aff_selection('rubrique','$rac', '0');";
$ret .= "<div class='arial11 petite-rubrique' onclick=\"$onClick\" style='background-image: url(" . _DIR_IMG_PACK . "racine-site-12.gif); background-color: white; border: 1px solid $couleur_foncee; border-bottom: 0px;'><div class='pashighlight'>";
$ret .= _T("info_racine_site"); $ret .= _T("info_racine_site");
$ret .= "</div></div>"; $ret .= "</div></div>";
} }
......
...@@ -174,38 +174,42 @@ debut_cadre_couleur("$logo_parent", false, '', _T('entree_interieur_rubrique').a ...@@ -174,38 +174,42 @@ debut_cadre_couleur("$logo_parent", false, '', _T('entree_interieur_rubrique').a
//echo "<input type='text' size='10' style='font-size: 90%; width: 15%;' onkeyup=\"filtery(this.value,this.form.id_parent);\" onChange=\"filtery(this.value,this.form.id_parent);\"> "; //echo "<input type='text' size='10' style='font-size: 90%; width: 15%;' onkeyup=\"filtery(this.value,this.form.id_parent);\" onChange=\"filtery(this.value,this.form.id_parent);\"> ";
/* if ($spip_display == 4) {
echo "<SELECT NAME='id_parent' style='font-size: 90%; width:80%; font-face:verdana,arial,helvetica,sans-serif; max-height: 24px;' SIZE=1>\n"; echo "<SELECT NAME='id_parent' style='font-size: 90%; width:80%; font-face:verdana,arial,helvetica,sans-serif; max-height: 24px;' SIZE=1>\n";
if ($connect_toutes_rubriques) { if ($connect_toutes_rubriques) {
echo "<OPTION".mySel("0",$id_parent). http_style_background('racine-site-12.gif', "$spip_lang_left no-repeat; background-color:$couleur_foncee; padding-$spip_lang_left: 16px; font-weight:bold; color:white") .'>'._T('info_racine_site')."\n"; echo "<OPTION".mySel("0",$id_parent). http_style_background('racine-site-12.gif', "$spip_lang_left no-repeat; background-color:$couleur_foncee; padding-$spip_lang_left: 16px; font-weight:bold; color:white") .'>'._T('info_racine_site')."\n";
} else {
echo "<OPTION".mySel("0",$id_parent).">"._T('info_non_deplacer')."\n";
}
if (lire_meta('multi_rubriques') == 'oui') echo " [".traduire_nom_langue(lire_meta('langue_site'))."]";
// si le parent ne fait pas partie des rubriques restreintes, modif impossible
if (acces_rubrique($id_parent)) {
enfant(0);
}
echo "</SELECT>\n";
} else { } else {
echo "<OPTION".mySel("0",$id_parent).">"._T('info_non_deplacer')."\n";
}
if (lire_meta('multi_rubriques') == 'oui') echo " [".traduire_nom_langue(lire_meta('langue_site'))."]";
// si le parent ne fait pas partie des rubriques restreintes, modif impossible
if (acces_rubrique($id_parent)) {
enfant(0);
}
echo "</SELECT>\n";
*/
$query = spip_query("SELECT titre FROM spip_rubriques WHERE id_rubrique=$id_parent");
if ($row = spip_fetch_array($query)) {
$titre_parent = entites_html(typo($row["titre"]));
} else {
$titre_parent = entites_html(_T("info_racine_site"));
}
echo "<table width='100%'><tr width='100%'><td width='45'>";
echo "<a href=\"javascript:findObj('selection_rubrique').style.display='block';charger_id_url('ajax_page.php?fonction=aff_parent&id_rubrique=$id_parent&exclus=$id_rubrique','selection_rubrique');\"><img src='img_pack/loupe.png' style='border: 0px; vertical-align: middle;' /></a> ";
echo "<img src='img_pack/searching.gif' id='img_selection_rubrique' style='visibility: hidden;'>";
echo "</td><td>";
echo "<input type='text' id='titreparent' name='titreparent' disabled='disabled' class='forml' value=\"$titre_parent\" />";
echo "<input type='hidden' id='id_parent' name='id_parent' value='$id_parent' />";
echo "</td></tr></table>";
echo "<div id='selection_rubrique' style='display: none;'></div>";
$query = spip_query("SELECT titre FROM spip_rubriques WHERE id_rubrique=$id_parent");
if ($row = spip_fetch_array($query)) {
$titre_parent = entites_html(typo($row["titre"]));
} else {
$titre_parent = entites_html(_T("info_racine_site"));
} }
echo "<a href=\"javascript:findObj('selection_rubrique').style.display='block';charger_id_url('ajax_page.php?fonction=aff_parent&id_rubrique=$id_parent&exclus=$id_rubrique','selection_rubrique');\"><img src='img_pack/loupe.png' style='border: 0px; vertical-align: middle;' /></a> ";
echo "<img src='img_pack/searching.gif' id='img_selection_rubrique' style='visibility: hidden;'>";
echo "<input type='hidden' id='id_parent' name='id_parent' value='$id_parent' />";
echo "<input type='text' id='titreparent' name='titreparent' disabled='disabled' class='forml' value=\"$titre_parent\" />";
echo "<div id='selection_rubrique' style='display: none;'></div>";
//include_ecrire("inc_mini_nav.php"); //include_ecrire("inc_mini_nav.php");
//echo mini_nav ($id_parent, "choix-parent", "this.form.id_parent.value=::sel::;this.form.titreparent.value='::sel2::';", $id_rubrique, $aff_racine=true); //echo mini_nav ($id_parent, "choix-parent", "this.form.id_parent.value=::sel::;this.form.titreparent.value='::sel2::';", $id_rubrique, $aff_racine=true);
......
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