Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2181 → Rev 2182

/trunk/widget/modules/stats/Stats.php
31,7 → 31,7
if (method_exists($this, $methode)) {
$retour = $this->$methode();
} else {
$this->messages[] = "Ce type de carte '$methode' n'est pas disponible.";
$this->messages[] = "Le type de statistiques '$methode' n'est pas disponible.";
}
 
if (is_null($retour)) {
216,5 → 216,42
$json = $this->getDao()->consulter($url);
return (array) json_decode($json);
}
 
/**
* Aligne les contributeurs contre un mur et... euh... hum;
* Appelle le service pour obtenir les n principaux contributeurs depuis x jours,
* en termes d'observations ajoutées, d'images ajoutées, ou les deux
* Paramètres : "jours" (int), "nombre" (int), "critere" ("obs" ou "img" ou "")
* @return array
*/
public function executerGrandsContributeurs() {
$widget = null;
$widget['donnees'] = (array) $this->recupererStatsTxtGrandsContributeurs();
if (!is_null($widget)) {
$widget['squelette'] = 'stats_grands_contributeurs';
$widget['donnees']['url_service'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], 'CelStatistique');
}
return $widget;
}
 
private function recupererStatsTxtGrandsContributeurs() {
// Récupération des données au format Json
$service = "CelStatistiqueTxt/GrandsContributeurs";
 
if (isset($this->parametres['nombre'])) {
$this->getDao()->ajouterParametre('nombre', $this->parametres['nombre']);
}
if (isset($this->parametres['jours'])) {
$this->getDao()->ajouterParametre('jours', $this->parametres['jours']);
}
if (isset($this->parametres['critere'])) {
$this->getDao()->ajouterParametre('critere', $this->parametres['critere']);
}
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
$json = $this->getDao()->consulter($url);
 
return (array) json_decode($json);
}
}
?>