Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
// $Id: ezmlm-msgdisplay.php,v 1.9 2008-05-23 10:18:37 alexandre_tb Exp $
|
2 |
// $Id: ezmlm-msgdisplay.php,v 1.10 2008-08-25 15:22:03 alexandre_tb Exp $
|
3 |
//
|
3 |
//
|
4 |
// ezmlm-msgdisplay.php - ezmlm-php v2.0
|
4 |
// ezmlm-msgdisplay.php - ezmlm-php v2.0
|
5 |
// --------------------------------------------------------------
|
5 |
// --------------------------------------------------------------
|
6 |
// Will parse a template (if specified) and display a message.
|
6 |
// Will parse a template (if specified) and display a message.
|
7 |
// Includes a default template.
|
7 |
// Includes a default template.
|
Line 90... |
Line 90... |
90 |
$nom_repertoire = preg_replace('!/archive/(.*)/.*$!', '\1', $relfile);
|
90 |
$nom_repertoire = preg_replace('!/archive/(.*)/.*$!', '\1', $relfile);
|
91 |
$nom_fichier = preg_replace('!/archive/.*/(.*)$!', '\1', $relfile);
|
91 |
$nom_fichier = preg_replace('!/archive/.*/(.*)$!', '\1', $relfile);
|
Line 92... |
Line 92... |
92 |
|
92 |
|
Line -... |
Line 93... |
- |
|
93 |
$repertoire_suivant = $nom_repertoire;
|
- |
|
94 |
|
- |
|
95 |
// On recupere le numero du dernier message
|
- |
|
96 |
if (file_exists($this->listdir.'/archnum')) {
|
- |
|
97 |
$numero_dernier_message = file_get_contents($this->listdir.'/archnum');
|
93 |
$repertoire_suivant = $nom_repertoire;
|
98 |
}
|
94 |
|
99 |
|
95 |
// a partir du nom du fichier
|
100 |
// a partir du nom du fichier
|
96 |
// et du nom du repertoire, on reconstitue
|
101 |
// et du nom du repertoire, on reconstitue
|
Line 97... |
Line 102... |
97 |
// le numero du message stocke dans le fichier d index
|
102 |
// le numero du message stocke dans le fichier d index
|
98 |
// le message 12 du repertoire 2 a le numero 112
|
103 |
// le message 12 du repertoire 2 a le numero 212
|
99 |
|
104 |
|
100 |
if ($nom_repertoire == '0') {
|
105 |
if ($nom_repertoire == '0') {
|
Line 270... |
Line 275... |
270 |
if ($mailDecode->parts[$i]->ctype_parameters['charset'] == 'UTF-8') {
|
275 |
if ($mailDecode->parts[$i]->ctype_parameters['charset'] == 'UTF-8') {
|
271 |
$corps .= utf8_decode($mailDecode->parts[$i]->body);
|
276 |
$corps .= utf8_decode($mailDecode->parts[$i]->body);
|
272 |
}
|
277 |
}
|
273 |
}
|
278 |
}
|
274 |
break;
|
279 |
break;
|
275 |
case 'html' : $corps .= trim(strip_tags ($mailDecode->parts[$i]->body, '<p><a>'));
|
280 |
case 'html' : $corps .= trim(strip_tags ($mailDecode->parts[$i]->body, '<br><p><a><style>'));
|
276 |
break ;
|
281 |
break ;
|
277 |
case 'mixed' :
|
282 |
case 'mixed' :
|
278 |
case 'rfc822' :
|
283 |
case 'rfc822' :
|
279 |
case 'alternative' :
|
284 |
case 'alternative' :
|
280 |
case 'appledouble' :
|
285 |
case 'appledouble' :
|
Line 286... |
Line 291... |
286 |
|
291 |
|
287 |
if ($mailDecode->parts[$i]->ctype_secondary == 'octet-stream') {
|
292 |
if ($mailDecode->parts[$i]->ctype_secondary == 'octet-stream') {
|
288 |
$nom_piece_jointe = $mailDecode->parts[$i]->ctype_parameters['name'] ;
|
293 |
$nom_piece_jointe = $mailDecode->parts[$i]->ctype_parameters['name'] ;
|
289 |
$tab = explode ('.', $nom_piece_jointe) ;
|
294 |
$tab = explode ('.', $nom_piece_jointe) ;
|
290 |
$extension = $tab[count ($tab) - 1] ;
|
295 |
$extension = $tab[count ($tab) - 1] ;
|
291 |
$mimeType = type_fichier_mime::factory($extension, $GLOBALS['projet_db']);
|
296 |
$mimeType = type_fichier_mime::factory($extension);
|
292 |
$mimeType->setCheminIcone(PROJET_CHEMIN_ICONES) ;
|
297 |
$mimeType->setCheminIcone(PROJET_CHEMIN_ICONES) ;
|
293 |
} else {
|
298 |
} else {
|
294 |
$nom_piece_jointe = isset ($mailDecode->parts[$i]->d_parameters['filename']) ?
|
299 |
$nom_piece_jointe = isset ($mailDecode->parts[$i]->d_parameters['filename']) ?
|
295 |
$mailDecode->parts[$i]->d_parameters['filename'] : $mailDecode->parts[$i]->ctype_parameters['name'] ;
|
300 |
$mailDecode->parts[$i]->d_parameters['filename'] : $mailDecode->parts[$i]->ctype_parameters['name'] ;
|
296 |
$mimeType = new type_fichier_mime($GLOBALS['projet_db'], $mailDecode->parts[$i]->ctype_primary.'/'.
|
301 |
$mimeType = new type_fichier_mime( $mailDecode->parts[$i]->ctype_primary.'/'.
|
297 |
$mailDecode->parts[$i]->ctype_secondary, PROJET_CHEMIN_ICONES) ;
|
302 |
$mailDecode->parts[$i]->ctype_secondary, PROJET_CHEMIN_ICONES) ;
|
298 |
}
|
- |
|
299 |
|
303 |
}
|
300 |
$corps .= '<a href="'.PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.
|
304 |
$lien = PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.
|
301 |
'&actionargs[]='.$numero_mois.
|
305 |
'&actionargs[]='.$numero_mois.
|
302 |
'&actionargs[]='.$numero_mail;
|
- |
|
303 |
|
306 |
'&actionargs[]='.$numero_mail;
|
304 |
if (count ($profondeur) > 0) {
|
307 |
if (count ($profondeur) > 0) {
|
305 |
array_shift($profondeur) ;
|
308 |
array_shift($profondeur) ;
|
- |
|
309 |
for ($j= 0; $j < count ($profondeur); $j++) $lien .= '&actionargs[]='.$profondeur[$j];
|
- |
|
310 |
}
|
- |
|
311 |
$lien .= '&actionargs[]='.$i ;
|
- |
|
312 |
$corps .= '<a href="'.$lien.'">';
|
- |
|
313 |
|
- |
|
314 |
$tableau_type_image = array ('jpg', 'jpeg', 'pjpeg');
|
- |
|
315 |
|
- |
|
316 |
if (in_array ($mailDecode->parts[$i]->ctype_secondary, $tableau_type_image)) {
|
- |
|
317 |
$corps .= '<img src="'.$lien.'&min=1" alt="'.$nom_piece_jointe.'" /> ' ;
|
- |
|
318 |
$texte_lien = '';
|
- |
|
319 |
} else {
|
- |
|
320 |
$corps .= '<img src="'.$mimeType->getCheminIcone().'" alt="'.$nom_piece_jointe.'" /> ' ;
|
306 |
for ($j= 0; $j < count ($profondeur); $j++) $corps .= '&actionargs[]='.$profondeur[$j];
|
321 |
$texte_lien = $nom_piece_jointe;
|
307 |
}
|
- |
|
308 |
$corps .= '&actionargs[]='.$i ;
|
- |
|
309 |
$corps .= '">'.'<img src="'.$mimeType->getCheminIcone().'" alt="'.$nom_piece_jointe.'" /> ' ;
|
322 |
}
|
310 |
$corps .= $nom_piece_jointe;
|
323 |
$corps .= $texte_lien;
|
311 |
$corps .= '</a><br />' ;
|
324 |
$corps .= '</a><br />' ;
|
312 |
break ;
|
325 |
break ;
|
313 |
}
|
326 |
}
|
314 |
}
|
327 |
}
|
Line 320... |
Line 333... |
320 |
$corps .= $this->parse_template($mailDecode->parts[0], $numero_mail, $numero_mois, 0) ;
|
333 |
$corps .= $this->parse_template($mailDecode->parts[0], $numero_mail, $numero_mois, 0) ;
|
321 |
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl).'</div>';
|
334 |
$this->message_rendu .= preg_replace('/<ezmlm-body>/i', $this->cleanup_body($corps,true), $this->msgtmpl).'</div>';
|
Line 322... |
Line 335... |
322 |
|
335 |
|
323 |
} else if ($mailDecode->ctype_primary == 'application' || $mailDecode->ctype_primary == 'image'){
|
336 |
} else if ($mailDecode->ctype_primary == 'application' || $mailDecode->ctype_primary == 'image'){
|
324 |
if ($mailDecode->ctype_secondary == 'applefile') return ;
|
337 |
if ($mailDecode->ctype_secondary == 'applefile') return ;
|
Line 325... |
Line 338... |
325 |
$mimeType = new type_fichier_mime($GLOBALS['projet_db'], $mailDecode->ctype_primary.'/'.$mailDecode->ctype_secondary,PROJET_CHEMIN_ICONES) ;
|
338 |
$mimeType = new type_fichier_mime( $mailDecode->ctype_primary.'/'.$mailDecode->ctype_secondary,PROJET_CHEMIN_ICONES) ;
|
326 |
|
339 |
|
327 |
if ($mimeType->getIdType() != 12) {
|
340 |
if ($mimeType->getIdType() != 12) {
|
328 |
$corps .= '<a href="'.PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.'&actionargs[]='.
|
341 |
$corps .= '<a href="'.PROJET_CHEMIN_APPLI.'fichier_attache.php?nom_liste='.$this->listname.'&actionargs[]='.
|