Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 704 Rev 707
Line 171... Line 171...
171
	}
171
	}
Line 172... Line 172...
172
	
172
	
173
	public function executerListeUtilisateursNbrePhotos() {
173
	public function executerListeUtilisateursNbrePhotos() {
174
		$widget = null;
174
		$widget = null;
-
 
175
		$utilisateurs = $this->recupererStatsTxtListeUtilisateursNbrePhotos();
175
		$utilisateurs = $this->recupererStatsTxtListeUtilisateursNbrePhotos();
176
		if (isset($utilisateurs)) {
176
		$noms = $this->recupererUtilisateursNomPrenom(array_keys($utilisateurs));
177
			$noms = $this->recupererUtilisateursNomPrenom(array_keys($utilisateurs));
177
		foreach ($utilisateurs as $courriel => $infos) {
178
			foreach ($utilisateurs as $courriel => $infos) {
178
			if (array_key_exists($courriel, $noms)) {
179
				if (array_key_exists($courriel, $noms)) {
179
				$nom_infos = (array) $noms[$courriel];
180
					$nom_infos = (array) $noms[$courriel];
180
				$nom_fmt = $nom_infos['prenom'].' '.$nom_infos['nom'];
181
					$nom_fmt = $nom_infos['prenom'].' '.$nom_infos['nom'];
-
 
182
					$widget['donnees']['utilisateurs'][$nom_fmt] = $infos;
181
				$widget['donnees']['utilisateurs'][$nom_fmt] = $infos;
183
				}
182
			}
184
			}
183
		}
185
		}
184
		$widget['donnees']['filtres'] = $this->parametres;
186
		$widget['donnees']['filtres'] = $this->parametres;
185
		$widget['squelette'] = 'liste_utilisateurs_nbre_photos';
187
		$widget['squelette'] = 'liste_utilisateurs_nbre_photos';
Line 188... Line 190...
188
	
190
	
189
	private function recupererStatsTxtListeUtilisateursNbrePhotos() {
191
	private function recupererStatsTxtListeUtilisateursNbrePhotos() {
190
		// Récupération des données au format Json
192
		// Récupération des données au format Json
Line 191... Line -...
191
		$service = "CelStatistiqueTxt/ListeUtilisateursNbrePhotos";
-
 
192
		
193
		$service = "CelStatistiqueTxt/ListeUtilisateursNbrePhotos";
193
		$parametres = array();
194
		
194
		if (isset($this->parametres['mode']) && $this->parametres['mode'] == self::MODE_UTILISATEUR && $this->getAuthIdentifiant() != null) {
195
		if (isset($this->parametres['mode']) && $this->parametres['mode'] == self::MODE_UTILISATEUR && $this->getAuthIdentifiant() != null) {
195
			$parametres[] = 'utilisateur='.$this->getAuthIdentifiant();
196
			$this->getDao()->ajouterParametre('utilisateur', $this->getAuthIdentifiant());
196
		}
197
		}
197
		if (isset($this->parametres['num_taxon'])) {
198
		if (isset($this->parametres['num_taxon'])) {
198
			$parametres[] = 'num_taxon='.$this->parametres['num_taxon'];
199
			$this->getDao()->ajouterParametre('num_taxon', $this->parametres['num_taxon']);
199
		}
200
		}
200
		if (isset($this->parametres['taxon'])) {
201
		if (isset($this->parametres['taxon'])) {
201
			$parametres[] = 'taxon='.$this->parametres['taxon'];
202
			$this->getDao()->ajouterParametre('taxon', $this->parametres['taxon']);
202
		}
203
		}
203
		if (isset($this->parametres['start'])) {
204
		if (isset($this->parametres['start'])) {
204
			$parametres[] = 'start='.$this->parametres['start'];
205
			$this->getDao()->ajouterParametre('start', $this->parametres['start']);
205
		}
206
		}
-
 
207
		if (isset($this->parametres['limit'])) {
-
 
208
			$this->getDao()->ajouterParametre('limit', $this->parametres['limit']);
-
 
209
		}
206
		if (isset($this->parametres['limit'])) {
210
		if (isset($this->parametres['tag'])) {
207
			$parametres[] = 'limit='.$this->parametres['limit'];
-
 
Line 208... Line 211...
208
		}
211
			$this->getDao()->ajouterParametre('tag', $this->parametres['tag']);
-
 
212
		}
209
		$service .= (count($parametres) > 0) ? '?'.implode('&', $parametres) : '';
213
		
210
		
214
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
211
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
215
		
Line 212... Line 216...
212
		$json = $this->getDao()->consulter($url);
216
		$json = $this->getDao()->consulter($url);