Subversion Repositories Applications.papyrus

Rev

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

Rev 25 Rev 280
Line 18... Line 18...
18
// |                                                                                                      |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | You should have received a copy of the GNU Lesser General Public                                     |
20
// | License along with this library; if not, write to the Free Software                                  |
20
// | License along with this library; if not, write to the Free Software                                  |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// +------------------------------------------------------------------------------------------------------+
22
// +------------------------------------------------------------------------------------------------------+
23
// CVS : $Id: adsi_affichage.fonct.php,v 1.2 2004-07-06 17:08:01 jpm Exp $
23
// CVS : $Id: adsi_affichage.fonct.php,v 1.3 2005-02-28 10:40:49 jpm Exp $
24
/**
24
/**
25
* Bibliothèque de fonctions de construction du xhtml de l'application Administrateur de Sites.
25
* Bibliothèque de fonctions de construction du xhtml de l'application Administrateur de Sites.
26
*
26
*
27
* Contient un ensemble de fonctions permettant à l'application Administrateur de Sites de généré son xhtml.
27
* Contient un ensemble de fonctions permettant à l'application Administrateur de Sites de généré son xhtml.
28
*
28
*
Line 32... Line 32...
32
*@author        Laurent COUDOUNEAU <lc@gsite.org>
32
*@author        Laurent COUDOUNEAU <lc@gsite.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
34
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@copyright     Tela-Botanica 2000-2004
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Date: 2004-07-06 17:08:01 $
37
*@version       $Date: 2005-02-28 10:40:49 $
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
**/
39
**/
Line 40... Line 40...
40
 
40
 
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
Line 65... Line 65...
65
    $sortie .= $texte."\n";
65
    $sortie .= $texte."\n";
Line 66... Line 66...
66
    
66
    
67
    return $sortie;
67
    return $sortie;
Line 68... Line -...
68
}
-
 
69
 
-
 
70
/** Fonction ADMIN_donnerFormInputElements()- Génére le xhtml pour la création de balise input.
-
 
71
*
-
 
72
* Cette fonction génère une liste de balise input pour un formulaire.
-
 
73
* Elle contient 1 tableau associatif en paramètre.
-
 
74
*
-
 
75
* Tableau des boutons : c'est une tableau de description de bouton, chaque description est elle-même 
-
 
76
* dans un tableau contenant les clés suivantes :
-
 
77
* - type  : correspond au texte présent dans l'attribut "type" du bouton.
-
 
78
* - id : le texte présent dans l'attribut "id" du bouton.
-
 
79
* - name : le texte présent dans l'attribut "name" du bouton.
-
 
80
* - size : le texte présent dans l'attribut "id" du bouton. 
-
 
81
* - value  : correspond au texte présent dans l'attribut "value" du bouton.
-
 
82
*
-
 
83
* @param  array    tableau contenant les descriptions des boutons.
-
 
84
* return  string   le code XHTML des boutons.
-
 
85
*/
-
 
86
function ADMIN_donnerFormInputElements($aso_elements)
-
 
87
{
-
 
88
    // Construction du xhtml des boutons
-
 
89
    $retour = '';
-
 
90
    
-
 
91
    for ($i = 0; $i < sizeof($aso_elements); $i++) {
-
 
92
        // Récupération du tableau associatif d'un bouton.
-
 
93
        $bt_info = $aso_elements[$i];
-
 
94
        
-
 
95
        // Contenu commun à tous les éléments
-
 
96
        $bt_id_generique = 'element_'.($i+1);
-
 
97
        $bt_id = (empty($bt_info['id'])) ? $bt_id_generique : $bt_info['id'] ;
-
 
98
        $bt_name_generique = $bt_id;
-
 
99
        $bt_name = (empty($bt_info['name'])) ? $bt_name_generique : $bt_info['name'] ;
-
 
100
        $bt_tabindex_generique = ($i+10);
-
 
101
        $bt_tabindex = (empty($bt_info['tabindex'])) ? $bt_tabindex_generique : $bt_info['tabindex'] ;
-
 
102
        $bt_obligatoire = false;
-
 
103
        $bt_obligatoire = (!isset($bt_info['obligatoire'])) ? false : true ;
-
 
104
        
-
 
105
        // Contenu spécifique au type d'élément
-
 
106
        $retour .= str_repeat(' ', 16).'<li>';
-
 
107
        $retour .= (empty($bt_info['label'])) ? '' : '<label for="'.$bt_info['id'].'">'.$bt_info['label'].'</label>';
-
 
108
        if ($bt_info['element'] == 'input') {
-
 
109
            $bt_type_generique = 'text';
-
 
110
            $bt_type = (empty($bt_info['type'])) ? $bt_type_generique : $bt_info['type'] ;
-
 
111
            $bt_size_generique = '';
-
 
112
            $bt_size = (empty($bt_info['size'])) ? $bt_size_generique : $bt_info['size'];
-
 
113
            $bt_value_generique = ($bt_type != 'submit') ? '' : 'OK';
-
 
114
            $bt_value = (empty($bt_info['value'])) ? $bt_value_generique : $bt_info['value'] ;
-
 
115
            
-
 
116
            // Rendu xhtml
-
 
117
            $retour .=  '<'.$bt_info['element'].' '.
-
 
118
                            'type="'.       $bt_type    .'" '.
-
 
119
                            'id="'.         $bt_id      .'" '.
-
 
120
                            'name="'.       $bt_name    .'" ';
-
 
121
            $retour .=  (!isset($bt_info['value'])) ? '' : 'value="'.$bt_value.'" ';
-
 
122
            $retour .=  (!isset($bt_info['size'])) ? '' : 'size="'.$bt_size.'" ';
-
 
123
            $retour .=  (!isset($bt_info['maxlength'])) ? '' : 'maxlength="'.$bt_info['maxlength'].'" ';
-
 
124
            $retour .=  (!isset($bt_info['checked'])) ? '' : 'checked="checked" ';
-
 
125
            $retour .=  (!isset($bt_info['disabled'])) ? '' : 'disabled="disabled" ';
-
 
126
            $retour .=  (!isset($bt_info['readonly'])) ? '' : 'readonly="readonly" ';
-
 
127
            $retour .=      'tabindex="'.   $bt_tabindex   .'" />';
-
 
128
        } else if ($bt_info['element'] == 'textarea') {
-
 
129
            $bt_rows_generique = '25';
-
 
130
            $bt_rows = (empty($bt_info['rows'])) ? $bt_rows_generique : $bt_info['rows'] ;
-
 
131
            $bt_cols_generique = '75';
-
 
132
            $bt_cols = (empty($bt_info['cols'])) ? $bt_cols_generique : $bt_info['cols'] ;
-
 
133
            // Rendu xhtml
-
 
134
            $retour .=  '<'.$bt_info['element'].' '.
-
 
135
                            'id="'.         $bt_id      .'" '.
-
 
136
                            'name="'.       $bt_name    .'" '.
-
 
137
                            'rows="'.       $bt_rows    .'" '.
-
 
138
                            'cols="'.       $bt_cols    .'" ';
-
 
139
            $retour .=  (empty($bt_info['disabled'])) ? '' : 'disabled="disabled" ';
-
 
140
            $retour .=      'tabindex="'.   $bt_tabindex   .'">';
-
 
141
            $retour .=  $bt_value;
-
 
142
            $retour .=  '</'.$bt_info['element'].'>';
-
 
143
        }
-
 
144
        $retour .=  (!$bt_obligatoire) ? '' : '<span id="symoble_obligatoire">*</span>';
-
 
145
        $retour .=  '</li>'."\n";
-
 
146
    }
-
 
147
    
-
 
148
    return $retour;
-
 
149
}
68
}
150
 
69
 
151
// +- Fin du code source  --------------------------------------------------------------------------------+
70
// +- Fin du code source  --------------------------------------------------------------------------------+
-
 
71
/*
-
 
72
* $Log: not supported by cvs2svn $
-
 
73
* Revision 1.2  2004/07/06 17:08:01  jpm
152
/*
74
* Modification de la documentation pour une mailleur analyse par PhpDocumentor.
153
* $Log: not supported by cvs2svn $
75
*
154
* Revision 1.1  2004/06/16 14:23:01  jpm
76
* Revision 1.1  2004/06/16 14:23:01  jpm
155
* Changement de nom de Génésia en Papyrus.
77
* Changement de nom de Génésia en Papyrus.
156
* Changement de l'arborescence.
78
* Changement de l'arborescence.