diff --git a/ecrire/exec/auteurs.php b/ecrire/exec/auteurs.php index 89c25d44e75a3536667c436b74ea350749b43d58..0bac88239434fb6a90edd4bbc979d8d4aa482ad1 100644 --- a/ecrire/exec/auteurs.php +++ b/ecrire/exec/auteurs.php @@ -50,14 +50,7 @@ function exec_auteurs_dist() echo bandeau_auteurs($tri, !statut_min_redac($statut)); - $recherche_aff = entites_html($recherche); - if (!strlen($recherche)) { - $recherche_aff = _T('info_rechercher'); - $onfocus = " onfocus=\"this.value='';\""; - } else $onfocus = ''; - $onfocus = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="spip_recherche" accesskey="r"' . $onfocus . ' />'; - echo "<div style='width:200px;float:$spip_lang_right;'>".generer_form_ecrire("auteurs", $onfocus, " method='get'")."</div>" - . "<br class='nettoyeur' />"; + echo formulaire_recherche("auteurs") . "<br class='nettoyeur' />"; echo "<div id='auteurs'>", $res, "</div>"; echo pipeline('affiche_milieu',array('args'=>array('exec'=>'auteurs'),'data'=>'')); diff --git a/ecrire/exec/controle_forum.php b/ecrire/exec/controle_forum.php index 9ccec99d176d9ffd18f157f5934c4ad683991e5d..33ba1e1ba762c5714feb60b3e4d8791d450c550a 100644 --- a/ecrire/exec/controle_forum.php +++ b/ecrire/exec/controle_forum.php @@ -209,12 +209,7 @@ function exec_controle_forum_dist() $recherche = _request('recherche'); if (!preg_match('/^\w+$/', $type)) $type = 'public'; - $recherche_aff = entites_html($recherche); - if (!strlen($recherche)) { - $recherche_aff = _T('info_rechercher'); - $onfocus = " onfocus=\"this.value='';\""; - } else $onfocus = ''; - $onfocus = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="spip_recherche" accesskey="r"' . $onfocus . " /><input type='hidden' name='type' value='$type' />"; + $formulaire_recherche = formulaire_recherche("controle_forum","<input type='hidden' name='type' value='$type' />"); list($from,$where)=critere_statut_controle_forum($type, $id_rubrique, $recherche); @@ -288,8 +283,7 @@ function exec_controle_forum_dist() echo debut_droite('', true); echo pipeline('affiche_milieu',array('args'=>array('exec'=>'controle_forum', 'type'=>$type),'data'=>'')); - echo "<div style='width:200px;float:$spip_lang_right;'>".generer_form_ecrire("controle_forum", $onfocus, " method='get'")."</div>" - . "<br class='nettoyeur' />"; + echo $formulaire_recherche . "<br class='nettoyeur' />"; echo "<div id='$ancre' class='serif2'>$mess</div>"; echo fin_gauche(), fin_page(); diff --git a/ecrire/exec/recherche.php b/ecrire/exec/recherche.php index 9e7563a31d28e5009c467c3e0e76912c67a8d715..e66fb7d1f83252b76589d266070dcf533a937267 100644 --- a/ecrire/exec/recherche.php +++ b/ecrire/exec/recherche.php @@ -56,14 +56,7 @@ function exec_recherche_dist() { echo debut_grand_cadre(true); - if (!strlen($recherche)) { - $recherche_aff = _T('info_rechercher'); - $onfocus = " onfocus=\"this.value='';\""; - } else $onfocus = ''; - - $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; - $form .= "<input type='image' width='26' height='20' src='"._DIR_IMG_PACK."loupe.png' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; - echo "<div class='spip_recherche'>".generer_form_ecrire("recherche", $form, " method='get'")."</div>"; + echo formulaire_recherche("recherche"); /* // Si on est autorise a modifier, proposer le choix de REMPLACER diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index 997679cafdca5f2de81fdd72522f1e3a3f31e964..34905522d15ffba45dfa88c4fd777c16c39184e4 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -1099,6 +1099,18 @@ function fin_cadre_formulaire($return=false){ } +function formulaire_recherche($page, $complement=""){ + $recherche = _request('recherche'); + $recherche_aff = entites_html($recherche); + if (!strlen($recherche)) { + $recherche_aff = _T('info_rechercher'); + $onfocus = " onfocus=\"this.value='';\""; + } else $onfocus = ''; + + $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; + $form .= "<input type='image' width='26' height='20' src='"._DIR_IMG_PACK."loupe.png' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; + return "<div class='spip_recherche'>".generer_form_ecrire($page, $form . $complement, " method='get'")."</div>"; +} // // Debut de la colonne de gauche