Skip to content
Extraits de code Groupes Projets
Valider 71740502 rédigé par Fil's avatar Fil
Parcourir les fichiers

revision des ajax_action_declencheur() a cause d'un bug debile de Safari......

revision des ajax_action_declencheur() a cause d'un bug debile de Safari... j'espere que ca ne casse rien, mais ca permet de contourner un truc bizarre dans le plugin async_upload/, ou l'operation de recopie des noeuds correspondants aux documents ajoutes cassait le onsubmit.
parent ba86ccb6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -230,7 +230,7 @@ function auteurs_href($clic, $args='', $att='')
$h = generer_url_ecrire('auteurs', $args);
$a = 'auteurs';
if ($_COOKIE['spip_accepte_ajax'] == 1 )
$att .= ("\nonclick=" . ajax_action_declencheur("\"$h\"",$a));
$att .= ("\nonclick=" . ajax_action_declencheur($h,$a));
return "<a href='$h#$a'$att>$clic</a>";
}
......
......@@ -179,21 +179,28 @@ function ajax_action_auteur($action, $id, $script, $args='', $corps=false, $args
if ($att) $clic = "\n<div$att>$clic</div>";
return "<a href='$href'\nonclick="
. ajax_action_declencheur("\"$ajax\"", $ancre, $fct_ajax)
. ajax_action_declencheur($ajax, $ancre, $fct_ajax)
. ">$clic</a>";
}
}
//
// Attention pour que Safari puisse manipuler cet evenement
// il faut onsubmit="return AjaxSqueeze(x,'truc',...)"
// et non pas onsubmit='return AjaxSqueeze(x,"truc",...)'
//
// http://doc.spip.org/@ajax_action_declencheur
function ajax_action_declencheur($request, $noeud, $fct_ajax='')
{
return "'return AjaxSqueeze("
function ajax_action_declencheur($request, $noeud, $fct_ajax='') {
if ($request != 'this')
$request = "'".$request."'";
return '"return AjaxSqueeze('
. $request
. ',"'
. ",'"
. $noeud
. '"'
. "'"
. (!$fct_ajax ? '' : ",$fct_ajax")
. ")'";
. ')"';
}
// http://doc.spip.org/@ajax_action_greffe
......
......@@ -91,7 +91,7 @@ function calendrier_href($script, $annee, $mois, $jour, $type, $fin, $ancre, $im
return http_href("$h$a", $clic, $titre, $style, $class, $evt);
else {
$evt .= "\nonclick=" . ajax_action_declencheur("\"$h\"",$ancre);
$evt .= "\nonclick=" . ajax_action_declencheur($h,$ancre);
return "<a$c$s\nhref='$h$a'$evt>$clic</a>";
}
}
......
......@@ -32,7 +32,7 @@ function formulaire_discuter($query, $total, $debut, $total_afficher, $script, $
$h = generer_url_ecrire($script, $a);
} else {
$h = generer_url_ecrire('discuter', $a);
$evt = "\nonclick=" . ajax_action_declencheur("\"$h\"",'forum');
$evt = "\nonclick=" . ajax_action_declencheur($h,'forum');
}
$nav .= "[<a href='$h#forum'$evt>$i-$y</a>] ";
}
......
......@@ -29,7 +29,7 @@ function affiche_navigation_forum($script, $args, $debut, $i, $pack, $ancre, $qu
$nav .= "<font size=3><b>$i</b></font> |\n";
else {
$h = generer_url_ecrire($script, $args . "&debut=$i", $e);
if ($e) $e = "\nonclick=" . ajax_action_declencheur("\"$h\"",$ancre);
if ($e) $e = "\nonclick=" . ajax_action_declencheur($h,$ancre);
$nav .= "<a href='$h'$e>$i</a> |\n";
}
}
......@@ -38,7 +38,7 @@ function affiche_navigation_forum($script, $args, $debut, $i, $pack, $ancre, $qu
$h = generer_url_ecrire($script, $args . "&debut=$i");
if ($e) $e = "\nonclick=" . ajax_action_declencheur("\"$h\"",$ancre);
if ($e) $e = "\nonclick=" . ajax_action_declencheur($h,$ancre);
return "$nav<a href='$h'$e>...</a> |";
}
......
......@@ -264,7 +264,7 @@ function legender_auteur_voir($auteur, $redirect)
$clic = _T("admin_modifier_auteur");
$h = generer_url_ecrire("auteur_infos","id_auteur=$id_auteur&initial=0");
if (($_COOKIE['spip_accepte_ajax'] == 1 ) AND !$redirect) {
$evt .= "\nonclick=" . ajax_action_declencheur("\"$h\"",$ancre);
$evt .= "\nonclick=" . ajax_action_declencheur($h,$ancre);
$h = "<a\nhref='$h$a'$evt>$clic</a>";
}
$res .= icone($clic, $h, "redacteurs-24.gif", "edit.gif", '', '',true);
......
......@@ -30,7 +30,7 @@ function charger_fonction($nom, $dossier='exec', $continue=false) {
// Securite de base
if (!preg_match(',^\w+$,', $nom))
redirige_par_entete('./');
die(htmlspecialchars($nom)." pas autorise");
if (substr($dossier,-1) != '/') $dossier .= '/';
// Si la fonction existe deja (definie par mes_options, par exemple)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter