Line 17... |
Line 17... |
17 |
// | |
|
17 |
// | |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser 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: inscription.fonct.formulaire.php,v 1.1 2007-06-06 10:12:40 alexandre_tb Exp $
|
22 |
// CVS : $Id: inscription.fonct.formulaire.php,v 1.2 2007-06-25 09:59:03 alexandre_tb Exp $
|
23 |
/**
|
23 |
/**
|
24 |
* Formulaire
|
24 |
* Formulaire
|
25 |
*
|
25 |
*
|
26 |
* Les fonctions de mise en page des formulaire
|
26 |
* Les fonctions de mise en page des formulaire
|
27 |
*
|
27 |
*
|
28 |
*@package bottin
|
28 |
*@package bottin
|
29 |
//Auteur original :
|
29 |
//Auteur original :
|
30 |
*@author Florian SCHMITT <florian@ecole-et-nature.org>
|
30 |
*@author Florian SCHMITT <florian@ecole-et-nature.org>
|
31 |
*@author Aleandre GRANIER <alexandre@tela-botanica.org>
|
31 |
*@author Aleandre GRANIER <alexandre@tela-botanica.org>
|
32 |
*@copyright Tela-Botanica 2000-2007
|
32 |
*@copyright Tela-Botanica 2000-2007
|
33 |
*@version $Revision: 1.1 $ $Date: 2007-06-06 10:12:40 $
|
33 |
*@version $Revision: 1.2 $ $Date: 2007-06-25 09:59:03 $
|
34 |
// +------------------------------------------------------------------------------------------------------+
|
34 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
*/
|
35 |
*/
|
Line 36... |
Line 36... |
36 |
|
36 |
|
Line 448... |
Line 448... |
448 |
|
448 |
|
449 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.google.php';
|
449 |
include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.google.php';
|
450 |
GEN_stockerCodeScript($script);
|
450 |
GEN_stockerCodeScript($script);
|
Line -... |
Line 451... |
- |
|
451 |
}
|
- |
|
452 |
|
- |
|
453 |
|
- |
|
454 |
/** valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
|
- |
|
455 |
*
|
- |
|
456 |
* @param string valeur du template de bazar_nature
|
- |
|
457 |
*
|
- |
|
458 |
* @return mixed tableau contenant les champs du fichier template
|
- |
|
459 |
*/
|
- |
|
460 |
function ins_valeurs_template($valeur_template) {
|
- |
|
461 |
//Parcours du fichier de templates, pour mettre les champs specifiques
|
- |
|
462 |
$tableau= array();
|
- |
|
463 |
$nblignes=0;
|
- |
|
464 |
$chaine = explode ("\n", $valeur_template);
|
- |
|
465 |
array_pop($chaine);
|
- |
|
466 |
foreach ($chaine as $ligne) {
|
- |
|
467 |
$souschaine = explode ("***", $ligne) ;
|
- |
|
468 |
$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
|
- |
|
469 |
if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
|
- |
|
470 |
else {$tableau[$nblignes]['nom_bdd'] ='';}
|
- |
|
471 |
if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
|
- |
|
472 |
else {$tableau[$nblignes]['label'] ='';}
|
- |
|
473 |
if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
|
- |
|
474 |
else {$tableau[$nblignes]['limite1'] ='';}
|
- |
|
475 |
if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
|
- |
|
476 |
else {$tableau[$nblignes]['limite2'] ='';}
|
- |
|
477 |
if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
|
- |
|
478 |
else {$tableau[$nblignes]['defaut'] ='';}
|
- |
|
479 |
if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
|
- |
|
480 |
else {$tableau[$nblignes]['table_source'] ='';}
|
- |
|
481 |
if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
|
- |
|
482 |
else {$tableau[$nblignes]['id_source'] ='';}
|
- |
|
483 |
if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
|
- |
|
484 |
else {$tableau[$nblignes]['obligatoire'] ='';}
|
- |
|
485 |
if (isset($souschaine[9])) $tableau[$nblignes]['recherche'] = trim($souschaine[9]);
|
- |
|
486 |
else {$tableau[$nblignes]['recherche'] ='';}
|
- |
|
487 |
|
- |
|
488 |
|
- |
|
489 |
// traitement des cases a cocher, dans ce cas la, on a une table de jointure entre la table
|
- |
|
490 |
// de liste et la table bazar_fiche (elle porte un nom du genre bazar_ont_***)
|
- |
|
491 |
// dans le template, a la place d'un nom de champs dans 'nom_bdd', on a un nom de table
|
- |
|
492 |
// et 2 noms de champs separes par un virgule ex : bazar_ont_theme,bot_id_theme,bot_id_fiche
|
- |
|
493 |
|
- |
|
494 |
if (isset($tableau[$nblignes]['nom_bdd']) && preg_match('/,/', $tableau[$nblignes]['nom_bdd'])) {
|
- |
|
495 |
$tableau_info_jointe = explode (',', $tableau[$nblignes]['nom_bdd']) ;
|
- |
|
496 |
$tableau[$nblignes]['table_jointe'] = $tableau_info_jointe[0] ;
|
- |
|
497 |
$tableau[$nblignes]['champs_id_fiche'] = $tableau_info_jointe[1] ;
|
- |
|
498 |
$tableau[$nblignes]['champs_id_table_jointe'] = $tableau_info_jointe[2] ;
|
- |
|
499 |
}
|
- |
|
500 |
$nblignes++;
|
- |
|
501 |
}
|
451 |
}
|
502 |
return $tableau;
|
452 |
|
503 |
}
|
453 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
504 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
505 |
*
|
- |
|
506 |
* $Log: not supported by cvs2svn $
|
- |
|
507 |
* Revision 1.1 2007-06-06 10:12:40 alexandre_tb
|
454 |
*
|
508 |
* en cours: objectif mettre en place un système de template comme bazar
|
455 |
* $Log: not supported by cvs2svn $
|
509 |
*
|
456 |
*
|
510 |
*
|
457 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
511 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|