Subversion Repositories Applications.papyrus

Rev

Rev 448 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 448 Rev 612
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: cartographie.admin.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
22
// CVS : $Id: cartographie.admin.php,v 1.2 2005-11-24 16:17:52 florian Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Florian Schmitt <florian@ecole-et-nature.org>
27
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
//Autres auteurs :
28
//Autres auteurs :
29
*@copyright     Tela-Botanica 2000-2004
29
*@copyright     Tela-Botanica 2000-2004
30
*@version       $Revision: 1.1 $ $Date: 2005-09-22 14:02:49 $
30
*@version       $Revision: 1.2 $ $Date: 2005-11-24 16:17:52 $
31
// +------------------------------------------------------------------------------------------------------+
31
// +------------------------------------------------------------------------------------------------------+
32
*/
32
*/
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
// |                                            ENT?E du PROGRAMME                                       |
34
// |                                            ENT?E du PROGRAMME                                       |
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
Line 50... Line 50...
50
    *   @return  string  Le HTML
50
    *   @return  string  Le HTML
51
    */
51
    */
52
    function afficherContenuCorps()
52
    function afficherContenuCorps()
53
    {
53
    {
54
        /** Inclusion du fichier de configuration de cette application.*/
54
        /** Inclusion du fichier de configuration de cette application.*/
55
        require_once 'configuration/ins_annuaire.config.inc.php';
55
    require_once PAP_CHEMIN_RACINE.'client/bottin/configuration/bottin.config.inc.php';
56
	require_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php';
56
	require_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php';
57
	require_once 'HTML/QuickForm.php' ;
57
	require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm.php' ;
Line 58... Line 58...
58
        
58
        
59
        //-------------------------------------------------------------------------------------------------------------------
59
        //-------------------------------------------------------------------------------------------------------------------
60
        // Initialisation des attributs
60
        // Initialisation des attributs
61
        $this->objet_pear_auth = $GLOBALS['_GEN_commun']['pear_auth'];
61
        $this->objet_pear_auth = $GLOBALS['_GEN_commun']['pear_auth'];
Line 64... Line 64...
64
        $this->sortie_xhtml = '';
64
        $this->sortie_xhtml = '';
Line 65... Line 65...
65
        
65
        
66
        //-------------------------------------------------------------------------------------------------------------------
66
        //-------------------------------------------------------------------------------------------------------------------
67
	// Création du formulaire
67
	// Création du formulaire
68
        $this->objet_pear_url->addQueryString('adme_site_id', 2);
68
        $this->objet_pear_url->addQueryString('adme_site_id', 2);
69
	$this->objet_pear_url->addQueryString('adme_menu_id', 14);
69
        $this->objet_pear_url->addQueryString('adme_menu_id', 14);
70
	$this->objet_pear_url->addQueryString('adme_action', 'administrer');
70
        $this->objet_pear_url->addQueryString('adme_action', 'administrer');
71
	$form =& new HTML_QuickForm('form_param_carto', 'post', str_replace('&amp;', '&', $this->objet_pear_url->getUrl()));
71
        $form =& new HTML_QuickForm('form_param_carto', 'post', str_replace('&amp;', '&', $this->objet_pear_url->getUrl()));
72
        $squelette =& $form->defaultRenderer();
72
        $squelette =& $form->defaultRenderer();
73
        $squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'<ul>'."\n".'{content}'."\n".'</ul>'."\n".'</form>'."\n");
73
        $squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'<ul>'."\n".'{content}'."\n".'</ul>'."\n".'</form>'."\n");
74
        $squelette->setElementTemplate(  '<li>'."\n".
74
        $squelette->setElementTemplate(  '<li>'."\n".
75
                                        '{label}'."\n".
75
                                        '{label}'."\n".
76
                                        '{element}'."\n".
76
                                        '{element}'."\n".
77
                                        '<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
77
                                        '<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".
78
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
78
                                        '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
79
                                        '</li>'."\n");
79
                                        '</li>'."\n");
80
	$requete = $requete = 'SHOW TABLES FROM '.INS_BASE;
80
        $requete = 'SHOW TABLES FROM '.$this->objet_pear_db->dsn['database'];
81
	$resultat = $this->objet_pear_db->query($requete) ;
81
        $resultat = $this->objet_pear_db->query($requete) ;
82
	if (DB::isError($resultat)) {
82
        if (DB::isError($resultat)) {
83
		die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
83
        	die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
84
	}
84
        }
85
	$option_tables = array();
85
        $option_tables = array();
86
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
86
        while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
87
		$option_tables[$ligne['Tables_in_'.INS_BASE]] =  $ligne['Tables_in_'.INS_BASE];
87
        	$option_tables[$ligne['Tables_in_'.$this->objet_pear_db->dsn['database']]] =  $ligne['Tables_in_'.$this->objet_pear_db->dsn['database']];
88
	}
88
        }
89
	$javascript= array('onchange' => 'javascript:this.form.submit();');
89
        $javascript= array('onchange' => 'javascript:this.form.submit();');
Line 90... Line 90...
90
	$form->addElement('select', 'nom_table1', INS_TABLE, $option_tables, $javascript);
90
        $form->addElement('select', 'nom_table1', INS_TABLE, $option_tables, $javascript);
91
	
91
	
92
	$requete = $requete = 'SELECT * FROM carto_config WHERE cc_menu_id='.$_GET['adme_menu_id'];
92
	$requete = $requete = 'SELECT * FROM carto_config WHERE cc_menu_id='.$_GET['adme_menu_id'];
93
	$resultat = $this->objet_pear_db->query($requete) ;
93
	$resultat = $this->objet_pear_db->query($requete) ;