Subversion Repositories Applications.projet

Rev

Rev 131 | Rev 249 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 131 Rev 208
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: HTML_listeDocuments.class.php,v 1.7 2006-07-05 10:30:05 alexandre_tb Exp $
22
// CVS : $Id: HTML_listeDocuments.class.php,v 1.8 2007-04-19 15:34:35 neiluj Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* La classe HTML_listeDocuments
26
* La classe HTML_listeDocuments
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.7 $
34
*@version       $Revision: 1.8 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
 
42
 
43
 
43
 
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
45
// |                                           LISTE des constantes                                       |
45
// |                                           LISTE des constantes                                       |
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
 
47
 
48
define ("FICHIER_ICONE_COUPER", "cut.gif") ;
48
define ("FICHIER_ICONE_COUPER", "cut.gif") ;
49
define ("FICHIER_ICONE_COLLER", "paste.gif") ;
49
define ("FICHIER_ICONE_COLLER", "paste.gif") ;
50
define ("FICHIER_ICONE_SUPPRIMER", "trash.gif") ;
50
define ("FICHIER_ICONE_SUPPRIMER", "trash.gif") ;
51
define ("FICHIER_ICONE_MODIFIER", "modif.png") ;
51
define ("FICHIER_ICONE_MODIFIER", "modif.png") ;
-
 
52
 
-
 
53
 
52
 
54
include_once PROJET_CHEMIN_CLASSES.'HTML_Liste.class.php';
53
/**
55
/**
54
 * class HTML_listeDocuments
56
 * class HTML_listeDocuments
55
 * 
57
 * 
56
 */
58
 */
57
class HTML_listeDocuments extends HTML_Liste
59
class HTML_listeDocuments extends HTML_Liste
58
{
60
{
59
    /*** Attributes: ***/
61
    /*** Attributes: ***/
60
 
62
 
61
    /**
63
    /**
62
     * Une url.
64
     * Une url.
63
     * @access private
65
     * @access private
64
     */
66
     */
65
    var $_url;
67
    var $_url;
66
    
68
    
67
    /**
69
    /**
68
     * Tableau contenant les actions possibles. "couper" => 1, "modifier" => 2,
70
     * Tableau contenant les actions possibles. "couper" => 1, "modifier" => 2,
69
     * "supprimer" => 3 Elles seront passées en paramètre aux url des icones des
71
     * "supprimer" => 3 Elles seront passées en paramètre aux url des icones des
70
     * documents.
72
     * documents.
71
     * @access private
73
     * @access private
72
     */
74
     */
73
    var $_actions = array ("couper" => 1, "modifier" => 2, "supprimer" => 3) ;
75
    var $_actions = array ("couper" => 1, "modifier" => 2, "supprimer" => 3) ;
74
 
76
 
75
    /**
77
    /**
76
     * Indique le chemin des icones couper, coller, modifier, supprimer. 
78
     * Indique le chemin des icones couper, coller, modifier, supprimer. 
77
     * @access private
79
     * @access private
78
     */
80
     */
79
    var $_chemin_icone = "icones/";
81
    var $_chemin_icone = "icones/";
80
    
82
    
81
    /**
83
    /**
82
     * L'identifiant du répertoire que l'on est en train d'observer.
84
     * L'identifiant du répertoire que l'on est en train d'observer.
83
     * @access private
85
     * @access private
84
     */
86
     */
85
    var $_id_repertoire;
87
    var $_id_repertoire;
86
 
88
 
87
    /**
89
    /**
88
     * Un tableau contenant les id et les noms du chemin des répertoires. 0 => ["id"],
90
     * Un tableau contenant les id et les noms du chemin des répertoires. 0 => ["id"],
89
     * ["nom"] etc.
91
     * ["nom"] etc.
90
     * @access private
92
     * @access private
91
     */
93
     */
92
    var $_chemin_navigation = array ();
94
    var $_chemin_navigation = array ();
93
 
95
 
94
    /**
96
    /**
95
     * un pointeur vers une authentificatin PEAR
97
     * un pointeur vers une authentificatin PEAR
96
     * @access private
98
     * @access private
97
     */
99
     */
98
    var $_auth ;
100
    var $_auth ;
99
    /**
101
    /**
100
     * 
102
     * 
101
     *
103
     *
102
     * @param bool utilise_pager Indique l'utilisation ou non du Pager.
104
     * @param bool utilise_pager Indique l'utilisation ou non du Pager.
103
     * @return void
105
     * @return void
104
     * @access public
106
     * @access public
105
     */
107
     */
106
    function HTML_listeDocuments(&$url,  $utilise_pager = false, $id_repertoire = 0, $auth = '' )
108
    function HTML_listeDocuments(&$url,  $utilise_pager = false, $id_repertoire = 0, $auth = '' )
107
    {
109
    {
108
        HTML_Liste::HTML_Liste($utilise_pager, array('class' => 'table_cadre')) ;
110
        HTML_Liste::HTML_Liste($utilise_pager, array('class' => 'table_cadre')) ;
109
        $this->_url = $url ;
111
        $this->_url = $url ;
110
        
112
        
111
        $this->_id_repertoire = $id_repertoire ;
113
        $this->_id_repertoire = $id_repertoire ;
112
        if (is_object($auth)) {
114
        if (is_object($auth)) {
113
            $this->_auth = $auth ;
115
            $this->_auth = $auth ;
114
        }
116
        }
115
    } // end of member function HTML_listeDocuments
117
    } // end of member function HTML_listeDocuments
116
 
118
 
117
    /**
119
    /**
118
     * 
120
     * 
119
     *
121
     *
120
     * @param bool utilise_pager Voir HTML_listeDocuments
122
     * @param bool utilise_pager Voir HTML_listeDocuments
121
     * @return void
123
     * @return void
122
     * @access public
124
     * @access public
123
     */
125
     */
124
    function __construct( &$url,  $utilise_pager = false, $id_repertoire = 0, $auth = '' )
126
    function __construct( &$url,  $utilise_pager = false, $id_repertoire = 0, $auth = '' )
125
    {
127
    {
126
        $this->HTML_listeDocuments($url,  $utilise_pager, $id_repertoire, $auth);
128
        $this->HTML_listeDocuments($url,  $utilise_pager, $id_repertoire, $auth);
127
        
129
        
128
    } // end of member function __construct
130
    } // end of member function __construct
129
 
131
 
130
    /**
132
    /**
131
     * 
133
     * 
132
     *
134
     *
133
     * @param Array tableau_label Un tableau contenant les labels à afficher dans l'entête.
135
     * @param Array tableau_label Un tableau contenant les labels à afficher dans l'entête.
134
     * @return void
136
     * @return void
135
     * @access public
137
     * @access public
136
     */
138
     */
137
    function construitEntete( $tableau_label )
139
    function construitEntete( $tableau_label )
138
    {
140
    {
139
        $this->addRow ($tableau_label, NULL, 'TH') ;
141
        $this->addRow ($tableau_label, NULL, 'TH') ;
140
    } // end of member function construitEntete
142
    } // end of member function construitEntete
141
 
143
 
142
    /**
144
    /**
143
     * 
145
     * 
144
     *
146
     *
145
     * @param Array tableau_label Un tableau à deux dimensions avec les labels à afficher dans le corps du
147
     * @param Array tableau_label Un tableau à deux dimensions avec les labels à afficher dans le corps du
146
     * tableau.
148
     * tableau.
147
     * @return void
149
     * @return void
148
     * @access public
150
     * @access public
149
     */
151
     */
150
    function construitListe( &$tableau_document, $droits, $mode = '', $objetDB = '')
152
    function construitListe( &$tableau_document, $droits, $mode = '', $objetDB = '')
151
    {
153
    {
152
        $compteur = 0 ;$class[0] = 'ligne_impaire'; $class[1] = 'ligne_paire' ;
154
        $compteur = 0 ;$class[0] = 'ligne_impaire'; $class[1] = 'ligne_paire' ;
153
 
155
 
154
        for ($i = 0; $i < count ($tableau_document) ; $i++) {
156
        for ($i = 0; $i < count ($tableau_document) ; $i++) {
155
            // Première condition : est-ce que le fichier a pour père le répertoire courant, si oui on l'affiche
157
            // première condition : est-ce que le fichier a pour père le répertoire courant, si oui on l'affiche
156
            if ($tableau_document[$i]->_id_pere == $this->_id_repertoire || $mode == 'ignore_repertoire') {
158
            if ($tableau_document[$i]->_id_pere == $this->_id_repertoire || $mode == 'ignore_repertoire') {
157
                // d'abord l'image
159
                // d'abord l'image
158
                $icone = '<img src="'.$tableau_document[$i]->getCheminIcone().'" />' ;
160
                $icone = '<img src="'.$tableau_document[$i]->getCheminIcone().'" />' ;
159
                // Si le document est un répertoire, on ajoute id_repertoire au lien.
161
                // Si le document est un répertoire, on ajoute id_repertoire au lien.
160
                if ($tableau_document[$i]->isRepertoire()) {
162
                if ($tableau_document[$i]->isRepertoire()) {
161
                    $this->_url->addQueryString ('id_repertoire', $tableau_document[$i]->getChemin()) ;
163
                    $this->_url->addQueryString ('id_repertoire', $tableau_document[$i]->getChemin()) ;
162
                    $lien = $this->_url->getURL() ;
164
                    $lien = $this->_url->getURL() ;
163
                } else {    //  Si c'est un fichier, on fait un lien direct
165
                } else {    //  Si c'est un fichier, on fait un lien direct
164
                    $lien = $tableau_document[$i]->getChemin() ;
166
                    $lien = $tableau_document[$i]->getChemin() ;
165
                }
167
                }
166
                // pour éviter des effets de bords, on enlève id_repertoire de l'url
168
                // pour éviter des effets de bords, on enlève id_repertoire de l'url
167
                // dans le cas d'un répertoire, pour les fichiers on le laisse pour
169
                // dans le cas d'un répertoire, pour les fichiers on le laisse pour
168
                // qu'après une opération, on reste dans le répertoire où a eu lieu l'opération
170
                // qu'après une opération, on reste dans le répertoire où a eu lieu l'opération
169
                if ($tableau_document[$i]->isRepertoire()) $this->_url->removeQueryString('id_repertoire') ;
171
                if ($tableau_document[$i]->isRepertoire()) $this->_url->removeQueryString('id_repertoire') ;
170
                
172
                
171
                // on insère le lien
173
                // on insère le lien
172
                $lien_nom = '<a href="'.$lien.'">'.$icone.' '.$tableau_document[$i]->getNomLong()."</a>\n" ;
174
                $lien_nom = '<a href="'.$lien.'">'.$icone.' '.$tableau_document[$i]->getNomLong()."</a>\n" ;
173
                
175
                
174
                // Pour la taille on divise par 1000 et on écrit Ko
176
                // Pour la taille on divise par 1000 et on écrit Ko
175
                $taille = round($tableau_document[$i]->getTaille() / 1000).'&nbsp;Ko' ;
177
                $taille = round($tableau_document[$i]->getTaille() / 1000).'&nbsp;Ko' ;
176
                
178
                
177
                // Récupération de l'auteur
179
                // Récupération de l'auteur
178
                include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
180
                include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
179
                $annuaire = new annuaire($objetDB, array('table' => PROJET_ANNUAIRE, 'identifiant' => PROJET_CHAMPS_ID, 
181
                $annuaire = new annuaire($objetDB, array('table' => PROJET_ANNUAIRE, 'identifiant' => PROJET_CHAMPS_ID, 
180
                                            'nom' => PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
182
                                            'nom' => PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
181
                $annuaire->setId($tableau_document[$i]->_id_proprietaire) ;
183
                $annuaire->setId($tableau_document[$i]->_id_proprietaire) ;
182
                $nom_prenom = $annuaire->getInfo('nom').' '.$annuaire->getInfo('prenom') ;
184
                $nom_prenom = $annuaire->getInfo('nom').' '.$annuaire->getInfo('prenom') ;
183
                // On rempli le tableau à donner en paramètre à HTML_Table avec toutes ces infos, une par colonne
185
                // On rempli le tableau à donner en paramètre à HTML_Table avec toutes ces infos, une par colonne
184
                $ligne_tableau = array($lien_nom, $taille, $nom_prenom, $tableau_document[$i]->getDateMiseAJour()) ;
186
                $ligne_tableau = array($lien_nom, $taille, $nom_prenom, $tableau_document[$i]->getDateMiseAJour()) ;
185
                if ($droits <= PROJET_DROIT_CONTRIBUTEUR) array_push ($ligne_tableau, $tableau_document[$i]->getVisibilite()) ;
187
                if ($droits <= PROJET_DROIT_CONTRIBUTEUR) array_push ($ligne_tableau, $tableau_document[$i]->getVisibilite()) ;
186
                
188
                
187
                // On ajoute au tableau, les action couper / modifier / supprimer
189
                // On ajoute au tableau, les action couper / modifier / supprimer
188
                if ($droits <= PROJET_DROIT_COORDINATEUR || $this->_auth->getAuthData(PROJET_CHAMPS_ID) == $tableau_document[$i]->_id_proprietaire) 
190
                if ($droits <= PROJET_DROIT_COORDINATEUR || $this->_auth->getAuthData(PROJET_CHAMPS_ID) == $tableau_document[$i]->_id_proprietaire) 
189
                                                array_push ($ligne_tableau, $this->_actions ($tableau_document[$i])) ;
191
                                                array_push ($ligne_tableau, $this->_actions ($tableau_document[$i])) ;
190
                if ($tableau_document[$i]->getVisibilite() != 'prive' || $droits < PROJET_DROIT_AUCUN) {
192
                if ($tableau_document[$i]->getVisibilite() != 'prive' || $droits < PROJET_DROIT_AUCUN) {
191
	                $this->addRow ($ligne_tableau, array('class' => $class[$compteur]), 'TD', true) ;
193
	                $this->addRow ($ligne_tableau, array('class' => $class[$compteur]), 'TD', true) ;
192
	                // enfin , s'il y a une description, on l'ajoute, mais sur une ligne entière (colspan)
194
	                // enfin , s'il y a une description, on l'ajoute, mais sur une ligne entière (colspan)
193
	                if ($tableau_document[$i]->getDescription() != "") {
195
	                if ($tableau_document[$i]->getDescription() != "") {
194
	                    $this->addRow (array ($tableau_document[$i]->getDescription()), 
196
	                    $this->addRow (array ($tableau_document[$i]->getDescription()), 
195
	                    		array ('colspan' => $this->getColCount(), 'class' => $class[$compteur])) ;
197
	                    		array ('colspan' => $this->getColCount(), 'class' => $class[$compteur])) ;
196
	                    $this->updateRowAttributes ($this->getRowCount()-1, array ('class' => $class[$compteur]), true) ;
198
	                    $this->updateRowAttributes ($this->getRowCount()-1, array ('class' => $class[$compteur]), true) ;
197
	                }
199
	                }
198
                }
200
                }
199
                $compteur++;
201
                $compteur++;
200
            }
202
            }
201
            
203
            
202
            if ($compteur == 2) $compteur = 0 ;
204
            if ($compteur == 2) $compteur = 0 ;
203
        }
205
        }
204
        $this->updateColAttributes(0, array ('class' => 'col1')) ;
206
        $this->updateColAttributes(0, array ('class' => 'col1')) ;
205
    } // end of member function construitListe
207
    } // end of member function construitListe
206
 
208
 
207
    /**
209
    /**
208
     * 
210
     * 
209
     *
211
     *
210
     * @param Array actions Un tableau avec les valeurs d'actions comme clé. "couper", modifier",
212
     * @param Array actions Un tableau avec les valeurs d'actions comme clé. "couper", modifier",
211
     * "supprimer".
213
     * "supprimer".
212
     * @return void
214
     * @return void
213
     * @access public
215
     * @access public
214
     */
216
     */
215
    function setAction( $actions )
217
    function setAction( $actions )
216
    {
218
    {
217
        $this->_actions = $actions ;
219
        $this->_actions = $actions ;
218
    } // end of member function setAction
220
    } // end of member function setAction
219
    
221
    
220
    /**
222
    /**
221
     * 
223
     * 
222
     *
224
     *
223
     * @param string chemin Le chemin vers les icones couper, coller ...
225
     * @param string chemin Le chemin vers les icones couper, coller ...
224
     * @return void
226
     * @return void
225
     * @access public
227
     * @access public
226
     */
228
     */
227
    function setCheminIcones( $chemin )
229
    function setCheminIcones( $chemin )
228
    {
230
    {
229
        $this->_chemin_icone = $chemin ;
231
        $this->_chemin_icone = $chemin ;
230
    } // end of member function setCheminIcones
232
    } // end of member function setCheminIcones
231
 
233
 
232
    /**
234
    /**
233
     * Surcharge de l'opération de la classe mère. Ajoute la navigation dans les
235
     * Surcharge de l'opération de la classe mère. Ajoute la navigation dans les
234
     * répertoires.
236
     * répertoires.
235
     *
237
     *
236
     * @return string
238
     * @return string
237
     * @access public
239
     * @access public
238
     */
240
     */
239
    function toHTML( )
241
    function toHTML( )
240
    {
242
    {
241
        $chemin_navig = "" ;
243
        $chemin_navig = "" ;
242
        if ($this->_id_repertoire != "") {
244
        if ($this->_id_repertoire != "") {
243
            $this->_url->removeQueryString(PROJET_VARIABLE_ID_REPERTOIRE) ;
245
            $this->_url->removeQueryString(PROJET_VARIABLE_ID_REPERTOIRE) ;
244
            $chemin_navig = "<p>" ;
246
            $chemin_navig = "<p>" ;
245
            $chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".PROJET_RACINE."</a>\n" ;
247
            $chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".PROJET_RACINE."</a>\n" ;
246
            $this->_url->addQueryString(PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
248
            $this->_url->addQueryString(PROJET_VARIABLE_ID_REPERTOIRE, $this->_id_repertoire) ;
247
            for ($i = 0; $i < count ($this->_chemin_navigation); $i+=2) {
249
            for ($i = 0; $i < count ($this->_chemin_navigation); $i+=2) {
248
                $chemin_navig .= "&gt;&nbsp;" ;
250
                $chemin_navig .= "&gt;&nbsp;" ;
249
                $nom = $this->_chemin_navigation[$i+1] ;
251
                $nom = $this->_chemin_navigation[$i+1] ;
250
                $this->_url->addQueryString ('id_repertoire', $this->_chemin_navigation[$i]) ;
252
                $this->_url->addQueryString ('id_repertoire', $this->_chemin_navigation[$i]) ;
251
                $chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".$nom."</a>\n" ; 
253
                $chemin_navig .= "<a href=\"".$this->_url->getURL()."\">".$nom."</a>\n" ; 
252
            }
254
            }
253
            $chemin_navig .= "</p>\n" ;
255
            $chemin_navig .= "</p>\n" ;
254
        }
256
        }
255
        $res = $chemin_navig.HTML_Liste::toHTML() ;
257
        $res = $chemin_navig.HTML_Liste::toHTML() ;
256
        if ($this->getRowCount() == 1 && $this->_id_repertoire == '') {
258
        if ($this->getRowCount() == 1 && $this->_id_repertoire == '') {
257
            return '<div>'.PROJET_PAS_DE_DOCUMENTS.'</div>'."\n";
259
            return '<div>'.PROJET_PAS_DE_DOCUMENTS.'</div>'."\n";
258
        }
260
        }
259
        return $res ;
261
        return $res ;
260
    } // end of member function toHTML
262
    } // end of member function toHTML
261
 
263
 
262
    /**
264
    /**
263
     * 
265
     * 
264
     *
266
     *
265
     * @param Array tableau_navigation Un tableau contenant les identifiants et les noms des répertoires.  0 => ["id"],
267
     * @param Array tableau_navigation Un tableau contenant les identifiants et les noms des répertoires.  0 => ["id"],
266
     * ["nom"] etc.
268
     * ["nom"] etc.
267
     * @return void
269
     * @return void
268
     * @access public
270
     * @access public
269
     */
271
     */
270
    function setCheminNavigation( $tableau_navigation )
272
    function setCheminNavigation( $tableau_navigation )
271
    {
273
    {
272
        $this->_chemin_navigation = $tableau_navigation ;
274
        $this->_chemin_navigation = $tableau_navigation ;
273
    } // end of member function setCheminNavigation
275
    } // end of member function setCheminNavigation
274
 
276
 
275
    /**
277
    /**
276
     * Affiche la légende des actions du module "documents"
278
     * Affiche la légende des actions du module "documents"
277
     *
279
     *
278
     * @return string
280
     * @return string
279
     * @access public
281
     * @access public
280
     */
282
     */
281
    function affLegende( )
283
    function affLegende( )
282
    {
284
    {
283
        $res = "<h2 class=\"titre2_projet\">".PROJET_LEGENDE."</h2>\n" ;
285
        $res = "<h2 class=\"titre2_projet\">".PROJET_LEGENDE."</h2>\n" ;
284
        $res .= "<p><img src=\"".$this->_chemin_icone."/cut.gif\" title=\"couper\" alt=\"couper\">".PROJET_LEGENDE_DEPLACE."</p>\n" ;
286
        $res .= "<p><img src=\"".$this->_chemin_icone."/cut.gif\" title=\"couper\" alt=\"couper\">".PROJET_LEGENDE_DEPLACE."</p>\n" ;
285
        $res .= "<p><img src=\"".$this->_chemin_icone."/modif.png\" title=\"modifier\" alt=\"modifier\"> ".PROJET_LEGENDE_MODIFIE."</p>\n" ;
287
        $res .= "<p><img src=\"".$this->_chemin_icone."/modif.png\" title=\"modifier\" alt=\"modifier\"> ".PROJET_LEGENDE_MODIFIE."</p>\n" ;
286
        $res .= "<p><img src=\"".$this->_chemin_icone."/trash.gif\" title=\"supprimer\" alt=\"supprimer\"> ".PROJET_LEGENDE_SUPPR."</p>\n" ;
288
        $res .= "<p><img src=\"".$this->_chemin_icone."/trash.gif\" title=\"supprimer\" alt=\"supprimer\"> ".PROJET_LEGENDE_SUPPR."</p>\n" ;
287
        return $res ;
289
        return $res ;
288
    } // end of member function affLegende
290
    } // end of member function affLegende
289
 
291
 
290
 
292
 
291
    /**
293
    /**
292
     * Renvoie le chemin HTML, depuis le répertoire courant jusqu'à la racine.
294
     * Renvoie le chemin HTML, depuis le répertoire courant jusqu'à la racine.
293
     *
295
     *
294
     * @return string
296
     * @return string
295
     * @access private
297
     * @access private
296
     */
298
     */
297
    function _getCheminHTML( )
299
    function _getCheminHTML( )
298
    {
300
    {
299
        $path = "" ;
301
        $path = "" ;
300
 
302
 
301
        return $path ;
303
        return $path ;
302
    } // end of member function _getCheminHTML
304
    } // end of member function _getCheminHTML
303
 
305
 
304
 
306
 
305
 
307
 
306
    /**
308
    /**
307
     * Renvoie une chaine contenant le code html des icones des actions possibles sur un
309
     * Renvoie une chaine contenant le code html des icones des actions possibles sur un
308
     * fichier, c'est à dire couper, modifier, supprimer.
310
     * fichier, c'est à dire couper, modifier, supprimer.
309
     *
311
     *
310
     * @return string
312
     * @return string
311
     * @access private
313
     * @access private
312
     */
314
     */
313
    function _actions($document)
315
    function _actions($document)
314
    {
316
    {
315
        $this->_url->addQueryString ('id_document', $document->getIdDocument()) ;
317
        $this->_url->addQueryString ('id_document', $document->getIdDocument()) ;
316
        
318
        
317
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["couper"]) ;
319
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["couper"]) ;
318
        $couper = ' '.PROJET_FICHIER_COUPER ;
320
        $couper = ' '.PROJET_FICHIER_COUPER ;
319
        if (!$document->isRepertoire()) $couper = '<a href="'.$this->_url->getURL().'">'.$couper.'</a>' ;
321
        if (!$document->isRepertoire()) $couper = '<a href="'.$this->_url->getURL().'">'.$couper.'</a>' ;
320
        
322
        
321
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["modifier"]) ;
323
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["modifier"]) ;
322
        $modifier = '<a href="'.$this->_url->getURL().'">'.PROJET_FICHIER_MODIFIER.'</a> ' ;
324
        $modifier = '<a href="'.$this->_url->getURL().'">'.PROJET_FICHIER_MODIFIER.'</a> ' ;
323
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["supprimer"]) ;
325
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, $this->_actions["supprimer"]) ;
324
        $supprimer= '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm (\''.PROJET_FICHIER_SUPPRIMER.' ?\');">'.PROJET_FICHIER_SUPPRIMER.'</a>' ;
326
        $supprimer= '<a href="'.$this->_url->getURL().'" onclick="javascript:return confirm (\''.PROJET_FICHIER_SUPPRIMER.' ?\');">'.PROJET_FICHIER_SUPPRIMER.'</a>' ;
325
        $this->_url->removeQueryString ('id_document') ;
327
        $this->_url->removeQueryString ('id_document') ;
326
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
328
        $this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
327
        return $modifier.$supprimer.$couper ;
329
        return $modifier.$supprimer.$couper ;
328
    } // end of member function _action
330
    } // end of member function _action
329
 
331
 
330
 
332
 
331
} // end of HTML_listeDocuments
333
} // end of HTML_listeDocuments
332
?>
334
?>