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

harmonisation, surcharge et optimisation des appels d'Ajax

parent 046828e5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -9,216 +9,37 @@ ...@@ -9,216 +9,37 @@
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/ \***************************************************************************/
#var_dump($_GET);
include ("inc.php3"); include ("inc.php3");
include_ecrire("inc_presentation.php3");
include_ecrire("inc_texte.php3");
include_ecrire("inc_urls.php3");
include_ecrire("inc_rubriques.php3");
# gerer un charset minimaliste en convertissant tout en unicode &#xxx;
if ($flag_ob) {
ob_start();
}
$charset = lire_meta("charset");
@header('Content-type: text/html; charset=$charset');
echo "<"."?xml version='1.0' encoding='$charset'?".">\n";
// securite $var_nom = 'ajax_page';
$id_rubrique = intval($id_rubrique); $var_f = find_in_path('inc_' . $var_nom . '.php');
$id = intval($id);
$rac = htmlentities($rac);
$exclus = intval($exclus);
$col = intval($col);
if ($var_f)
include($var_f);
else
include_ecrire($var_f = 'inc_' . $var_nom . '.php');
// # gerer un charset minimaliste en convertissant tout en unicode &#xxx;
// Quelle fonction a ete demandee ?
//
# Une fonction stockee en base de donnees ?
if ($id_ajax_fonc) {
$res = spip_query("SELECT * FROM spip_ajax_fonc WHERE id_ajax_fonc ='"
. addslashes($id_ajax_fonc)
. "' AND id_auteur=$connect_id_auteur");
if ($row = spip_fetch_array($res)) {
$variables = $row["variables"];
$variables = unserialize($variables);
while (list($i, $k) = each($variables)) {
$$i = $k;
}
// Appliquer la fonction
if ($fonction == "afficher_articles") {
afficher_articles ($titre_table, $requete,
$afficher_visites, $afficher_auteurs);
}
if ($fonction == "afficher_articles_trad") { $var_nom = 'ajax_page_' . $fonction;
afficher_articles_trad ($titre_table, $requete, if (!function_exists($var_nom))
$afficher_visites, $afficher_auteurs); spip_log("fonction $var_nom indisponible dans $var_f");
} else {
if ($fonction == "afficher_groupe_mots") { if ($flag_ob) {
include_ecrire("inc_mots.php3"); ob_start();
afficher_groupe_mots ($id_groupe); $charset = lire_meta("charset");
} }
@header('Content-type: text/html; charset=$charset');
echo "<"."?xml version='1.0' encoding='$charset'?".">\n";
$var_nom(intval($id), intval($exclus), intval($col), $id_ajax_fonc, $type, $rac);
if ($flag_ob) {
# fin gestion charset
$a = ob_get_contents();
ob_end_clean();
include_ecrire('inc_charsets.php3');
echo charset2unicode($a, 'AUTO', true);
} }
}
# Un moteur de recherche ?
else if ($recherche_rub) {
$recherche = addslashes(str_replace("%","\%",$recherche_rub));
$rech2 = split("[[:space:]]+", $recherche);
if ($rech2) {
$where_titre = " (titre LIKE '%".join("%' AND titre LIKE '%", $rech2)."%') ";
$where_desc = " (descriptif LIKE '%".join("%' AND descriptif LIKE '%", $rech2)."%') ";
$where_id = " (id_rubrique = '".join("' AND id_rubrique = '", $rech2)."') ";
}
else {
$where_titre = " 1=2";
$where_desc = " 1=2";
$where_id = " 1=2";
}
if ($exclus) {
include_ecrire('inc_rubriques.php3');
$where_exclus = " AND id_rubrique NOT IN (".calcul_branche($exclus).")";
} else
$where_exclus = '';
$res = spip_query("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE $where_id$where_exclus");
while ($row = spip_fetch_array($res)) {
$id_rubrique = $row["id_rubrique"];
$rub[$id_rubrique]["titre"] = typo ($row["titre"]);
$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
$points[$id_rubrique] = $points[$id_rubrique] + 3;
}
$res = spip_query("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE $where_titre$where_exclus");
while ($row = spip_fetch_array($res)) {
$id_rubrique = $row["id_rubrique"];
$rub[$id_rubrique]["titre"] = typo ($row["titre"]);
$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
$points[$id_rubrique] = $points[$id_rubrique] + 2;
}
$res = spip_query("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE $where_desc$where_exclus");
while ($row = spip_fetch_array($res)) {
$id_rubrique = $row["id_rubrique"];
$rub[$id_rubrique]["titre"] = typo ($row["titre"]);
$rub[$id_rubrique]["id_parent"] = $row["id_parent"];
$points[$id_rubrique] = $points[$id_rubrique] + 1;
}
if ($points) {
arsort($points);
while (list($id,$pts) = each($points)) {
$id_rubrique = $id;
$titre = $rub[$id]["titre"];
$id_parent = $rub[$id]["id_parent"];
// Eviter une premiere fois d'afficher la rubrique exclue
if ($id_parent == 0) $style = "style='background-image: url(" . _DIR_IMG_PACK . "secteur-12.gif)'";
else $style = "";
$onClick = " aff_selection('rubrique','$rac','$id_rubrique');";
$ret .= "<div class='pashighlight' onClick=\"changerhighlight(this); $onClick\"><div class='arial11 petite-rubrique'$style>";
$ret .= "&nbsp; $titre";
$ret .= "</div></div>";
}
}
if ($ret)
echo $ret;
else
echo "<div style='padding: 5px; color: red;'><b>"
.htmlentities($recherche_rub)
."</b> : "._T('avis_aucun_resultat')."</div>";
}
else switch ($fonction) {
# tester si ca fonctionne pour ce brouteur
// (si on arrive la c'est que c'est bon, donc poser le cookie)
case 'test_ajax':
spip_setcookie('spip_accepte_ajax', 1);
break;
# afficher un mini-navigateur de rubriques
case 'aff_rubrique':
include_ecrire("inc_mini_nav.php");
echo mini_nav ($id_rubrique, "choix_parent", "this.form.id_rubrique.value=::sel::;this.form.titreparent.value='::sel2::';findObj('selection_rubrique').style.display='none';", $exclus, $aff_racine=$racine);
break;
# afficher les sous-rubriques d'une rubrique (composant du mini-navigateur)
case 'aff_rub':
include_ecrire("inc_mini_nav.php");
echo mini_afficher_rubrique ($id_rubrique, $rac, "", $col, $exclus);
break;
# petit moteur de recherche sur les rubriques
case 'aff_nav_recherche':
include_ecrire("inc_mini_nav.php");
echo mini_nav ($id_rubrique, "aff_nav_recherche", "document.location.href='naviguer.php3?id_rubrique=::sel::'", 0, $aff_racine=true);
break;
# Affiche les infos d'une rubrique selectionnee dans le mini navigateur
case 'aff_info':
if ($type == "rubrique") {
$res = spip_query("SELECT titre, descriptif FROM spip_rubriques WHERE id_rubrique = $id");
if ($row = spip_fetch_array($res)) {
$titre = typo($row["titre"]);
$descriptif = propre($row["descriptif"]);
} else {
$titre = _T('info_racine_site');
}
} else
$titre = '';
echo "<div style='display: none;'>";
echo "<input type='text' id='".$rac."_sel' value='$id' />";
echo "<input type='text' id='".$rac."_sel2' value=\"".entites_html($titre)."\" />";
echo "</div>";
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>";
break;
default:
echo "erreur : ".htmlspecialchars($fonction)." non definie.";
break;
}
# fin gestion charset
if ($flag_ob) {
$a = ob_get_contents();
ob_end_clean();
include_ecrire('inc_charsets.php3');
echo charset2unicode($a, 'AUTO', true);
} }
?> ?>
...@@ -10,16 +10,14 @@ ...@@ -10,16 +10,14 @@
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/ \***************************************************************************/
if (!defined('_ECRIRE_INC_VERSION')) { if (!defined('_ECRIRE_INC_VERSION')) include ("inc_version.php3");
include ("inc_version.php3");
}
$var_nom = "auth"; $var_nom = "auth";
$var_f = find_in_path('inc_' . $var_nom . '.php'); $var_f = find_in_path('inc_' . $var_nom . '.php');
if ($var_f) if ($var_f)
include($var_f); include($var_f);
else include_ecrire('inc_' . $var_nom . '.php3'); else include_ecrire($var_f = 'inc_' . $var_nom . '.php3');
if (function_exists($var_nom)) if (function_exists($var_nom))
$var_res = $var_nom(); $var_res = $var_nom();
...@@ -37,12 +35,6 @@ include_ecrire('inc_cookie.php'); ...@@ -37,12 +35,6 @@ include_ecrire('inc_cookie.php');
// Preferences de presentation // Preferences de presentation
// //
# teste la capacite ajax : on envoie un cookie -1
# et un script ajax ; si le script reussit le cookie passera a +1
if (!$GLOBALS['_COOKIE']['spip_accepte_ajax']) {
spip_setcookie('spip_accepte_ajax', -1);
}
if ($spip_lang_ecrire = $GLOBALS['_COOKIE']['spip_lang_ecrire'] if ($spip_lang_ecrire = $GLOBALS['_COOKIE']['spip_lang_ecrire']
AND $spip_lang_ecrire <> $auteur_session['lang'] AND $spip_lang_ecrire <> $auteur_session['lang']
AND changer_langue($spip_lang_ecrire)) { AND changer_langue($spip_lang_ecrire)) {
......
...@@ -77,7 +77,7 @@ function mini_afficher_rubrique ($id_rubrique, $rac="", $liste="", $col = 1, $ru ...@@ -77,7 +77,7 @@ function mini_afficher_rubrique ($id_rubrique, $rac="", $liste="", $col = 1, $ru
# ensuite, l'ouverture du menu des sous-rubriques # ensuite, l'ouverture du menu des sous-rubriques
$url = "ajax_page.php?fonction=aff_rub&rac=$rac" $url = "ajax_page.php?fonction=aff_rub&rac=$rac"
."&exclus=$rub_exclus&id_rubrique=$la_rub&col=".($col+1); ."&exclus=$rub_exclus&id=$la_rub&col=".($col+1);
$onClick .= "charger_id_url('$url'," $onClick .= "charger_id_url('$url',"
. "'".$rac."_col_".($col+1) . "'".$rac."_col_".($col+1)
."', 'slide_horizontal(\'".$rac."_principal\', \'" ."', 'slide_horizontal(\'".$rac."_principal\', \'"
...@@ -170,7 +170,7 @@ function mini_nav ($sel, $rac="", $fonction="document.location='naviguer.php3?id ...@@ -170,7 +170,7 @@ function mini_nav ($sel, $rac="", $fonction="document.location='naviguer.php3?id
"\n\r", " ")."';"; "\n\r", " ")."';";
} }
$onClick .= "charger_id_url('ajax_page.php?fonction=aff_rub&rac=$rac&exclus=$rub_exclus&id_rubrique=0&col=1', '".$rac."_col_1');"; $onClick .= "charger_id_url('ajax_page.php?fonction=aff_rub&rac=$rac&exclus=$rub_exclus&id=0&col=1', '".$rac."_col_1');";
$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; width: 134px;'><div class='pashighlight'>"; $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; width: 134px;'><div class='pashighlight'>";
$ret .= _T("info_racine_site"); $ret .= _T("info_racine_site");
......
...@@ -624,7 +624,7 @@ function afficher_groupe_mots($id_groupe) { ...@@ -624,7 +624,7 @@ function afficher_groupe_mots($id_groupe) {
$tmp_var = substr(md5($jjscript), 0, 4); $tmp_var = substr(md5($jjscript), 0, 4);
$javascript = "charger_id_url('ajax_page.php?id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')"; $javascript = "charger_id_url('ajax_page.php?fonction=sql&amp;id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')";
$tranches = afficher_tranches_requete($query, 3, $tmp_var, $javascript); $tranches = afficher_tranches_requete($query, 3, $tmp_var, $javascript);
......
...@@ -783,7 +783,7 @@ function afficher_articles($titre_table, $requete, $afficher_visites = false, $a ...@@ -783,7 +783,7 @@ function afficher_articles($titre_table, $requete, $afficher_visites = false, $a
$tmp_var = substr(md5($jjscript), 0, 4); $tmp_var = substr(md5($jjscript), 0, 4);
$javascript = "charger_id_url('ajax_page.php?id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')"; $javascript = "charger_id_url('ajax_page.php?fonction=sql&amp;id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')";
$tranches = afficher_tranches_requete($requete, $afficher_auteurs ? 4 + $ajout_col : 3 + $ajout_col, $tmp_var, $javascript); $tranches = afficher_tranches_requete($requete, $afficher_auteurs ? 4 + $ajout_col : 3 + $ajout_col, $tmp_var, $javascript);
$requete = str_replace("FROM spip_articles AS articles ", "FROM spip_articles AS articles LEFT JOIN spip_petitions AS petitions USING (id_article)", $requete); $requete = str_replace("FROM spip_articles AS articles ", "FROM spip_articles AS articles LEFT JOIN spip_petitions AS petitions USING (id_article)", $requete);
...@@ -815,7 +815,7 @@ function afficher_articles($titre_table, $requete, $afficher_visites = false, $a ...@@ -815,7 +815,7 @@ function afficher_articles($titre_table, $requete, $afficher_visites = false, $a
if ($afficher_trad) { if ($afficher_trad) {
$texte_img .= http_img_pack("searching.gif", "*", "style='border: 0px; visibility: hidden; float: $spip_lang_right' id = 'img_$div_trad'"); $texte_img .= http_img_pack("searching.gif", "*", "style='border: 0px; visibility: hidden; float: $spip_lang_right' id = 'img_$div_trad'");
$texte_img .= "<div style='float: $spip_lang_right;'><a href=\"javascript:charger_id_url('ajax_page.php?id_ajax_fonc=$id_ajax_trad','$div_trad');\"><img src='img_pack/langues-12.gif' border='0' /></a></div>"; $texte_img .= "<div style='float: $spip_lang_right;'><a href=\"javascript:charger_id_url('ajax_page.php?fonction=sql&amp;id_ajax_fonc=$id_ajax_trad','$div_trad');\"><img src='img_pack/langues-12.gif' border='0' /></a></div>";
} }
bandeau_titre_boite2($texte_img.$titre_table, "article-24.gif"); bandeau_titre_boite2($texte_img.$titre_table, "article-24.gif");
...@@ -1006,7 +1006,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals ...@@ -1006,7 +1006,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals
$hash = "0x".substr(md5($connect_id_auteur.$jjscript), 0, 16); $hash = "0x".substr(md5($connect_id_auteur.$jjscript), 0, 16);
$tmp_var = substr(md5($jjscript), 0, 4); $tmp_var = substr(md5($jjscript), 0, 4);
$javascript = "charger_id_url('ajax_page.php?id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')"; $javascript = "charger_id_url('ajax_page.php?fonction=sql&amp;id_ajax_fonc=::id_ajax_fonc::::deb::','$tmp_var')";
$tranches = afficher_tranches_requete($requete, 4, $tmp_var, $javascript); $tranches = afficher_tranches_requete($requete, 4, $tmp_var, $javascript);
$requete = str_replace("FROM spip_articles AS articles ", "FROM spip_articles AS articles LEFT JOIN spip_petitions AS petitions USING (id_article)", $requete); $requete = str_replace("FROM spip_articles AS articles ", "FROM spip_articles AS articles LEFT JOIN spip_petitions AS petitions USING (id_article)", $requete);
...@@ -1033,7 +1033,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals ...@@ -1033,7 +1033,7 @@ function afficher_articles_trad($titre_table, $requete, $afficher_visites = fals
$texte_img .= http_img_pack("searching.gif", "*", "style='border: 0px; visibility: hidden; float: $spip_lang_right' id = 'img_$div_trad'"); $texte_img .= http_img_pack("searching.gif", "*", "style='border: 0px; visibility: hidden; float: $spip_lang_right' id = 'img_$div_trad'");
$texte_img .= "<div style='float: $spip_lang_right;'><a href=\"javascript:charger_id_url('ajax_page.php?id_ajax_fonc=$id_ajax_trad','$div_trad');\"><img src='img_pack/langues-off-12.gif' border='0' /></a></div>"; $texte_img .= "<div style='float: $spip_lang_right;'><a href=\"javascript:charger_id_url('ajax_page.php?fonction=sql&amp;id_ajax_fonc=$id_ajax_trad','$div_trad');\"><img src='img_pack/langues-off-12.gif' border='0' /></a></div>";
bandeau_titre_boite2($texte_img.$titre_table, "article-24.gif"); bandeau_titre_boite2($texte_img.$titre_table, "article-24.gif");
...@@ -1867,30 +1867,35 @@ function debut_javascript($admin, $stat) ...@@ -1867,30 +1867,35 @@ function debut_javascript($admin, $stat)
global $spip_lang_left, $browser_name, $browser_version; global $spip_lang_left, $browser_name, $browser_version;
include_ecrire("inc_charsets.php3"); include_ecrire("inc_charsets.php3");
# teste la capacite ajax : on envoie un cookie -1
# et un script ajax ; si le script reussit le cookie passera a +1
if (!$GLOBALS['_COOKIE']['spip_accepte_ajax']) {
spip_setcookie('spip_accepte_ajax', -1);
$ajax = "if (a = createXmlHttp()) {
a.open('GET', 'ajax_page.php?fonction=test', true) ;
a.send(null);
}";
} else $ajax = "";
return return
// envoi le fichier JS de config si browser ok. // envoi le fichier JS de config si browser ok.
$GLOBALS['browser_layer'] . $GLOBALS['browser_layer'] .
"<script type='text/javascript'><!--" . http_script(
"\nvar admin = " . ($admin ? 1 : 0) .
"\nvar stat = " . ($stat ? 1 : 0) .
"\nvar largeur_icone = " .
largeur_icone_bandeau_principal(_T('icone_a_suivre')) .
"\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" .
# tester la capacite ajax si ce n'est pas deja fait # tester la capacite ajax si ce n'est pas deja fait
(($GLOBALS['_COOKIE']['spip_accepte_ajax']) ? "" : ( $ajax .
" if (a = createXmlHttp()) { "\nvar admin = " . ($admin ? 1 : 0) .
a.open('GET', 'ajax_page.php?fonction=test_ajax', true) ; "\nvar stat = " . ($stat ? 1 : 0) .
a.send(null); "\nvar largeur_icone = " .
}")) . largeur_icone_bandeau_principal(_T('icone_a_suivre')) .
"\nvar bug_offsetwidth = " .
"\n//--></script>" . // 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_RESTREINT . 'presentation.js'); http_script('',_DIR_RESTREINT . 'presentation.js');
} }
...@@ -2597,7 +2602,7 @@ if (true /*$bandeau_colore*/) { ...@@ -2597,7 +2602,7 @@ if (true /*$bandeau_colore*/) {
// http_img_pack("tout-site.png", "", "width='26' height='20' border='0'") . "</a>"; // http_img_pack("tout-site.png", "", "width='26' height='20' border='0'") . "</a>";
$id_rubrique = $GLOBALS['id_rubrique']; $id_rubrique = $GLOBALS['id_rubrique'];
echo "<a href='articles_tous.php3' class='icone26' onMouseOver=\"changestyle('bandeautoutsite','visibility','visible'); charger_id_url_si_vide('ajax_page.php?fonction=aff_nav_recherche&id_rubrique=$id_rubrique','nav-recherche');\">" . echo "<a href='articles_tous.php3' class='icone26' onMouseOver=\"changestyle('bandeautoutsite','visibility','visible'); charger_id_url_si_vide('ajax_page.php?fonction=aff_nav_recherche&id=$id_rubrique','nav-recherche');\">" .
http_img_pack("tout-site.png", "", "width='26' height='20' border='0'") . "</a>"; http_img_pack("tout-site.png", "", "width='26' height='20' border='0'") . "</a>";
if ($id_rubrique > 0) echo "<a href='brouteur.php3?id_rubrique=$id_rubrique' class='icone26' onMouseOver=\"changestyle('bandeaunavrapide','visibility','visible');\">" . if ($id_rubrique > 0) echo "<a href='brouteur.php3?id_rubrique=$id_rubrique' class='icone26' onMouseOver=\"changestyle('bandeaunavrapide','visibility','visible');\">" .
http_img_pack("naviguer-site.png", "", "width='26' height='20' border='0'") ."</a>"; http_img_pack("naviguer-site.png", "", "width='26' height='20' border='0'") ."</a>";
......
...@@ -157,9 +157,9 @@ function charger_id_url(myUrl, myField, jjscript) ...@@ -157,9 +157,9 @@ function charger_id_url(myUrl, myField, jjscript)
{ {
var Field = findObj_forcer(myField); // selects the given element var Field = findObj_forcer(myField); // selects the given element
if (!Field) return; if (!Field) return;
if (xmlhttp[myField]) xmlhttp[myField].abort(); if (xmlhttp[myField]) xmlhttp[myField].abort();
if (url_chargee['mem_'+myUrl]) { if (url_chargee['mem_'+myUrl]) {
Field.innerHTML = url_chargee['mem_'+myUrl]; Field.innerHTML = url_chargee['mem_'+myUrl];
Field.style.visibility = "visible"; Field.style.visibility = "visible";
...@@ -169,9 +169,9 @@ function charger_id_url(myUrl, myField, jjscript) ...@@ -169,9 +169,9 @@ function charger_id_url(myUrl, myField, jjscript)
image_search[myField] = findObj_forcer('img_'+myField); image_search[myField] = findObj_forcer('img_'+myField);
if (image_search[myField]) image_search[myField].style.visibility = "visible"; if (image_search[myField]) image_search[myField].style.visibility = "visible";
if (!(xmlhttp[myField] = createXmlHttp())) return false; if (!(xmlhttp[myField] = createXmlHttp())) return false;
xmlhttp[myField].open("GET", myUrl, true); xmlhttp[myField].open("GET", myUrl, true);
// traiter la reponse du serveur // traiter la reponse du serveur
xmlhttp[myField].onreadystatechange = function() { xmlhttp[myField].onreadystatechange = function() {
if (xmlhttp[myField].readyState == 4) { if (xmlhttp[myField].readyState == 4) {
......
...@@ -234,7 +234,7 @@ function lancer_recherche(champ, cible) { ...@@ -234,7 +234,7 @@ function lancer_recherche(champ, cible) {
function lancer_recherche_rub(champ, rac, exclus) { function lancer_recherche_rub(champ, rac, exclus) {
valeur = findObj(champ).value; valeur = findObj(champ).value;
if (valeur.length > 0) { if (valeur.length > 0) {
charger_id_url('ajax_page.php?recherche_rub='+valeur+'&exclus='+exclus+'&rac='+rac, rac+'_col_1'); charger_id_url('ajax_page.php?fonction=recherche&type='+valeur+'&exclus='+exclus+'&rac='+rac, rac+'_col_1');
} }
} }
......
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