modBookmark.class.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \defgroup bookmark Module bookmarks
  20. * \brief Module to manage Bookmarks
  21. * \file htdocs/core/modules/modBookmark.class.php
  22. * \ingroup bookmark
  23. * \brief Description and activation file for the module Bookmarks
  24. */
  25. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  26. /**
  27. * Class to describe and enable module Bookmark
  28. */
  29. class modBookmark extends DolibarrModules
  30. {
  31. /**
  32. * Constructor. Define names, constants, directories, boxes, permissions
  33. *
  34. * @param DoliDB $db Database handler
  35. */
  36. public function __construct($db)
  37. {
  38. $this->db = $db;
  39. $this->numero = 330;
  40. $this->family = "technic";
  41. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  42. $this->name = preg_replace('/^mod/i', '', get_class($this));
  43. $this->description = "Gestion des Bookmarks";
  44. // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
  45. $this->version = 'dolibarr';
  46. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  47. $this->picto = 'bookmark';
  48. // Data directories to create when module is enabled
  49. $this->dirs = array();
  50. // Dependancies
  51. $this->depends = array();
  52. $this->requiredby = array();
  53. $this->langfiles = array("bookmarks");
  54. // Config pages
  55. $this->config_page_url = array('bookmark.php@bookmarks');
  56. // Constants
  57. $this->const = array();
  58. // Boxes
  59. $this->boxes = array(
  60. 0=>array('file'=>'box_bookmarks.php', 'enabledbydefaulton'=>'Home')
  61. );
  62. // Permissions
  63. $this->rights = array();
  64. $this->rights_class = 'bookmark';
  65. $r = 0;
  66. $r++;
  67. $this->rights[$r][0] = 331; // id de la permission
  68. $this->rights[$r][1] = 'Lire les bookmarks'; // libelle de la permission
  69. $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
  70. $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
  71. $this->rights[$r][4] = 'lire';
  72. $r++;
  73. $this->rights[$r][0] = 332; // id de la permission
  74. $this->rights[$r][1] = 'Creer/modifier les bookmarks'; // libelle de la permission
  75. $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
  76. $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
  77. $this->rights[$r][4] = 'creer';
  78. $r++;
  79. $this->rights[$r][0] = 333; // id de la permission
  80. $this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission
  81. $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
  82. $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
  83. $this->rights[$r][4] = 'supprimer';
  84. // Menus
  85. //-------
  86. $this->menu = 1; // This module add menu entries. They are coded into menu manager.
  87. }
  88. }