Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 656 | Rev 740 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 656 Rev 664
Line 724... Line 724...
724
			}
724
			}
725
		}
725
		}
726
	}
726
	}
Line 727... Line 727...
727
 
727
 
728
	public function ajouterSignificationCode($champ, $valeur) {
-
 
729
		$categorie = $champ;
728
	public function ajouterSignificationCode($champ, $valeur) {
730
		if($this->termeOntologieEstEnCache($categorie, $valeur)) {
729
		if($this->termeOntologieEstEnCache($champ, $valeur)) {
731
			$nom_code = $this->obtenirTermeOntologieParCache($categorie, $valeur);
730
			$nom_code = $this->obtenirTermeOntologieParCache($champ, $valeur);
732
		} else {
731
		} else {
733
			$champ = ($champ == 'rang') ? 'rangTaxo' : rtrim($champ, '_Co,_Ga');
732
			$code = $this->transformerChampEnCode($champ);
734
			if (preg_match('/^([^_-]+)(?:_|-)([^_-]+)$/', $champ, $match)) {
733
			if (preg_match('/^([^_-]+)(?:_|-)([^_-]+)$/', $code, $match)) {
735
				$champ = $match[1].ucfirst($match[2]);
734
				$code = $match[1].ucfirst($match[2]);
736
			}
735
			}
737
			$url = Config::get('url_ontologie').$champ.':'.$valeur.'/nom';
736
			$url = Config::get('url_ontologie').$code.':'.$valeur.'/nom';
738
			$res = $this->consulterHref($url); //dans commun.php
737
			$res = $this->consulterHref($url); //dans commun.php
739
			$nom_code = $valeur;
738
			$nom_code = $valeur;
740
			if (is_object($res)) {
739
			if (is_object($res)) {
741
				$nom_code = $res->nom;
740
				$nom_code = $res->nom;
742
			}
741
			}
743
			$this->mettreEnCacheOntologie($categorie, $valeur, $nom_code);
742
			$this->mettreEnCacheOntologie($champ, $valeur, $nom_code);
744
		}
743
		}
745
		return $nom_code;
744
		return $nom_code;
Line 746... Line 745...
746
	}
745
	}