Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1291 Rev 1292
Line 62... Line 62...
62
	/**
62
	/**
63
	* Vérifier que le service est bien configuré
63
	* Vérifier que le service est bien configuré
64
	* */
64
	* */
65
	public function verifierConfiguration() {
65
	public function verifierConfiguration() {
66
		$erreurs = array();
66
		$erreurs = array();
67
		$tableauImages = $this->conteneur->getParametre('mapping_masque');
-
 
Line 68... Line 67...
68
 
67
 
69
		if (empty($this->mappingFiltre)) {
68
		if (empty($this->mappingFiltre)) {
70
			$erreurs[] = '- le fichier de configuration ne contient pas le tableau [mapping_masque] ou celui-ci est vide ;';
69
			$erreurs[] = '- le fichier de configuration ne contient pas le tableau [mapping_masque] ou celui-ci est vide ;';
71
		} else {
70
		} else {
Line 137... Line 136...
137
 
136
 
138
	/**
137
	/**
139
	 * Générer le lien du flux RSS
138
	 * Générer le lien du flux RSS
140
	 * */
139
	 * */
141
	private function creerUrlService() {
140
	private function creerUrlService() {
142
		$url_service = $this->conteneur->getParametre('url_service');
-
 
143
		$url_service .= '/'.$this->type_rss;
-
 
144
		//$url_service = '';
-
 
145
		if (count($_GET) > 0) {
-
 
146
			$parametres_get = array();
-
 
147
			foreach ($_GET as $cle => $valeur) {
-
 
148
				$parametres_get[] = $cle.'='.$valeur;
-
 
149
			}
-
 
150
			$url_service .= '?'.implode('&', $parametres_get);
-
 
151
		}
141
		$url_service = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
152
		return $url_service;
142
		return $url_service;
Line 153... Line 143...
153
	}
143
	}
154
 
144
 
Line 200... Line 190...
200
	private function creerDescription($donnees, $item) {
190
	private function creerDescription($donnees, $item) {
201
		$idTag = htmlspecialchars($donnees['id_tag']);
191
		$idTag = htmlspecialchars($donnees['id_tag']);
202
		$idObs = htmlspecialchars($donnees['id_observation']);
192
		$idObs = htmlspecialchars($donnees['id_observation']);
203
		$idImg = htmlspecialchars($donnees['id_image']);
193
		$idImg = htmlspecialchars($donnees['id_image']);
204
		$urlImg = $this->getUrlImage($donnees['id_image']);
194
		$urlImg = $this->getUrlImage($donnees['id_image']);
205
		$miniatureUrl = $this->getUrlImage($donnees['id_image'], 'CRX2S');
195
		$miniatureUrl = $this->getUrlImage($donnees['id_image'], 'CRS');
206
		$proposition = htmlspecialchars($donnees['nom_sel']);
196
		$nomSelActuel = htmlspecialchars($donnees['nom_sel']);
-
 
197
		$dateObs = htmlspecialchars(str_replace(' 00:00:00', '', $donnees['date_observation']));
207
		//$protocole = htmlspecialchars($donnees['intitule']);
198
		$lieuObs = htmlspecialchars($donnees['zone_geo']);
208
		$tag = $donnees['tag'];
199
		$tag = htmlspecialchars($donnees['tag']);
-
 
200
		$dateTag = htmlspecialchars(strftime('%A %d %B %Y à %H:%M', strtotime($donnees['date'])));
209
		$auteur = htmlspecialchars($this->creerAuteurImg($donnees));
201
		$auteurImg = htmlspecialchars($this->creerAuteurImg($donnees));
210
		$tagueur = htmlspecialchars($this->creerTagueur($donnees));
202
		$tagueur = htmlspecialchars($this->creerTagueur($donnees));
Line 211... Line 203...
211
 
203
 
212
		$description =
-
 
213
			'<ul>'.
204
		$description = '<style>.champ{color:grey} .gauche{float:left;padding:0 20px 0 0;} ul{list-style-type:none;padding:0;}</style>'.
214
				"<li>Tag pictoFlora #$idTag</li>".
205
			'<h2>'."Tag pictoFlora #$idTag pour l'image #$idImg de l'observation #$idObs".'</h2>'.
215
				'<li>'.
206
			'<div class="gauche">'.
216
				'	<a href="'.$urlImg.'">'.
207
			'	<a href="'.$urlImg.'">'.
217
				'		<img src="'.$miniatureUrl.'" alt="Img #'.$idImg.'"/>'.
208
			'		<img src="'.$miniatureUrl.'" alt="Img #'.$idImg.'"/>'.
218
				'		Image #'.$idImg.
209
			'	</a>'.
-
 
210
			'</div>'.
-
 
211
			'<div class="gauche">'.
219
				'	</a>'.
212
			"	<h3>Image #$idImg de l'observation #$idObs</h3>".
220
				'</li>'.
213
			'	<ul>'.
-
 
214
			'		<li><span class="champ">'."Auteur de l'image :</span> $auteurImg</li>".
221
				"<li>Auteur de l'image : $auteur</li>".
215
			'		<li><span class="champ">'."Nom saisi actuel :</span> <em>$nomSelActuel</em></li>".
222
				"<li>Observation #$idObs : <em>$proposition</em></li>".
216
			'		<li><span class="champ">'."Lieu :</span> $lieuObs</li>".
-
 
217
			'		<li><span class="champ">'."Date :</span> $dateObs</li>".
-
 
218
			'	</ul>'.
-
 
219
			'</div>'.
-
 
220
			'<div class="gauche">'.
-
 
221
			"	<h3>Tag #$idTag</h3>".
223
				// TODO : ajouter le protocole ? "<li>Protocole : $protocole</li>".
222
			'	<ul>'.
224
				"<li>Tag : <strong>$tag</strong></li>".
223
			'		<li><span class="champ">'."Tag :</span> <strong>$tag</strong></li>".
-
 
224
			'		<li><span class="champ">'."Auteur :</span> $tagueur</li>".
225
				"<li>Auteur du tag : $tagueur</li>".
225
			'		<li><span class="champ">'."Taguée le :</span> $dateTag</li>".
-
 
226
			'	</ul>'.
226
			'</ul>';
227
			'</div>';
227
		return $description;
228
		return $description;
Line 228... Line 229...
228
	}
229
	}
229
 
230
 
Line 259... Line 260...
259
 
260
 
260
	/**
261
	/**
261
	 * Retrouver les derniers votes image
262
	 * Retrouver les derniers votes image
262
	 * */
263
	 * */
263
	private function getDerniersVotesImage() {
264
	private function getDerniersVotesImage() {
-
 
265
		$requete = 'SELECT DISTINCT id_tag, tag, date, '.
264
		$requete =  'SELECT DISTINCT id_tag, tag, date, do.id_observation, do.nom_sel, doi.id_image, '.
266
				'	do.id_observation, do.nom_sel, do.zone_geo, do.date_observation, doi.id_image, '.
265
				'	duo.prenom AS tagueur_prenom, duo.nom AS tagueur_nom, duo.courriel AS tagueur_courriel, '.
267
				'	duo.prenom AS tagueur_prenom, duo.nom AS tagueur_nom, duo.courriel AS tagueur_courriel, '.
266
				'	du.prenom AS auteur_prenom, du.nom AS auteur_nom, du.courriel AS auteur_courriel '.
268
				'	du.prenom AS auteur_prenom, du.nom AS auteur_nom, du.courriel AS auteur_courriel '.
267
				'FROM del_image_tag AS dit '.
269
				'FROM del_image_tag AS dit '.
268
				'	INNER JOIN del_obs_image AS doi '.
270
				'	INNER JOIN del_obs_image AS doi '.