Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 548 Rev 549
Line 300... Line 300...
300
				foreach ($tb as $types) {
300
				foreach ($tb as $types) {
301
					$url = Config::get('url_service_base').Config::get('nom_projet').
301
					$url = Config::get('url_service_base').Config::get('nom_projet').
302
						'/ontologies/TB:'.urlencode(urlencode($types));
302
						'/ontologies/TB:'.urlencode(urlencode($types));
303
					$val = $this->consulterHref($url);
303
					$val = $this->consulterHref($url);
304
					$libelle[$cle]= $val->nom;
304
					$libelle[$cle]= $val->nom;
305
					$detail[$cle]['libelle'] = $val->nom;
305
					$detail[$cle][$i]['libelle'] = $val->nom;
306
					$detail[$cle]['code'] = $val->code;
306
					$detail[$cle][$i]['code'] = $val->code;
307
					$detail[$cle]['href'] = $url;
307
					$detail[$cle][$i]['href'] = $url;
-
 
308
					$i++;
308
				}
309
				}
309
			}
310
			}
310
			if ($cle == 'sous_type.principal' || $cle == 'sous_type.secondaire' ) {
311
			if ($cle == 'sous_type.principal' || $cle == 'sous_type.secondaire' ) {
311
				$i = 0;
312
				$i = 0;
312
				foreach ($tb as $sstypes) {
313
				foreach ($tb as $sstypes) {
Line 325... Line 326...
325
		$resultat_typeBio['type_bio.detail'] = $detail;
326
		$resultat_typeBio['type_bio.detail'] = $detail;
326
		return $resultat_typeBio;
327
		return $resultat_typeBio;
327
	}
328
	}
Line -... Line 329...
-
 
329
	
328
	
330
	
329
	
331
	
330
	public function formaterTypeBioPrLibelle($info) {
332
	public function formaterTypeBioPrLibelle($info) {
331
		$libelle = $info['type.principal']." ";
333
		$libelle = $info['type.principal']." ";
332
		$libelle .= isset($info['sous_type.principal']) ? " (".$info['sous_type.principal'].") " : "";
334
		$libelle .= isset($info['sous_type.principal']) ? " (".$info['sous_type.principal'].") " : "";
Line 352... Line 354...
352
		$types = array();
354
		$types = array();
353
		if (preg_match("/^([a-zA-Zé]+)\-(.+)$|^([a-zA-Zé,]+[^\-])$/", $type_a_traiter, $retour)) {
355
		if (preg_match("/^([a-zA-Zé]+)\-(.+)$|^([a-zA-Zé,]+[^\-])$/", $type_a_traiter, $retour)) {
354
			//type
356
			//type
355
			$type = array();
357
			$type = array();
356
			$type[0] = (isset($retour[3])) ? $retour[3] : $retour[1] ;
358
			$type[0] = (isset($retour[3])) ? $retour[3] : $retour[1] ;
357
			if (preg_match("/,/", $type[0])) {
-
 
358
				$type = preg_split("/,/", $type[0]);
359
			$type = explode(",", $type[0]);
359
			}
-
 
360
			for ($i = 0 ; $i < count($type); $i++) {
360
			for ($i = 0 ; $i < count($type); $i++) {
361
				$types['type.'.$typePrimOuSec][$i] = $type[$i];
361
				$types['type.'.$typePrimOuSec][$i] = $type[$i];
362
			}
362
			}
363
			//sous types
363
			//sous types
364
			$ss_types = array();
364
			$ss_types = array();
365
			if (isset($retour[2]) && $retour[2] != '') {
365
			if (isset($retour[2]) && $retour[2] != '') {
366
 				$ss_types[0] =  $retour[2] ;
366
 				$ss_types[0] =  $retour[2] ;
367
 				if (preg_match("/\-/", $ss_types[0])) {
-
 
368
 					$ss_types = preg_split("/\-/", $ss_types[0]);
367
 				$ss_types = explode("-", $ss_types[0]);
369
 				}
-
 
370
				for ($i = 0 ; $i < count($ss_types); $i++) {
368
				for ($i = 0 ; $i < count($ss_types); $i++) {
371
					$types['sous_type.'.$typePrimOuSec][$i] = $ss_types[$i];
369
					$types['sous_type.'.$typePrimOuSec][$i] = $ss_types[$i];
372
				}
370
				}
373
			}
371
			}
374
    	}
372
    	}