diff --git a/.gitattributes b/.gitattributes index ca7cedfa97e5979308c9d74bf2b7b0fc8512703d..7108b2c43a0d010d973bfde43e893d9752a14935 100644 --- a/.gitattributes +++ b/.gitattributes @@ -440,6 +440,7 @@ ecrire/inc/iconifier.php -text ecrire/inc/import_0_0.php -text ecrire/inc/import_1_2.php -text ecrire/inc/import_1_3.php -text +ecrire/inc/informer.php -text ecrire/inc/install_.php -text ecrire/inc/install_0.php -text ecrire/inc/install_1.php -text diff --git a/ecrire/exec/auteurs_edit.php b/ecrire/exec/auteurs_edit.php index 0316e95fb70358da949ece84b9cebce2ce49fb02..1876be2f4a5134c336cf873294477276ec9243fd 100644 --- a/ecrire/exec/auteurs_edit.php +++ b/ecrire/exec/auteurs_edit.php @@ -13,7 +13,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return; include_spip('inc/presentation'); -include_spip('inc/auteur_voir'); include_spip('inc/message_select'); // http://doc.spip.org/@exec_auteurs_edit_dist diff --git a/ecrire/fragments/informer.php b/ecrire/fragments/informer.php index 25b2005191e3f39d076ddebe38d2cc9e1f48fd39..a74fb97c5877332a7bc74dbd9860c72af3b9a1a6 100644 --- a/ecrire/fragments/informer.php +++ b/ecrire/fragments/informer.php @@ -12,70 +12,18 @@ if (!defined("_ECRIRE_INC_VERSION")) return; -# Affiche les infos d'une rubrique selectionnee dans le mini navigateur +# Les informations d'une rubrique selectionnee dans le mini navigateur // http://doc.spip.org/@fragments_informer_dist function fragments_informer_dist() { - global $couleur_foncee,$spip_display,$spip_lang_right ; - global $id, $exclus, $col, $type, $rac; - $id = intval($id); - $exclus = intval($exclus); - $col = intval($col); - $corps =''; - include_spip('inc/texte'); - 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 = ''; - - $rac = htmlentities($rac); - $corps .= "<div style='display: none;'>"; - $corps .= "<input type='text' id='".$rac."_sel' value='$id' />"; - $corps .= "<input type='text' id='".$rac."_sel2' value=\"".entites_html($titre)."\" />"; - $corps .= "</div>"; + $id = intval(_request('id')); + $col = intval(_request('col')); + $exclus = intval(_request('exclus')); - $corps .= "<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 $GLOBALS['meta']['image_process'] != "non") { - $logo_f = charger_fonction('chercher_logo', 'inc'); - if ($res = $logo_f($id, 'id_rubrique', 'on')) { - list($fid, $dir, $nom, $format) = $res; - $res = ratio_image($fid, $nom, $format, 100, 48, "alt=''"); - if ($res) - $corps .= "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>"; - } - } - - $corps .= "<div><p><b>$titre</b></p></div>"; - if (strlen($descriptif) > 0) $corps .= "<div>$descriptif</div>"; - - $corps .= "<div style='text-align: $spip_lang_right;'>"; - -# ce lien provoque la selection (directe) de la rubrique cliquee - $onClick = "findObj('id_parent').value=$id;"; -# et l'affichage de son titre dans le bandeau - $onClick .= "findObj('titreparent').value='" - . strtr( - str_replace("'", "’", - str_replace('"', """, - textebrut($titre))), - "\n\r", " ")."';"; - $onClick .= "findObj('selection_rubrique').style.display='none';"; - $onClick .= "return false;"; - - - $corps .= "<input type='submit' value='"._T('bouton_choisir')."' onClick=\"$onClick\" class=\"fondo\" />"; - $corps .= "</div>"; - $corps .= "</div>"; - - return $corps; + $f = charger_fonction('informer', 'inc'); + return $f($id, $col, $exclus, _request('rac'), _request('type')); } ?> diff --git a/ecrire/inc/informer.php b/ecrire/inc/informer.php new file mode 100644 index 0000000000000000000000000000000000000000..186c873c9233c7eac324a9a890a17555bdbfe94e --- /dev/null +++ b/ecrire/inc/informer.php @@ -0,0 +1,75 @@ +<?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 + +function inc_informer_dist($id, $col, $exclus, $rac, $type) +{ + global $couleur_foncee,$spip_display,$spip_lang_right ; + + include_spip('inc/texte'); + 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 = ''; + + $res = ''; + if ($type == "rubrique" AND $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_rubrique', 'on')) { + list($fid, $dir, $nom, $format) = $res; + $res = ratio_image($fid, $nom, $format, 100, 48, "alt=''"); + if ($res) + $res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>"; + } + } + + $rac = htmlentities($rac); + spip_log("info $res"); +# ce lien provoque la selection (directe) de la rubrique cliquee + $onClick = "findObj_forcer('id_parent').value=$id;"; +# et l'affichage de son titre dans le bandeau + $onClick .= "findObj_forcer('titreparent').value='" + . strtr( + str_replace("'", "’", + str_replace('"', """, + textebrut($titre))), + "\n\r", " ")."';"; + $onClick .= "findObj_forcer('selection_rubrique').style.display='none';"; + $onClick .= "return false;"; + + return "<div style='display: none;'>" + . "<input type='text' id='".$rac."_sel' value='$id' />" + . "<input type='text' id='".$rac."_sel2' value=\"" + . entites_html($titre) + . "\" />" + . "</div>" + . "<div class='arial2' style='padding: 5px; background-color: white; border: 1px solid $couleur_foncee; border-top: 0px;'>" + . (!$res ? '' : $res) + . "<div><p><b>$titre</b></p></div>" + . (!$descriptif ? '' : "<div>$descriptif</div>") + . "<div style='text-align: $spip_lang_right;'>" + . "<input type='submit' value='" + . _T('bouton_choisir') + . "' onClick=\"$onClick\" class=\"fondo\" />" + . "</div>" + . "</div>"; +} +?>