Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1467 → Rev 1468

/trunk/jrest/services/NameImage.php
26,26 → 26,15
* 4: Le service redimensionne l'image et la renvoie
*/
 
/** Constante stockant l'URL de la page d'accueil de Photoflora.*/
define('EF_URL_PHOTOFLORA', 'http://photoflora.free.fr/');
/** Constante stockant l'URL de la page de Photoflora affichant toutes les images d'un taxon donné.*/
define('EF_URL_PHOTOFLORA_TAXON', EF_URL_PHOTOFLORA.'FiTax.php?NumTaxon=%s');
/** Constante stockant l'URL du dossier de photoflora contenant les images miniatures.*/
define('EF_URL_PHOTOFLORA_IMG_MIN', 'http://photoflora.free.fr/photos/%s/min/%s');
/** Constante stockant l'URL du service XML de Photoflora.*/
define('EF_URL_PHOTOFLORA_SERVICE', EF_URL_PHOTOFLORA.'ef_photoflora.php?nt=%s');
 
define('EF_URL_PHOTOFLORA_REGEXP_01', '/\/photos\/([^\/]+)\/max\/(.+)$/');
define('EF_URL_PHOTOFLORA_REGEXP_02', '/photoflora([^.]+)\.free\.fr\/max\/(.+)$/');
 
class NameImage extends Cel {
 
function getElement($uid){
$image = array();
$url_photoflora = $this->config['eflore']['url_service_photoflora'];
if(isset($uid[0])) {
$url = 'http://photoflora.free.fr/eflore-photoflora/services/index.php/0.1/projets/photoflora/images?masque.nn='.$uid[0].'&navigation.limite=1';
$url = $url_photoflora.'?masque.nn='.$uid[0].'&navigation.limite=1';
$resultat = @file_get_contents($url);
$resultat = json_decode($resultat);
if(is_object($resultat) && isset($resultat->resultats)) {
/trunk/jrest/services/NameMap.php
26,23 → 26,15
* A: Pas de carte disponible, generation de l'image
*/
 
// TODO: externaliser ceci dans le fichier de config
/** Constante stockant l'URL o. sont accessible les cartes. Le %s correspond au nom du fichier.*/
define('EF_URL_CARTO', 'http://www.tela-botanica.org/sites/eflore/generique/images/cartes/');
// france_BDNFF_4.02_nt8523.png
/** Constante stockant l'URL d'appel du module chorologie*/
define('EF_URL_CHORO', 'http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/');
// 182/chorologie
 
class NameMap extends Cel {
 
function getElement($uid){
 
$url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte'];
$nt = null;
 
if(isset($uid[0])) {
$retour = array('');
$file = 'http://localhost/service:eflore:0.1/chorodep/cartes/nn%3A'.$uid[0].'?retour.format=587&retour=image%2Fpng';
$file = $url_service_chorologie.'/nn%3A'.$uid[0].'?retour.format=587&retour=image%2Fpng';
$retour = array($file);
}