Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 319 Rev 322
Line 60... Line 60...
60
	
60
	
61
	public function consulter($ressources, $param) {
61
	public function consulter($ressources, $param) {
62
		// Initialisation des variables
62
		// Initialisation des variables
63
		$this->ressources = $ressources;
63
		$this->ressources = $ressources;
-
 
64
		$this->param = $param;
-
 
65
		if ($this->analyserRessources() == true) {
-
 
66
			$resultat = $this->formerLegende();
64
		$this->param = $param;
67
		} else {
-
 
68
			$this->traiterParametres();
-
 
69
			$resultat = $this->formerCarte();
-
 
70
		}
-
 
71
		return $resultat;
-
 
72
	}
-
 
73
	
65
		$this->traiterParametres();
74
	public function formerCarte() {
66
		$this->creerFormateur();
75
		$this->creerFormateur();
67
		$this->cartesFormateur->initialiserImage();
76
		$this->cartesFormateur->initialiserImage();
68
		
77
			
69
		$inventories = $this->cartesFormateur->chargerDonnees();
78
		$inventories = $this->cartesFormateur->chargerDonnees();
70
		$retour = '';
79
		$retour = '';
71
		if (is_array($inventories) && $inventories !== array()){
80
		if (is_array($inventories) && $inventories !== array()){
72
			// Connection referentiel communes 
-
 
73
			$this->chargerVille();
81
			$this->chargerVille();// Connection referentiel communes
74
			list($text, $merge) = $this->calculerRepartition($inventories);
82
			list($text, $merge) = $this->calculerRepartition($inventories);
75
			// Définition des couleurs des points
83
			// Définition des couleurs des points
76
			$couleurs = $this->cartesFormateur->definirCouleurs();
84
			$couleurs = $this->cartesFormateur->definirCouleurs();
77
			if ($text) {
85
			if ($text) {
Line 106... Line 114...
106
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
114
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
107
				throw new Exception($message);
115
				throw new Exception($message);
108
			}
116
			}
109
		}
117
		}
110
	}
118
	}
-
 
119
	private function analyserRessources() {
-
 
120
		$ok = false;
-
 
121
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
-
 
122
			$ok = true;
-
 
123
		}
-
 
124
		return $ok;
-
 
125
	}
-
 
126
	
-
 
127
	private function formerLegende() {
-
 
128
		$classe = 'LegendeCartes';
-
 
129
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
-
 
130
		$sousService = new $classe(new Conteneur());
-
 
131
		$resultat = $sousService->consulter($this->ressources, $this->param);
-
 
132
		return $resultat;
-
 
133
	}
Line 111... Line 134...
111
	
134
	
112
	private function traiterParametres() {
135
	private function traiterParametres() {
113
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
136
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
114
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
137
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';