Subversion Repositories Sites.gentiana.org

Rev

Rev 85 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
43 jpm 1
<?
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 4.1                                                                                      |
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
7
// | This library is free software; you can redistribute it and/or                                        |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | License as published by the Free Software Foundation; either                                         |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// |                                                                                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | Lesser General Public License for more details.                                                      |
16
// |                                                                                                      |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | License along with this library; if not, write to the Free Software                                  |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// +------------------------------------------------------------------------------------------------------+
21
/**
22
* programme principal du module annuaire
23
*
24
* programme principal du module annuaire
25
*
26
*@package annuaire
27
//Auteur original :
85 jpm 28
*@author		Alexandre Granier <alexandre@tela-botanica.org>
43 jpm 29
//Autres auteurs :
85 jpm 30
*@author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
31
*@copyright	 Tela-Botanica 2000-2007
32
*@version	   $Id: annuaire.php,v 1.4 2005/03/24 08:24:39 alex Exp $
43 jpm 33
// +------------------------------------------------------------------------------------------------------+
34
*/
35
 
36
// +------------------------------------------------------------------------------------------------------+
85 jpm 37
// |											ENTETE du PROGRAMME									   |
43 jpm 38
// +------------------------------------------------------------------------------------------------------+
39
 
40
include_once 'client/annuaire/configuration/ann_config.inc.php' ;
41
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ;
42
/** Constante "dynamique" stockant la langue demandée par l'utilisateur pour l'application.*/
43
define('INS_LANGUE', substr($GLOBALS['_GEN_commun']['i18n'], 0, 2));
44
$fichier_lg = ANN_CHEMIN_APPLI.'/langues/ann_langue_'.INS_LANGUE.'.inc.php';
45
if (file_exists($fichier_lg)) {
85 jpm 46
	include_once $fichier_lg;
43 jpm 47
} else {
85 jpm 48
	include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
43 jpm 49
}
50
include_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
51
 
52
// Ajout d'une feuille de style externe
53
GEN_stockerStyleExterne ('inscription', 'client/annuaire/annuaire.css') ;
54
 
55
/**
56
 *  Renvoie le code HTML de l'application
57
 *
58
 * @return  string  HTML
59
 */
60
function afficherContenuCorps () {
85 jpm 61
	$res = '<h1 class="annuaire_titre1">'.ANN_TITRE.'</h1>'."\n";
62
	if (!$GLOBALS['AUTH']->getAuth())  {
63
		$res .= AUTH_formulaire_login();
64
	} else {
65
		// Le code javascript des cases à cocher
66
		$java =
67
			"function setCheckboxes(the_form)
68
			{
69
			var do_check=document.forms[the_form].elements['selecttotal'].checked;
70
			var elts			= document.forms[the_form].elements['select[]'];
71
			var elts_cnt = (typeof(elts.length) != 'undefined')
72
								? elts.length
73
								: 0;
74
			if (elts_cnt) {
75
				for (var i = 0; i < elts_cnt; i++) {
76
					elts[i].checked = do_check;
77
				} // Fin for
78
			} else {
79
				elts.checked = do_check;
80
			} // Fin if... else
81
			return true;
82
		} // Fin de la fonction 'setCheckboxes()'";
83
		GEN_stockerCodeScript($java) ;
43 jpm 84
 
85 jpm 85
		$res .= '<h2 class="annuaire_titre2">'.ANN_CLIQUEZ_LETTRE.'</h2>'."\n";
87 jpm 86
 
87
		// Nettoyage des variables du POST
88
		$cles = array('corps', 'titre_mail');
89
		foreach ($cles as $cle) {
90
			if (isset($_POST[$cle]) && !empty($_POST[$cle])) {
91
				$_POST[$cle] = translittererCp1252VersIso88591(stripslashes($_POST[$cle]));
92
			}
93
		}
43 jpm 94
 
87 jpm 95
		// S'il y a un mail a envoyé, on l'envoie
96
		if (isset($_POST['select']) && is_array($_POST['select'])) {
97
			if (isset($_POST['corps']) && isset($_POST['titre_mail'])) {
98
				$res .= envoie_mail($_POST['select'], $_POST['titre_mail'], $_POST['corps']) ;
99
			}
85 jpm 100
		}
43 jpm 101
 
87 jpm 102
		$res .= parcourrirAnnu() ;
85 jpm 103
	}
104
	return $res;
43 jpm 105
}
106
 
52 jpm 107
function afficherContenuPied () {
85 jpm 108
	$sortie  = 	'<p id="annuaire_pied_page">'.ANN_PIED_INFO.
52 jpm 109
					'<a href="mailto:'.ANN_PIED_MAIL.'">'.ANN_PIED_MAIL.'</a>.'.
110
				'</p>';
85 jpm 111
	return $sortie;
43 jpm 112
}
113
?>