165,35 → 165,40 |
private function ajouterCultivarGroupe() { |
$html = ''; |
if ($this->avoirInfo('cultivar_groupe')) { |
$groupe = $this->compo_nom['cultivar_groupe']; |
//si le champ cultivar_groupe n'est pas vide |
if ($this->compo_nom['cultivar']) { |
if ($this->avoirInfo('cultivar')) { |
//si il y a un cultivar, on ajoute des parenthèses au group (mais pas au grex) |
if (strrpos($this->compo_nom['cultivar_groupe'], ' gx ') !== false) { |
if (strrpos($groupe, ' gx ') !== false) { |
//si le grex est composé de groupe |
$tab_gp = explode(' gx ', $this->compo_nom['cultivar_groupe']); |
$html = ' <span class="gp">'.$tab_gp[0]. |
' <abbr title="grex">gx </abbr>('.$tab_gp[1]. |
' <abbr title="groupe">Gp</abbr>)</span>'; |
} elseif (strrpos($this->compo_nom['cultivar_groupe'], ' gx') !== false) { |
$gpEtGx = explode(' gx ', $groupe); |
$html = ' <span class="gp">'. |
$gpEtGx[0].' '.'<abbr title="grex">gx</abbr>'. |
' '. |
'('.$gpEtGx[1].' <abbr title="groupe">Gp</abbr>)'. |
'</span>'; |
} elseif (strrpos($groupe, ' gx') !== false) { |
//si il y a un grex et pas de groupe |
$tab_gp = explode(' gx', $this->compo_nom['cultivar_groupe']); |
$html = ' <span class="gp">'.$tab_gp[0].' <abbr title="grex">gx</abbr></span>'; |
$gx = str_replace(' gx', '', $groupe); |
$html = ' <span class="gp">'.$gx.' <abbr title="grex">gx</abbr></span>'; |
} else { //si il n'y a pas de grex mais un groupe |
$html = ' <span class="gp">'.$this->compo_nom['cultivar_groupe'].' <abbr title="groupe">Gp</abbr>)</span>'; |
$html = ' <span class="gp">('.$groupe.' <abbr title="groupe">Gp</abbr>)</span>'; |
} |
} else { //s'il n'y a pas de cultivar |
if (strrpos($this->compo_nom['cultivar_groupe'], ' gx ') !== false) { |
if (strrpos($groupe, ' gx ') !== false) { |
//si le grex est composé de groupe |
$tab_gp = explode(' gx ', $this->compo_nom['cultivar_groupe']); |
$html = ' <span class="gp">'.$tab_gp[0]. |
' <abbr title="grex">gx</abbr>'.$tab_gp[1]. |
' <abbr title="groupe">Gp</abbr></span>'; |
} elseif (strrpos($this->compo_nom['cultivar_groupe'], ' gx') !== false) { |
$gpEtGx = explode(' gx ', $groupe); |
$html = ' <span class="gp">'. |
$gpEtGx[0].' <abbr title="grex">gx</abbr>'. |
' '. |
$gpEtGx[1].' <abbr title="groupe">Gp</abbr>'. |
'</span>'; |
} elseif (strrpos($groupe, ' gx') !== false) { |
//si il y a un grex et pas de groupe |
$tab_gp = explode(' gx', $this->compo_nom['cultivar_groupe']); |
$html = ' <span class="gp">'.$tab_gp[0].' <abbr title="grex">gx</abbr></span>'; |
$gx = str_replace(' gx', '', $groupe); |
$html = ' <span class="gp">'.$gx.' <abbr title="grex">gx</abbr></span>'; |
} else { //si il n'y a pas de grex mais un groupe |
$html = ' <span class="gp">'.$this->compo_nom['cultivar_groupe'].' <abbr title="groupe">Gp</abbr></span>'; |
$html = ' <span class="gp">'.$groupe.' <abbr title="groupe">Gp</abbr></span>'; |
} |
} |
} |