Chargement en cours ecrire/inc/actions.php +0 −125 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -34,132 +34,7 @@ function redirige_action_post($action, $arg, $ret, $gra, $corps, $att='') { return generer_action_auteur($action, $arg, $r, $corps, $att . " method='post'"); } // Retourne un formulaire d'execution de $action sur $id, // revenant a l'envoyeur $script d'arguments $args. // Utilise Ajax si dispo, en ecrivant le resultat dans le innerHTML du noeud // d'attribut id = $action-$id (cf. AjaxSqueeze dans layer.js) // http://doc.spip.org/@ajax_action_auteur function ajax_action_auteur($action, $id, $script, $args='', $corps=false, $args_ajax='', $fct_ajax='') { if (strpos($args,"#")===FALSE) $ancre = "$action-" . intval($id); else { $ancre = explode("#",$args); $args = $ancre[0]; $ancre = $ancre[1]; } // Formulaire (POST) // methodes traditionnelle et ajax a unifier... if (is_string($corps)) { // Methode traditionnelle if (_SPIP_AJAX !== 1) { return redirige_action_post($action, $id, $script, "$args#$ancre", $corps); } // Methode Ajax else { if ($args AND !$args_ajax) $args_ajax = "&$args"; if (isset($_GET['var_profile'])) $args_ajax .= '&var_profile=1'; return redirige_action_post($action, $id, $action, "script=$script$args_ajax", $corps, (" onsubmit=" . ajax_action_declencheur('this', $ancre, $fct_ajax))); } } // Lien (GET) else { $href = redirige_action_auteur($action, $id, $script, "$args#$ancre", false); if ($args AND !$args_ajax) $args_ajax = "&$args"; if (isset($_GET['var_profile'])) $args_ajax .= '&var_profile=1'; $ajax = redirige_action_auteur($action, $id, $action, "script=$script$args_ajax"); $cli = array_shift($corps); return "<a href='$href'\nonclick=" . ajax_action_declencheur($ajax, $ancre, $fct_ajax) . ">" . (!$corps ? $cli : ("\n<span" . $corps[0] . ">$cli</span>")) . "</a>"; } } // Comme ci-dessus, mais reduit au cas POST et on fournit le bouton Submit. // // http://doc.spip.org/@ajax_action_post function ajax_action_post($action, $arg, $retour, $gra, $corps, $clic='', $atts_i='', $atts_span = "", $args_ajax='') { global $spip_lang_right; if (strpos($gra,"#")===FALSE) { // A etudier: prendre systematiquement arg en trancodant les \W $n = intval($arg); $ancre = "$action-" . ($n ? $n : $arg); } else { $ancre = explode("#",$gra); $args = $ancre[0]; $ancre = $ancre[1]; } if (!$atts_i) $atts_i = " class='fondo' style='float: $spip_lang_right'"; if (is_array($clic)) { $submit = ""; $atts_i .= "\nonclick='AjaxNamedSubmit(this)'"; foreach($clic as $n => $c) $submit .= "\n<input type='submit' name='$n' value='$c' $atts_i />"; } else { if (!$clic) $clic = _T('bouton_valider'); $submit = "<input type='submit' value='$clic' $atts_i />"; } $corps = "<div>" . $corps . "<span" . $atts_span . ">" . $submit . "</span></div>"; if (_SPIP_AJAX !== 1) { return redirige_action_post($action, $arg, $retour, ($gra . '#' . $ancre), $corps); } else { if ($gra AND !$args_ajax) $args_ajax = "&$gra"; if (isset($GLOBALS['var_profile'])) $args_ajax .= '&var_profile=1'; return redirige_action_post($action, $arg, $action, "script=$retour$args_ajax", $corps, " onsubmit=" . ajax_action_declencheur('this', $ancre)); } } // // Attention pour que Safari puisse manipuler cet evenement Chargement en cours Chargement en cours
ecrire/inc/actions.php +0 −125 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -34,132 +34,7 @@ function redirige_action_post($action, $arg, $ret, $gra, $corps, $att='') { return generer_action_auteur($action, $arg, $r, $corps, $att . " method='post'"); } // Retourne un formulaire d'execution de $action sur $id, // revenant a l'envoyeur $script d'arguments $args. // Utilise Ajax si dispo, en ecrivant le resultat dans le innerHTML du noeud // d'attribut id = $action-$id (cf. AjaxSqueeze dans layer.js) // http://doc.spip.org/@ajax_action_auteur function ajax_action_auteur($action, $id, $script, $args='', $corps=false, $args_ajax='', $fct_ajax='') { if (strpos($args,"#")===FALSE) $ancre = "$action-" . intval($id); else { $ancre = explode("#",$args); $args = $ancre[0]; $ancre = $ancre[1]; } // Formulaire (POST) // methodes traditionnelle et ajax a unifier... if (is_string($corps)) { // Methode traditionnelle if (_SPIP_AJAX !== 1) { return redirige_action_post($action, $id, $script, "$args#$ancre", $corps); } // Methode Ajax else { if ($args AND !$args_ajax) $args_ajax = "&$args"; if (isset($_GET['var_profile'])) $args_ajax .= '&var_profile=1'; return redirige_action_post($action, $id, $action, "script=$script$args_ajax", $corps, (" onsubmit=" . ajax_action_declencheur('this', $ancre, $fct_ajax))); } } // Lien (GET) else { $href = redirige_action_auteur($action, $id, $script, "$args#$ancre", false); if ($args AND !$args_ajax) $args_ajax = "&$args"; if (isset($_GET['var_profile'])) $args_ajax .= '&var_profile=1'; $ajax = redirige_action_auteur($action, $id, $action, "script=$script$args_ajax"); $cli = array_shift($corps); return "<a href='$href'\nonclick=" . ajax_action_declencheur($ajax, $ancre, $fct_ajax) . ">" . (!$corps ? $cli : ("\n<span" . $corps[0] . ">$cli</span>")) . "</a>"; } } // Comme ci-dessus, mais reduit au cas POST et on fournit le bouton Submit. // // http://doc.spip.org/@ajax_action_post function ajax_action_post($action, $arg, $retour, $gra, $corps, $clic='', $atts_i='', $atts_span = "", $args_ajax='') { global $spip_lang_right; if (strpos($gra,"#")===FALSE) { // A etudier: prendre systematiquement arg en trancodant les \W $n = intval($arg); $ancre = "$action-" . ($n ? $n : $arg); } else { $ancre = explode("#",$gra); $args = $ancre[0]; $ancre = $ancre[1]; } if (!$atts_i) $atts_i = " class='fondo' style='float: $spip_lang_right'"; if (is_array($clic)) { $submit = ""; $atts_i .= "\nonclick='AjaxNamedSubmit(this)'"; foreach($clic as $n => $c) $submit .= "\n<input type='submit' name='$n' value='$c' $atts_i />"; } else { if (!$clic) $clic = _T('bouton_valider'); $submit = "<input type='submit' value='$clic' $atts_i />"; } $corps = "<div>" . $corps . "<span" . $atts_span . ">" . $submit . "</span></div>"; if (_SPIP_AJAX !== 1) { return redirige_action_post($action, $arg, $retour, ($gra . '#' . $ancre), $corps); } else { if ($gra AND !$args_ajax) $args_ajax = "&$gra"; if (isset($GLOBALS['var_profile'])) $args_ajax .= '&var_profile=1'; return redirige_action_post($action, $arg, $action, "script=$retour$args_ajax", $corps, " onsubmit=" . ajax_action_declencheur('this', $ancre)); } } // // Attention pour que Safari puisse manipuler cet evenement Chargement en cours