Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 657 Rev 662
Line 633... Line 633...
633
					break;
633
					break;
634
				case 'details' 		 :
634
				case 'details' 		 :
635
					$this->afficherTableDetails($champ, $valeur);
635
					$this->afficherTableDetails($champ, $valeur);
636
					break;
636
					break;
637
				case 'signification' :
637
				case 'signification' :
638
					//$this->afficherSignification($champ, $valeur);
638
					$this->afficherSignification($champ, $valeur);
639
					break;
639
					break;
640
				case 'href' 		 :
640
				case 'href' 		 :
641
					$url = $this->creerUrl($champ, $valeur);
641
					$url = $this->creerUrl($champ, $valeur);
642
					$this->table_retour[str_replace('id.href', 'href', $champ.'.href')] = $url;
642
					$this->table_retour[str_replace('id.href', 'href', $champ.'.href')] = $url;
643
					break;
643
					break;
Line 722... Line 722...
722
			}
722
			}
723
		}
723
		}
724
	}
724
	}
Line 725... Line 725...
725
 
725
 
726
	public function ajouterSignificationCode($champ, $valeur) {
-
 
727
		$categorie = $champ;
726
	public function ajouterSignificationCode($champ, $valeur) {
728
		if($this->termeOntologieEstEnCache($categorie, $valeur)) {
727
		if($this->termeOntologieEstEnCache($champ, $valeur)) {
729
			$nom_code = $this->obtenirTermeOntologieParCache($categorie, $valeur);
728
			$nom_code = $this->obtenirTermeOntologieParCache($champ, $valeur);
730
		} else {
729
		} else {
731
			$champ = ($champ == 'rang') ? 'rangTaxo' : rtrim($champ, '_Co,_Ga');
730
			$code = $this->transformerChampEnCode($champ);
732
			if (preg_match('/^([^_-]+)(?:_|-)([^_-]+)$/', $champ, $match)) {
731
			if (preg_match('/^([^_-]+)(?:_|-)([^_-]+)$/', $code, $match)) {
733
				$champ = $match[1].ucfirst($match[2]);
732
				$code = $match[1].ucfirst($match[2]);
734
			}
733
			}
735
			$url = Config::get('url_ontologie').$champ.':'.$valeur.'/nom';
734
			$url = Config::get('url_ontologie').$code.':'.$valeur.'/nom';
736
			$res = $this->consulterHref($url); //dans commun.php
735
			$res = $this->consulterHref($url); //dans commun.php
737
			$nom_code = $valeur;
736
			$nom_code = $valeur;
738
			if (is_object($res)) {
737
			if (is_object($res)) {
739
				$nom_code = $res->nom;
738
				$nom_code = $res->nom;
740
			}
739
			}
741
			$this->mettreEnCacheOntologie($categorie, $valeur, $nom_code);
740
			$this->mettreEnCacheOntologie($champ, $valeur, $nom_code);
742
		}
741
		}
743
		return $nom_code;
742
		return $nom_code;
Line 744... Line 743...
744
	}
743
	}