Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 1007 Rev 1166
Line 70... Line 70...
70
		if (empty($this->parametres['retour.format'])) {
70
		if (empty($this->parametres['retour.format'])) {
71
			$this->parametres['retour.format'] = 'max';
71
			$this->parametres['retour.format'] = 'max';
72
		}
72
		}
73
		if (empty($this->parametres['ns.structure']) &&
73
		if (empty($this->parametres['ns.structure']) &&
74
			$this->parametres['retour.format'] != 'oss') {
74
			$this->parametres['retour.format'] != 'oss') {
75
			$this->parametres['ns.structure'] = 'au,an,bib';
75
			$this->parametres['ns.structure'] = 'au,an,bib,bib_excl';
76
		}
76
		}
77
	}
77
	}
Line 78... Line 78...
78
 
78
 
79
 
79
 
Line 80... Line 80...
80
	public function verifierParametres() {
80
	public function verifierParametres() {
81
		//$this->verifierParametresAPI();
81
		//$this->verifierParametresAPI();
82
 
82
 
83
		$this->verifierParametre('recherche', 'stricte|floue|etendue|complete');
83
		$this->verifierParametre('recherche', 'stricte|floue|etendue|complete');
Line 84... Line 84...
84
		$this->verifierParametre('ns.format', 'htm|txt');
84
		$this->verifierParametre('ns.format', 'htm|txt');
85
		$this->verifierParametre('retour.format', 'min|max|oss|perso');
85
		$this->verifierParametre('retour.format', 'min|max|oss|perso');
86
		$this->verifierParametreAvecValeurMultipe('ns.structure', 'an|au|bib|ad|gen|sp|ssp|fam|au_ss|bib_ss');
86
		$this->verifierParametreAvecValeurMultipe('ns.structure', 'an|au|bib|ad|gen|sp|ssp|fam|au_ss|bib_ss|bib_excl');
87
 
87
 
Line 251... Line 251...
251
		$structure_nom = explode(',', $valeur);
251
		$structure_nom = explode(',', $valeur);
Line 252... Line 252...
252
 
252
 
253
		foreach ($structure_nom as $structure) {
253
		foreach ($structure_nom as $structure) {
254
			$structure = trim($structure);
254
			$structure = trim($structure);
255
			$patterns = array('/^an$/', '/^au$/', '/^bib$/', '/^ad$/', '/^sp$/', '/^gen$/', '/^ssp$/','/^fam$/',
255
			$patterns = array('/^an$/', '/^au$/', '/^bib$/', '/^ad$/', '/^sp$/', '/^gen$/', '/^ssp$/','/^fam$/',
256
				'/^au_ss$/','/^bib_ss$/');
256
				'/^au_ss$/','/^bib_ss$/','/^bib_excl$/');
257
			$champs = array('annee', 'auteur', 'biblio_origine', 'nom_addendum', 'epithete_sp', 'genre',
257
			$champs = array('annee', 'auteur', 'biblio_origine', 'nom_addendum', 'epithete_sp', 'genre',
Line 258... Line 258...
258
				'epithete_infra_sp','famille','auteur', 'biblio_origine');
258
				'epithete_infra_sp','famille','auteur', 'biblio_origine','source_biblio_exclure');
259
 
259
 
260
			// avec str_replace() 'sp' est inclu dans 'ssp', et la conversion pour 'ssp' est mauvaise
260
			// avec str_replace() 'sp' est inclu dans 'ssp', et la conversion pour 'ssp' est mauvaise
261
			$this->compo_nom[$structure] = preg_replace($patterns, $champs, $structure);
261
			$this->compo_nom[$structure] = preg_replace($patterns, $champs, $structure);
Line 805... Line 805...
805
				$format = array(
805
				$format = array(
806
					'au' => '<span class="auteur">%s</span>',
806
					'au' => '<span class="auteur">%s</span>',
807
					'an' => '[<span class="annee">%s</span>]',
807
					'an' => '[<span class="annee">%s</span>]',
808
					'an_bib' => '[<span class="annee">%s</span>, <span class="biblio">%s</span>]',
808
					'an_bib' => '[<span class="annee">%s</span>, <span class="biblio">%s</span>]',
809
					'bib' => '[<span class="biblio">%s</span>]',
809
					'bib' => '[<span class="biblio">%s</span>]',
810
					'ad' => '[<span class="adendum">%s</span>]');
810
					'ad' => '[<span class="adendum">%s</span>]',
-
 
811
					'bib_excl' => '<span class="bib_excl">, %s</span>');
811
			} else {
812
			} else {
812
				$format = array(
813
				$format = array(
813
					'au' => '%s',
814
					'au' => '%s',
814
					'an' => '[%s]',
815
					'an' => '[%s]',
815
					'an_bib' => '[%s, %s]',
816
					'an_bib' => '[%s, %s]',
Line 818... Line 819...
818
					'gen' => '%s',
819
					'gen' => '%s',
819
					'sp' => '%s',
820
					'sp' => '%s',
820
					'ssp' => '%s',
821
					'ssp' => '%s',
821
					'fam' => '%s',
822
					'fam' => '%s',
822
					'au_ss' => '%s',
823
					'au_ss' => '%s',
823
					'bib_ss' => '%s');
824
					'bib_ss' => '%s',
-
 
825
					'bib_excl' => ', %s'
-
 
826
				);
824
			}
827
			}
825
			$compo_nom = array();
828
			$compo_nom = array();
Line 826... Line 829...
826
 
829
 
827
			foreach ($this->compo_nom as $key => $champ) {
830
			foreach ($this->compo_nom as $key => $champ) {
Line 847... Line 850...
847
				$nom_complet[] = sprintf($format['an'], $an);
850
				$nom_complet[] = sprintf($format['an'], $an);
848
			}
851
			}
849
		} elseif (isset($bib)) {
852
		} elseif (isset($bib)) {
850
			$nom_complet[] = sprintf($format['bib'], $bib);
853
			$nom_complet[] = sprintf($format['bib'], $bib);
851
		}
854
		}
-
 
855
		if (isset($bib_excl)) {
-
 
856
			$nom_complet[] = sprintf($format['bib_excl'], $bib_excl);
-
 
857
		}
852
		if (isset($ad)) $nom_complet[] = sprintf($format['ad'], $ad);
858
		if (isset($ad)) $nom_complet[] = sprintf($format['ad'], $ad);
853
		if (isset($gen)) $nom_complet[] = sprintf($format['gen'], $gen);
859
		if (isset($gen)) $nom_complet[] = sprintf($format['gen'], $gen);
854
		if (isset($ssp)) $nom_complet[] = sprintf($format['ssp'], $ssp);
860
		if (isset($ssp)) $nom_complet[] = sprintf($format['ssp'], $ssp);
855
		if (isset($sp)) $nom_complet[] = sprintf($format['sp'], $sp);
861
		if (isset($sp)) $nom_complet[] = sprintf($format['sp'], $sp);
856
		if (isset($fam)) $nom_complet[] = sprintf($format['fam'], $fam);
862
		if (isset($fam)) $nom_complet[] = sprintf($format['fam'], $fam);