forked from spip/spip
Browse Source
A noter qu'au passage disparait la dernière URL codée en dur dans le code JavaScript. Il faudra veiller à ne pas en réintroduire, afin que d'éventuels changements de generer_url_ecrire soient bien intégralement répercutés.1.9.2
14 changed files with 344 additions and 68 deletions
@ -0,0 +1,25 @@
|
||||
<?php |
||||
|
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2006 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
# Les informations d'une rubrique selectionnee dans le mini navigateur |
||||
|
||||
function exec_informer_auteur_dist() |
||||
{ |
||||
$id = intval(_request('id')); |
||||
|
||||
$informer_auteur = charger_fonction('informer_auteur', 'inc'); |
||||
ajax_retour($informer_auteur($id)); |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,33 @@
|
||||
<?php |
||||
|
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2006 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
# gerer un charset minimaliste en convertissant tout en unicode &#xxx; |
||||
|
||||
// http://doc.spip.org/@exec_rechercher_dist |
||||
function exec_rechercher_auteur_dist() |
||||
{ |
||||
$idom = _request('idom'); |
||||
if (!preg_match('/\w+/',$idom)) die('Tu nous prend pour qui?'); |
||||
|
||||
$where = split("[[:space:]]+", _request('nom')); |
||||
if ($where) { |
||||
foreach ($where as $k => $v) |
||||
$where[$k] = "'%" . substr(str_replace("%","\%", spip_abstract_quote($v)),1,-1) . "%'"; |
||||
$where= ("(nom LIKE " . join(" AND nom LIKE ", $where) . ")"); |
||||
} |
||||
$q = spip_query("SELECT * FROM spip_auteurs WHERE $where"); |
||||
include_spip('inc/selectionner_auteur'); |
||||
ajax_retour(selectionner_auteur_boucle($q, $idom)); |
||||
} |
||||
?> |
@ -0,0 +1,25 @@
|
||||
<?php |
||||
|
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2006 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
# afficher un mini-navigateur de rubriques |
||||
|
||||
// http://doc.spip.org/@exec_selectionner_dist |
||||
function exec_selectionner_auteur_dist() |
||||
{ |
||||
$id = intval(_request('id_article')); |
||||
|
||||
$selectionner_auteur = charger_fonction('selectionner_auteur', 'inc'); |
||||
ajax_retour($selectionner_auteur($id)); |
||||
} |
||||
?> |
@ -0,0 +1,67 @@
|
||||
<?php |
||||
|
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2006 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
# Les information d'une rubrique selectionnee dans le mini navigateur |
||||
|
||||
// http://doc.spip.org/@inc_informer_dist |
||||
function inc_informer_auteur_dist($id) |
||||
{ |
||||
global $couleur_foncee,$spip_display,$spip_lang_right ; |
||||
|
||||
include_spip('inc/presentation'); |
||||
|
||||
$res = spip_query("SELECT * FROM spip_auteurs WHERE id_auteur = $id"); |
||||
if ($row = spip_fetch_array($res)) { |
||||
$nom = typo(extraire_multi($row["nom"])); |
||||
$bio = propre($row["bio"]); |
||||
$mail = $row['email']; |
||||
if (!email_valide($mail)) |
||||
$mail = "<span style='color:red'>" |
||||
. _T('info_email_invalide') |
||||
. '</span>'; |
||||
else $mail = "<a href='mailto:$mail'>" |
||||
. _T('info_ecire_message_prive') |
||||
. "</a>"; |
||||
$mail = "<br /> ($mail)<br />"; |
||||
} else { |
||||
$nom = "<span style='color:red'>" |
||||
. _T('texte_vide') |
||||
. '</span>'; |
||||
$bio = $mail = ''; |
||||
} |
||||
|
||||
$res = ''; |
||||
if ($spip_display != 1 AND $spip_display!=4 AND $GLOBALS['meta']['image_process'] != "non") { |
||||
$logo_f = charger_fonction('chercher_logo', 'inc'); |
||||
if ($res = $logo_f($id, 'id_auteur', 'on')) { |
||||
list($fid, $dir, $n, $format) = $res; |
||||
$res = ratio_image($fid, $n, $format, 100, 48, "alt=''"); |
||||
if ($res) |
||||
$res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>"; |
||||
} |
||||
} |
||||
|
||||
return "<div class='arial2' style='padding: 5px; background-color: white; border: 1px solid $couleur_foncee; border-top: 0px;'>" |
||||
. (!$res ? '' : $res) |
||||
. "<div>" |
||||
. bonhomme_statut($row) |
||||
. " <b>" |
||||
. $nom |
||||
. "</b>" |
||||
. $mail |
||||
. "</div>" |
||||
. "<div>$bio</div>" |
||||
. "</div>"; |
||||
} |
||||
?> |
@ -0,0 +1,93 @@
|
||||
<?php |
||||
|
||||
/***************************************************************************\ |
||||
* SPIP, Systeme de publication pour l'internet * |
||||
* * |
||||
* Copyright (c) 2001-2006 * |
||||
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
||||
* * |
||||
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
||||
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
||||
\***************************************************************************/ |
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return; |
||||
|
||||
include_spip('inc/editer_auteurs'); |
||||
|
||||
// |
||||
// Affiche un mini-navigateur ajax sur les auteurs |
||||
// |
||||
|
||||
function inc_selectionner_auteur_dist($id_article) |
||||
{ |
||||
global $spip_lang_right; |
||||
|
||||
$idom = 'bloc_selectionner_auteur'; |
||||
$idom1 = $idom . "_champ_recherche"; |
||||
$idom2 = $idom . "_principal"; |
||||
$idom3 = $idom . "_selection"; |
||||
$idom4 = $idom . "_col_1"; |
||||
$idom5 = 'img_' . $idom4; |
||||
$idom6 = $idom."_fonc"; |
||||
|
||||
$les_auteurs = join(',', determiner_auteurs_article($id_article)); |
||||
$futurs = selectionner_auteur_boucle(determiner_non_auteurs($les_auteurs, "nom, statut"), $idom); |
||||
|
||||
// url completee par la fonction JS onkeypress_rechercher |
||||
$url = generer_url_ecrire('rechercher_auteur', "idom=$idom&nom="); |
||||
|
||||
return "<div id='$idom'>" |
||||
. "<input style='width: 100px;' type='search' id='$idom1'" |
||||
. "\nonkeypress=\"t=setTimeout('onkeypress_rechercher(\'" |
||||
. $idom1 |
||||
. "\',\'" |
||||
. $idom4 |
||||
. "\',\'" |
||||
. $url |
||||
. "\')', 200); key = event.keyCode; if (key == 13 || key == 3) { return false;} \" />" |
||||
. http_img_pack("searching.gif", "*", "style='visibility: hidden;' id='$idom5'") |
||||
. "<div id='$idom2'" |
||||
. " style='position: relative; height: 170px; background-color: white; border: 1px solid $couleur_foncee; overflow: auto;'><div id='$idom4'" |
||||
. " class='arial1'>" |
||||
. $futurs |
||||
. "</div></div>\n<div id='$idom3'></div></div>\n"; |
||||
} |
||||
|
||||
function selectionner_auteur_boucle($query, $idom) |
||||
{ |
||||
global $spip_lang_left; |
||||
|
||||
$info = generer_url_ecrire('informer_auteur', "id="); |
||||
# $args = "'$idom',this, '$col', '$spip_lang_left', '$info'"; |
||||
$args = "'$idom" . "_selection', '$info'"; |
||||
|
||||
$res = ''; |
||||
|
||||
while ($row = spip_fetch_array($query)) { |
||||
|
||||
$id = $row["id_auteur"]; |
||||
$titre = typo(extraire_multi($row["nom"])); |
||||
|
||||
$email = $row["email"]; |
||||
$statut = $row["statut"]; |
||||
|
||||
$commun = "findObj_forcer('nouv_auteur').value=" |
||||
. $id; |
||||
|
||||
// attention, les <a></a> doivent etre au premier niveau |
||||
// et se suivrent pour que changerhighligth fonctionne |
||||
|
||||
$res .= "<a class='pashighlight'" |
||||
. "\nonclick=\"changerhighlight(this);" |
||||
. $commun |
||||
. "; aff_selection($id,$args); return false;" |
||||
. "\"\nondbclick=\"" |
||||
. $commun |
||||
. ";findObj_forcer('selection_auteur').style.display=" |
||||
. "'none'; return false" |
||||
. "\">$titre</a>"; |
||||
} |
||||
|
||||
return $res; |
||||
} |
||||
?> |
Loading…
Reference in new issue