Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
- |
|
2 |
// declare(encoding='UTF-8');
|
2 |
/**
|
3 |
/**
|
3 |
* Web service retournant toutes les infos d'une observation donnée :
|
4 |
* Web service retournant toutes les infos d'une observation donnée :
|
4 |
* images, votes sur image et protocole, commentaires, votes sur commentaires, ...
|
5 |
* images, votes sur image et protocole, commentaires, votes sur commentaires, ...
|
5 |
*
|
6 |
*
|
6 |
* @category DEL
|
7 |
* @category DEL
|
- |
|
8 |
* @package Services
|
7 |
* @package Observations
|
9 |
* @subpackage Observations
|
8 |
* @version 0.1
|
10 |
* @version 0.1
|
9 |
* @author Raphaël Droz <raphael@tela-botanica.org>
|
11 |
* @author Mathias CHOUET <mathias@tela-botanica.org>
|
10 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
12 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
11 |
* @copyright Copyright (c) 2013, Tela Botanica (accueil@tela-botanica.org)
|
13 |
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
|
12 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
14 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
13 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
15 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
14 |
* @see http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=ApiIdentiplante01Observations
|
16 |
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
|
15 |
*
|
- |
|
16 |
* @config-depend: "url_image" (dans configurations/config_observations.ini) ex: http://www.tela-botanica.org/appli:cel-img:%09dXL.jpg
|
- |
|
17 |
*/
|
17 |
*/
|
18 |
|
- |
|
19 |
// http://localhost/del/services/0.1/observations/#id => une observation donnée et ses images, SANS LES propositions & nombre de commentaire
|
- |
|
20 |
|
- |
|
21 |
require_once(dirname(__FILE__) . '/../DelTk.php');
|
- |
|
22 |
|
- |
|
23 |
class ObservationDetails {
|
18 |
class ObservationDetails {
|
Line 24... |
Line 19... |
24 |
|
19 |
|
25 |
private $conteneur;
|
20 |
private $conteneur;
|
26 |
private $bdd;
|
21 |
private $bdd;
|
Line 108... |
Line 103... |
108 |
foreach ($infos as $info) {
|
103 |
foreach ($infos as $info) {
|
109 |
$image = array_intersect_key($info, array_flip(array('id_image', 'date', 'hauteur' , 'largeur', 'nom_original')));
|
104 |
$image = array_intersect_key($info, array_flip(array('id_image', 'date', 'hauteur' , 'largeur', 'nom_original')));
|
110 |
$image['binaire.href'] = sprintf($urlImgTpl, $image['id_image'], $imageFormat);
|
105 |
$image['binaire.href'] = sprintf($urlImgTpl, $image['id_image'], $imageFormat);
|
111 |
unset($info['id_image'], $info['date'], $info['hauteur'], $info['largeur'], $info['nom_original']);
|
106 |
unset($info['id_image'], $info['date'], $info['hauteur'], $info['largeur'], $info['nom_original']);
|
Line 112... |
Line 107... |
112 |
|
107 |
|
- |
|
108 |
if (!isset($this->observation)) {
|
- |
|
109 |
$this->observation = $info;
|
113 |
if (!isset($this->observation)) $this->observation = $info;
|
110 |
}
|
114 |
$this->observation['images'][$image['id_image']] = $image;
|
111 |
$this->observation['images'][$image['id_image']] = $image;
|
115 |
}
|
112 |
}
|
Line 116... |
Line 113... |
116 |
}
|
113 |
}
|