Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 288 Rev 289
Line 117... Line 117...
117
	
117
	
118
	public function traiterRessourceId($id) {
118
	public function traiterRessourceId($id) {
119
		$this->format_reponse .= '/id';
119
		$this->format_reponse .= '/id';
120
		if ($this->recherche == 'etendue') {
120
		if ($this->recherche == 'etendue') {
121
			$id = '%'.str_replace(' ','%', $id).'%';
121
			$id = '%'.str_replace(' ','%', $id).'%';
-
 
122
		}
-
 
123
		if (is_numeric($id)) {
-
 
124
			$this->requete_condition[] = 'c.id ='.$this->getBdd()->proteger($id);
-
 
125
		} else {
-
 
126
			$id = explode('bdtfx.nn:', $id);
-
 
127
			if (is_numeric($id[1])) {
-
 
128
				$this->requete_condition[] = 'c.num_nom ='.$this->getBdd()->proteger($id[1]);
-
 
129
			}
Line 122... Line 130...
122
		} 
130
		}
123
		
131
		
124
		$this->requete_champ = 'c.id AS num_nom, i.nom_sci AS titre, t1.resource AS tag, p.body AS texte';
132
		$this->requete_champ = 'c.id AS num_nom, i.nom_sci AS titre, t1.resource AS tag, p.body AS texte';
125
		$this->table = array(Config::get("bdd_correspondance_bdnff").' c',
133
		$this->table = array(Config::get("bdd_correspondance_bdnff").' c',
126
			Config::get("bdd_triples").' t1',
134
			Config::get("bdd_triples").' t1',
127
			Config::get("bdd_index").' i',
-
 
-
 
135
			Config::get("bdd_index").' i',
128
			Config::get("bdd_pages").' p');
136
			Config::get("bdd_pages").' p');
129
		$this->requete_condition[] = 'c.num_nom ='.$this->getBdd()->proteger($id);
137
		
130
		$this->requete_condition[] = 'c.id = i.num_nom';
138
		$this->requete_condition[] = 'c.id = i.num_nom';
Line 131... Line 139...
131
		$this->requete_condition[] = 'i.nom_sci = t1.value';
139
		$this->requete_condition[] = 'i.nom_sci = t1.value';
Line 370... Line 378...
370
	
378
	
371
		$this->afficherDonnees('titre', $reponse['titre']);
379
		$this->afficherDonnees('titre', $reponse['titre']);
372
		$type = (preg_match('/^Cle.*$/', $reponse['tag'])) ? '2' : '1' ;
380
		$type = (preg_match('/^Cle.*$/', $reponse['tag'])) ? '2' : '1' ;
373
		$this->afficherDonnees('type', $type);
381
		$this->afficherDonnees('type', $type);
374
		$this->table_retour['texte'] = $reponse['texte']; 
382
		$this->table_retour['texte'] = $reponse['texte']; 
Line 375... Line 383...
375
		$this->afficherDonnees('id', $reponse['num_nom']);
383
		//$this->afficherDonnees('id', $reponse['num_nom']);
376
		
384
		
Line 450... Line 458...
450
			$this->table_retour['nom_sci'] = $this->recupererNomSci($valeur);
458
			$this->table_retour['nom_sci'] = $this->recupererNomSci($valeur);
451
			$this->table_retour['id.href'] = $this->ajouterHref('noms', $valeur);
459
			$this->table_retour['id.href'] = $this->ajouterHref('noms', $valeur);
452
		} elseif (in_array($champ, array('type'))) {
460
		} elseif (in_array($champ, array('type'))) {
453
			$this->table_retour[$champ.'.code'] = $valeur;
461
			$this->table_retour[$champ.'.code'] = $valeur;
454
			$this->table_retour[$champ] = $this->recupererSignificationCode($valeur);
462
			$this->table_retour[$champ] = $this->recupererSignificationCode($valeur);
455
			$this->table_retour[$champ.'.href'] = $this->ajouterHrefAutreProjet('ontologies', 'texteType:', $valeur, 'commun');
463
			$this->table_retour[$champ.'.href'] = $this->ajouterHrefAutreProjet('ontologies', 'texteType:', $valeur, 'eflore');
456
		} else {
464
		} else {
457
			$this->table_retour[$champ] = $valeur;
465
			$this->table_retour[$champ] = $valeur;
458
		}
466
		}
459
	}
467
	}
Line 460... Line 468...
460
	
468
	
461
	
469
	
462
	public function recupererSignificationCode($code) {
470
	public function recupererSignificationCode($code) {
463
		$url = $this->ajouterHrefAutreProjet('ontologies', 'texteType:', $code.'/nom', 'commun');
471
		$url = $this->ajouterHrefAutreProjet('ontologies', 'texteType:', $code.'/nom', 'eflore');
464
		$res = $this->consulterHref($url);
472
		$res = $this->consulterHref($url);