Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1360 Rev 2182
Line 29... Line 29...
29
		
29
		
30
		$methode = $this->traiterNomMethodeExecuter($this->page);
30
		$methode = $this->traiterNomMethodeExecuter($this->page);
31
		if (method_exists($this, $methode)) {
31
		if (method_exists($this, $methode)) {
32
			$retour = $this->$methode();
32
			$retour = $this->$methode();
33
		} else {
33
		} else {
34
			$this->messages[] = "Ce type de carte '$methode' n'est pas disponible.";
34
			$this->messages[] = "Le type de statistiques '$methode' n'est pas disponible.";
Line 35... Line 35...
35
		}
35
		}
36
 
36
 
37
		if (is_null($retour)) {
37
		if (is_null($retour)) {
Line 214... Line 214...
214
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
214
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
Line 215... Line 215...
215
		
215
		
216
		$json = $this->getDao()->consulter($url);
216
		$json = $this->getDao()->consulter($url);
217
		return (array) json_decode($json);
217
		return (array) json_decode($json);
-
 
218
	}
-
 
219
 
-
 
220
	/**
-
 
221
	 * Aligne les contributeurs contre un mur et... euh... hum;
-
 
222
	 * Appelle le service pour obtenir les n principaux contributeurs depuis x jours,
-
 
223
	 * en termes d'observations ajoutées, d'images ajoutées, ou les deux
-
 
224
	 * Paramètres : "jours" (int), "nombre" (int), "critere" ("obs" ou "img" ou "")
-
 
225
	 * @return array
-
 
226
	 */
-
 
227
	public function executerGrandsContributeurs() {
-
 
228
		$widget = null;
-
 
229
		$widget['donnees'] = (array) $this->recupererStatsTxtGrandsContributeurs();
-
 
230
		if (!is_null($widget)) {
-
 
231
			$widget['squelette'] = 'stats_grands_contributeurs';
-
 
232
			$widget['donnees']['url_service'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], 'CelStatistique');
-
 
233
		}
-
 
234
		return $widget;
-
 
235
	}
-
 
236
 
-
 
237
	private function recupererStatsTxtGrandsContributeurs() {
-
 
238
		// Récupération des données au format Json
-
 
239
		$service = "CelStatistiqueTxt/GrandsContributeurs";
-
 
240
 
-
 
241
		if (isset($this->parametres['nombre'])) {
-
 
242
			$this->getDao()->ajouterParametre('nombre', $this->parametres['nombre']);
-
 
243
		}
-
 
244
		if (isset($this->parametres['jours'])) {
-
 
245
			$this->getDao()->ajouterParametre('jours', $this->parametres['jours']);
-
 
246
		}
-
 
247
		if (isset($this->parametres['critere'])) {
-
 
248
			$this->getDao()->ajouterParametre('critere', $this->parametres['critere']);
-
 
249
		}
-
 
250
		
-
 
251
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
-
 
252
		$json = $this->getDao()->consulter($url);
-
 
253
 
-
 
254
		return (array) json_decode($json);
218
	}
255
	}
219
}
256
}
220
?>
257
?>