Subversion Repositories eFlore/Applications.cel

Rev

Rev 2915 | Rev 3422 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2915 Rev 2925
Line 362... Line 362...
362
			$lieux_mondiaux = $this->effectuerRequeteGeocodingMondiale($lieu, '2,3,4,5,6,7,8', 50 - count($lieux_retour));
362
			$lieux_mondiaux = $this->effectuerRequeteGeocodingMondiale($lieu, '2,3,4,5,6,7,8', 50 - count($lieux_retour));
363
			usort($lieux_mondiaux, array($this, 'trierListeLieux'));
363
			usort($lieux_mondiaux, array($this, 'trierListeLieux'));
364
			$lieux_retour += $lieux_mondiaux;
364
			$lieux_retour += $lieux_mondiaux;
365
		}
365
		}
Line 366... Line 366...
366
 
366
 
367
		// Suppression de possibles doublons
367
		// Suppression de possibles doublons @WARNING marche pas !!!
Line 368... Line 368...
368
		$lieux_retour = $this->reduireListeLieux($lieux_retour);
368
		//$lieux_retour = $this->reduireListeLieux($lieux_retour);
369
		
369
		
Line 370... Line 370...
370
		return $lieux_retour;
370
		return $lieux_retour;
Line 392... Line 392...
392
		return $retour;
392
		return $retour;
393
	}
393
	}
Line 394... Line 394...
394
	
394
	
395
	/**
395
	/**
396
	 * Fonctions utilitaires
-
 
397
	 * 
396
	 * Fonctions utilitaires
Line -... Line 397...
-
 
397
	 */
398
	*/
398
 
399
	
399
	// qui a écrit cette m*rde ?
400
	protected function reduireListeLieux($tableau) {
400
	protected function reduireListeLieux($tableau) {
-
 
401
		$index = array();
-
 
402
		foreach($tableau as $ligne) {
401
		$index = array();
403
			// merci de mettre des commentaires !!!
402
		foreach($tableau as $ligne) {
404
			// ça enlève les 2 premières lettres ou chiffres du nom de lieu => wtf ?
403
			$index_loc = trim(preg_replace("/\([a-zA-Z0-9]{2}\)$/", "", $ligne[0])); 
405
			$index_loc = trim(preg_replace("/\([a-zA-Z0-9]{2}\)$/", "", $ligne[0])); 
404
			if(!isset($index[$index_loc])) {
406
			if(!isset($index[$index_loc])) {
405
				$index[$index_loc] = $ligne;
407
				$index[$index_loc] = $ligne;