modFckeditor.class.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \defgroup fckeditor Module fckeditor
  21. * \brief Module pour mettre en page les zones de saisie de texte
  22. * \file htdocs/core/modules/modFckeditor.class.php
  23. * \ingroup fckeditor
  24. * \brief Description and activation file for the module Fckeditor
  25. */
  26. include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
  27. /**
  28. * Class to describe and enable module Fckeditor
  29. */
  30. class modFckeditor extends DolibarrModules
  31. {
  32. /**
  33. * Constructor. Define names, constants, directories, boxes, permissions
  34. *
  35. * @param DoliDB $db Database handler
  36. */
  37. public function __construct($db)
  38. {
  39. $this->db = $db;
  40. $this->numero = 2000;
  41. $this->family = "technic";
  42. $this->module_position = '20';
  43. // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
  44. $this->name = preg_replace('/^mod/i', '', get_class($this));
  45. $this->description = "Editeur WYSIWYG";
  46. // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
  47. $this->version = 'dolibarr';
  48. $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
  49. // Name of png file (without png) used for this module.
  50. // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
  51. $this->picto = 'paragraph';
  52. // Data directories to create when module is enabled
  53. $this->dirs = array("/medias/temp", "/medias/image");
  54. // Config pages
  55. $this->config_page_url = array("fckeditor.php");
  56. // Dependencies
  57. $this->disabled = in_array(constant('JS_CKEDITOR'), array('disabled', 'disabled/'));
  58. $this->depends = array();
  59. $this->requiredby = array('modWebsites');
  60. // Constants
  61. $this->const = array();
  62. $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for the fields descriptions of elements (except products/services)");
  63. $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for the fields description of products/services");
  64. $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings");
  65. $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities");
  66. $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature");
  67. $this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities");
  68. $this->const[6] = array("FCKEDITOR_SKIN", "string", "moono-lisa", "Skin by default for fckeditor");
  69. // Boxes
  70. $this->boxes = array();
  71. // Permissions
  72. $this->rights = array();
  73. $this->rights_class = 'fckeditor';
  74. }
  75. }