[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / revisions / afficher_diff / id_rubrique.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) {
14 return;
15 }
16
17 include_spip('inc/diff');
18
19 /**
20 * Afficher le diff d'un id_rubrique
21 * on affiche en fait le deplacement si id_rubrique a change
22 * le nom de la rubrique sinon
23 *
24 * @param string $champ
25 * @param string $old
26 * @param string $new
27 * @param string $format
28 * @return string
29 */
30 function afficher_diff_id_rubrique_dist($champ, $old, $new, $format = 'diff') {
31 // ne pas se compliquer la vie !
32 if ($old == $new) {
33 $out = _T('info_dans_rubrique')
34 . ' <b>&#171;&nbsp;' . generer_info_entite($new, 'rubrique', 'titre') . '&nbsp;&#187;</b>';
35 } else {
36 $out = _T(
37 'revisions:version_deplace_rubrique',
38 array(
39 'from' => generer_info_entite($old, 'rubrique', 'titre'),
40 'to' => generer_info_entite($new, 'rubrique', 'titre')
41 )
42 );
43 }
44
45 return $out;
46 }