X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins-dist%2Frevisions%2Fprive%2Fobjets%2Fcontenu%2Frevision_fonctions.php;h=60c52e3b0ae2e23734a8a90d9a251255166fb25c;hb=dae7b78d26d32fb23e8c524f795bbaf40e685c6a;hp=e7b1eaf00e886502f949389ef61a9c81249ea2d6;hpb=52cf8ed924d5dcd0c28dde4b6c3196be6ec2d4f7;p=ptitvelo%2Fweb%2Fwww.git diff --git a/www/plugins-dist/revisions/prive/objets/contenu/revision_fonctions.php b/www/plugins-dist/revisions/prive/objets/contenu/revision_fonctions.php index e7b1eaf..60c52e3 100644 --- a/www/plugins-dist/revisions/prive/objets/contenu/revision_fonctions.php +++ b/www/plugins-dist/revisions/prive/objets/contenu/revision_fonctions.php @@ -2,7 +2,21 @@ if (!defined('_ECRIRE_INC_VERSION')) return; -function label_champ($champ){ +/** + * Trouver le label d'un champ de révision + * + * Quelques champs ont un label dans dans les chaînes de langue de SPIP + * Pour un champ particulier d'un objet particulier, le pipeline revisions_chercher_label + * peut être utilisé + * + * @param string $champ + * Le nom du champ révisionné + * @param string $objet + * Le type d'objet révisionné + * @return string $label + * Le label du champ + */ +function label_champ($champ,$objet=false){ $label = ""; // si jointure: renvoyer le nom des objets joints if (strncmp($champ,'jointure_',9)==0) @@ -21,10 +35,13 @@ function label_champ($champ){ case 'email': $label = "entree_adresse_email_2"; break; + case 'login': + $label = "item_login"; + break; case 'chapo': $champ = "chapeau"; default: - $label = "info_$champ"; + $label = pipeline('revisions_chercher_label',array('args'=>array('champ'=>$champ,'objet'=>$objet),'data' => $label? $label:'info_'.$champ)); break; } return $label?_T($label):"";