Subversion Repositories eFlore/Applications.cel

Rev

Rev 1395 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1395 Rev 2458
Line 1... Line 1...
1
<?php
1
<?php
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
* PHP Version 5
-
 
5
*
-
 
6
* @category  PHP
-
 
7
* @package   jrest
-
 
8
* @author    Aurélien Peronnet <aurelien@tela-botania.org>
-
 
9
* @copyright 2010 Tela-Botanica
-
 
10
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
-
 
11
* @version   SVN: <svn_id>
-
 
12
* @link      /doc/jrest/
-
 
13
*/
-
 
14
 
-
 
15
/**
-
 
16
* in : utf8
-
 
17
* out : utf8
-
 
18
* 
-
 
19
* Service recherche d'images publique a partir de divers critères
4
 * Service recherche d'images publique a partir de divers critères.
20
*
5
 *
-
 
6
 * @internal   Mininum PHP version : 5.2
-
 
7
 * @category   CEL
-
 
8
 * @package    Services
-
 
9
 * @subpackage Images
-
 
10
 * @version    0.1
-
 
11
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
-
 
12
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
-
 
13
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
-
 
14
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
-
 
15
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
-
 
16
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
21
*/
17
 */
22
class InventoryImageListPublic extends Cel {
18
class InventoryImageListPublic extends Cel {
Line 23... Line 19...
23
	
19
 
24
	const start_defaut = 0;
20
	const start_defaut = 0;
25
	const limit_defaut = 100;
-
 
26
	
21
	const limit_defaut = 100;
27
	const tri_defaut = 'ci.date_creation';
22
	const tri_defaut = 'ci.date_creation';
Line 28... Line 23...
28
	const dir_defaut = 'DESC';
23
	const dir_defaut = 'DESC';
Line 29... Line 24...
29
 
24
 
Line 30... Line 25...
30
	function getRessource() {
25
	public function getRessource() {
31
	
-
 
32
	}
26
 
33
 
27
	}
Line 34... Line 28...
34
	function getElement($uid)
28
 
35
	{
29
	public function getElement($uid) {
Line 55... Line 49...
55
		$criteres['recherche'] = isset($_GET['recherche']) ? $_GET['recherche'] : null;
49
		$criteres['recherche'] = isset($_GET['recherche']) ? $_GET['recherche'] : null;
56
		$criteres['tri'] = isset($_GET['tri']) ? $_GET['tri'] : self::tri_defaut;
50
		$criteres['tri'] = isset($_GET['tri']) ? $_GET['tri'] : self::tri_defaut;
57
		$criteres['dir'] = isset($_GET['dir']) ? $_GET['dir'] : self::dir_defaut;
51
		$criteres['dir'] = isset($_GET['dir']) ? $_GET['dir'] : self::dir_defaut;
Line 58... Line 52...
58
		
52
 
59
		$chercheur_images = new RechercheImage($this->config);
-
 
60
		
53
		$chercheur_images = new RechercheImage($this->config);
61
		$total = $chercheur_images->compterImages(null, $criteres);
54
		$total = $chercheur_images->compterImages(null, $criteres);
Line 62... Line 55...
62
		$images = $chercheur_images->rechercherImages(null, $criteres, $this->start, $this->limit);
55
		$images = $chercheur_images->rechercherImages(null, $criteres, $this->start, $this->limit);
63
 
-
 
64
    	$resultat = array('total' => $total,'images' => $images);
56
 
65
    	
57
		$resultat = array('total' => $total,'images' => $images);
Line 66... Line 58...
66
		$images_json = json_encode($resultat) ;
58
		$images_json = json_encode($resultat);
67
		$images_json = str_replace('\u0000','',$images_json);
59
		$images_json = str_replace('\u0000','',$images_json);
68
 
60
 
69
		header("content-type: application/json") ;
61
		header("content-type: application/json");
70
		print $images_json ;
62
		print $images_json;
71
		exit() ;
-
 
72
	}
63
		exit();