Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 255 Rev 259
Line 31... Line 31...
31
	private function analyserRessources() {
31
	private function analyserRessources() {
32
		$nbreRessources = count($this->ressources);
32
		$nbreRessources = count($this->ressources);
33
		if ($nbreRessources == 0) {
33
		if ($nbreRessources == 0) {
34
			$message = "A implémenter : carte proportionnelle ensemble des infos";
34
			$message = "A implémenter : carte proportionnelle ensemble des infos";
35
			$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
35
			$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
-
 
36
			throw new Exception($message, $code);
36
		} else if ($nbreRessources == 1) {
37
		} else if ($nbreRessources == 1) {
37
			if ($this->etreRessourceIdentifiants(0)) {
38
			if ($this->etreRessourceIdentifiants(0)) {
38
				$this->sousService = 'Taxons';
39
				$this->sousService = 'Taxons';
39
			} else if ($this->etreRessourceLegende(0)) {
40
			} else if ($this->etreRessourceLegende(0)) {
40
				$message = "A implémenter : légende carte proportionnelle ensemble des infos";
41
				$message = "A implémenter : légende carte proportionnelle ensemble des infos";
Line 54... Line 55...
54
 
55
 
55
	private function etreRessourceIdentifiants($position) {
56
	private function etreRessourceIdentifiants($position) {
56
		$ok = true;
57
		$ok = true;
57
		if (isset($this->ressources[$position])) {
58
		if (isset($this->ressources[$position])) {
58
			$ids = $this->ressources[$position];
59
			$ids = $this->ressources[$position];
59
			$projetPattern = '(?:(?:[A-Z0-9]+(\.(?:nn|nt)?):)?(?:[0-9]+,)*[0-9]+)';
60
			$projetPattern = '(?:(?:(?:[A-Za-z0-9]+\.)?(?:nn|nt)?:)?(?:[0-9]+,)*[0-9]+)';
60
			$patternComplet = "/^$projetPattern(?:;$projetPattern)*$/i";
61
			$patternComplet = "/^$projetPattern(?:;$projetPattern)*$/i";
61
			$ok = preg_match($patternComplet, $ids) ? true : false;
62
			$ok = preg_match($patternComplet, $ids) ? true : false;
62
		}
63
		}
63
		return $ok;
64
		return $ok;