Line 118... |
Line 118... |
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 |
}
|
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 |
}
|
- |
|
130 |
}
|
Line 123... |
Line 131... |
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';
|
131 |
$this->requete_condition[] = 'i.nom_sci = t1.value';
|
139 |
$this->requete_condition[] = 'i.nom_sci = t1.value';
|
Line 132... |
Line 140... |
132 |
$this->requete_condition[] = 't1.resource = p.tag';
|
140 |
$this->requete_condition[] = 't1.resource = p.tag';
|
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);
|