modGeoIPMaxmind.class.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
  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 3 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, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \defgroup geoip Module geoipmaxmind
  19. * \brief Module to make geoip conversions
  20. * \file htdocs/core/modules/modGeoIPMaxmind.class.php
  21. * \ingroup geoip
  22. * \brief Description and activation file for the module geoipmaxmind
  23. */
  24. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  25. /**
  26. * Class to describe and enable module Import
  27. */
  28. class modGeoIPMaxmind extends DolibarrModules
  29. {
  30. /**
  31. * Constructor. Define names, constants, directories, boxes, permissions
  32. *
  33. * @param DoliDB $db Database handler
  34. */
  35. public function __construct($db)
  36. {
  37. $this->db = $db;
  38. $this->numero = 2900;
  39. // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
  40. // It is used to group modules in module setup page
  41. $this->family = "interface";
  42. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  43. $this->name = preg_replace('/^mod/i', '', get_class($this));
  44. // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
  45. $this->description = "GeoIP Maxmind conversions capabilities";
  46. // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
  47. $this->version = 'dolibarr';
  48. // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
  49. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  50. // Name of image file used for this module.
  51. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
  52. // If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
  53. $this->picto = 'geoip';
  54. // Data directories to create when module is enabled
  55. $this->dirs = array("/geoipmaxmind");
  56. // Config pages
  57. $this->config_page_url = array("geoipmaxmind.php");
  58. // Dependencies
  59. $this->hidden = false; // A condition to hide module
  60. $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
  61. $this->requiredby = array(); // List of module ids to disable if this one is disabled
  62. $this->conflictwith = array(); // List of module class names as string this module is in conflict with
  63. $this->phpmin = array(5, 6);
  64. $this->phpmax = array();
  65. $this->need_dolibarr_version = array(2, 7, -1); // Minimum version of Dolibarr required by module
  66. $this->need_javascript_ajax = 1;
  67. // Constants
  68. $this->const = array();
  69. // Boxes
  70. $this->boxes = array();
  71. // Permissions
  72. $this->rights = array();
  73. $this->rights_class = 'geoipmaxmind';
  74. $r = 0;
  75. }
  76. }