[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/includes/modules/ -> modEnergie.class.php (source)

   1  <?php
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: modEnergie.class.php,v 1.6 2005/10/22 13:45:24 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/modEnergie.class.php,v $
  20   *
  21   */
  22  
  23  /** 
  24      \defgroup   energie     Module energie
  25      \brief      Module pour le suivi de la consommation d'energie
  26  */
  27  
  28  /**
  29     \file       htdocs/includes/modules/modEnergie.class.php
  30     \ingroup    energie
  31     \brief      Fichier de description et activation du module Energie
  32  */
  33  
  34  include_once  "DolibarrModules.class.php";
  35  
  36  /**
  37     \class modEnergie
  38     \brief      Classe de description et activation du module Energie
  39  */
  40  
  41  class modEnergie extends DolibarrModules
  42  {
  43  
  44     /**
  45      *   \brief      Constructeur. Definit les noms, constantes et boites
  46      *   \param      DB      handler d'accès base
  47      */
  48    function modEnergie($DB)
  49    {
  50      $this->db = $DB ;
  51      $this->numero = 23 ;
  52      
  53      $this->family = "technic";
  54      $this->name = "Energie";
  55      $this->description = "Suivi de la consommation des energies";
  56  
  57      $this->revision = explode(' ','$Revision: 1.6 $');
  58      $this->version = $this->revision[1];
  59  
  60      $this->const_name = 'MAIN_MODULE_ENERGIE';
  61      $this->special = 1;
  62      $this->picto='energie';
  63  
  64      // Dir
  65      $this->dirs = array();
  66  
  67      // Dépendances
  68      $this->depends = array();
  69      $this->config_page_url = "";
  70  
  71      // Constantes
  72      $this->const = array();
  73  
  74      // Config pages
  75      $this->config_page_url = "energie.php";
  76  
  77      // Boxes
  78      $this->boxes = array();
  79  
  80      $this->boxes[0][0] = '<a href="energie">Energie</a>';
  81      $this->boxes[0][1] = "box_energie_releve.php";
  82  
  83      $this->boxes[1][0] = '<a href="energie">Energie Graph</a>';
  84      $this->boxes[1][1] = "box_energie_graph.php";
  85  
  86      // Permissions
  87      $this->rights = array();
  88  
  89    }
  90  
  91  
  92     /**
  93      *   \brief      Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
  94      *               Définit également les répertoires de données à créer pour ce module.
  95      */
  96    function init()
  97    {       
  98      global $conf;
  99      // Permissions et valeurs par défaut
 100      $this->remove();
 101  
 102      $sql = array();
 103  
 104      $this->dirs[0] = DOL_DATA_ROOT."/energie";
 105      $this->dirs[1] = DOL_DATA_ROOT."/energie/graph";
 106      
 107      return $this->_init($sql);
 108    }
 109  
 110    /**
 111     *    \brief      Fonction appelée lors de la désactivation d'un module.
 112     *                Supprime de la base les constantes, boites et permissions du module.
 113     */
 114    function remove()
 115    {
 116      $sql = array();
 117  
 118      return $this->_remove($sql);
 119    }
 120  }
 121  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics