Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1671 Rev 1673
Line 246... Line 246...
246
						   Array($referentiel, $obs['nt'], $langue),
246
						   Array($referentiel, $obs['nt'], $langue),
247
						   self::$config['eflore']['url_service_nom_attribution']) . // TODO !
247
						   self::$config['eflore']['url_service_nom_attribution']) . // TODO !
248
			"&retour.champs=num_statut";
248
			"&retour.champs=num_statut";
249
		$noms = @json_decode(file_get_contents($url));
249
		$noms = @json_decode(file_get_contents($url));
250
		if(! $noms) return '';
250
		if(! $noms) return '';
251
		$noms = array_filter((array)($noms->resultat), array($this, retournerNumStatutUn));
251
		$noms = array_filter((array)($noms->resultat), array($this, retournerNumStatutUn)); // XXX: php 5.3
252
		$nom = array_pop($noms)->nom_vernaculaire;
252
		$nom = array_pop($noms)->nom_vernaculaire;
Line 253... Line 253...
253
		
253
		
254
		// cache
254
		// cache
255
		self::$cache['getNomCommun'][$cache_id] = $nom;
255
		self::$cache['getNomCommun'][$cache_id] = $nom;
256
		return $nom;
256
		return $nom;
Line 257... Line 257...
257
	}
257
	}
258
	
258
	
259
	private function retournerNumStatutUn(&$item) {
259
	private function retournerNumStatutUn(&$item) {
-
 
260
		return ($item->num_statut == 1);
-
 
261
	}
-
 
262
 
-
 
263
	private function retournerNumStatutUnArr(&$item) {
Line 260... Line 264...
260
		return ($item->num_statut == 1);
264
		return ($item['num_statut'] == 1);
261
	}
265
	}
262
	
266
	
263
	// si getNomCommun_v2 ou getNomCommun_v3 sont utilisés
267
	// si getNomCommun_v2 ou getNomCommun_v3 sont utilisés
Line 289... Line 293...
289
						 'masque.lg' => $langue,
293
						 'masque.lg' => $langue,
290
						 'retour.champs' => 'num_statut');
294
						 'retour.champs' => 'num_statut');
291
		$noms = $service->consulter(Array('nvjfl', 'noms-vernaculaires'), $donnees);
295
		$noms = $service->consulter(Array('nvjfl', 'noms-vernaculaires'), $donnees);
Line 292... Line 296...
292
		
296
		
293
		if(! $noms) return '';
297
		if(! $noms) return '';
294
		$noms = array_filter((array)($noms->resultat), array($this, retournerNumStatutUn));
298
		$noms = array_filter((array)($noms->resultat), array($this, retournerNumStatutUn)); // XXX: php 5.3
Line 295... Line 299...
295
		$nom = array_pop($noms)->nom_vernaculaire;
299
		$nom = array_pop($noms)->nom_vernaculaire;
296
		
300
		
297
		// cache
301
		// cache
Line 327... Line 331...
327
			$noms = $this->service->traiterRessources();
331
			$noms = $this->service->traiterRessources();
328
		} catch(Exception $e) { 
332
		} catch(Exception $e) { 
329
			return '';
333
			return '';
330
		}
334
		}
331
		if(! $noms) return '';
335
		if(! $noms) return '';
332
		$noms = array_filter($noms['resultat'], array($this, retournerNumStatutUn));
336
		$noms = array_filter($noms['resultat'], array($this, retournerNumStatutUnArr)); // XXX: php 5.3
333
		$premier_nom = array_pop($noms);
337
		$premier_nom = array_pop($noms);
334
		$nom = $premier_nom['nom_vernaculaire'];
338
		$nom = $premier_nom['nom_vernaculaire'];
Line 335... Line 339...
335
		
339
		
336
		// cache
340
		// cache