dolibarr/htdocs/core/modules/modBookmark.class.php

108 lines
3.5 KiB
PHP
Raw Normal View History

2005-09-05 10:44:15 +02:00
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
2005-09-05 10:44:15 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2005-09-05 10:44:15 +02:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2005-09-05 10:44:15 +02:00
*/
/**
2009-07-30 00:52:08 +02:00
* \defgroup bookmark Module bookmarks
* \brief Module to manage Bookmarks
* \file htdocs/core/modules/modBookmark.class.php
* \ingroup bookmark
* \brief Fichier de description et activation du module Bookmarks
2008-10-01 21:10:17 +02:00
*/
2005-09-05 10:44:15 +02:00
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
2005-09-05 10:44:15 +02:00
2008-10-01 21:10:17 +02:00
/**
2015-09-07 15:55:26 +02:00
* Class to describe and enable module Bookmark
2008-10-01 21:10:17 +02:00
*/
2005-09-05 10:44:15 +02:00
class modBookmark extends DolibarrModules
{
2008-10-01 21:10:17 +02:00
/**
2011-09-26 16:22:35 +02:00
* Constructor. Define names, constants, directories, boxes, permissions
*
2012-01-04 21:23:50 +01:00
* @param DoliDB $db Database handler
2008-10-01 21:10:17 +02:00
*/
2019-02-25 20:35:59 +01:00
public function __construct($db)
2008-10-01 21:10:17 +02:00
{
2012-01-04 21:23:50 +01:00
$this->db = $db;
2008-10-01 21:10:17 +02:00
$this->numero = 330;
$this->family = "technic";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
2008-10-01 21:10:17 +02:00
$this->description = "Gestion des Bookmarks";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
2008-10-01 21:10:17 +02:00
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'bookmark';
2008-10-01 21:10:17 +02:00
// Data directories to create when module is enabled
2008-10-01 21:10:17 +02:00
$this->dirs = array();
2009-01-23 17:44:12 +01:00
// Dependancies
2008-10-01 21:10:17 +02:00
$this->depends = array();
$this->requiredby = array();
2011-01-23 14:56:38 +01:00
$this->langfiles = array("bookmarks");
2008-10-01 21:10:17 +02:00
// Config pages
2010-05-01 12:52:47 +02:00
$this->config_page_url = array('bookmark.php@bookmarks');
2008-10-01 21:10:17 +02:00
2015-09-07 15:40:55 +02:00
// Constants
2008-10-01 21:10:17 +02:00
$this->const = array();
2015-09-07 15:46:57 +02:00
// Boxes
2020-12-07 11:42:35 +01:00
$this->boxes = array(
0=>array('file'=>'box_bookmarks.php', 'enabledbydefaulton'=>'Home')
);
2008-10-01 21:10:17 +02:00
// Permissions
$this->rights = array();
$this->rights_class = 'bookmark';
$r = 0;
2008-10-01 21:10:17 +02:00
$r++;
$this->rights[$r][0] = 331; // id de la permission
$this->rights[$r][1] = 'Lire les bookmarks'; // libelle de la permission
2010-05-01 12:52:47 +02:00
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
2008-10-01 21:10:17 +02:00
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 332; // id de la permission
$this->rights[$r][1] = 'Creer/modifier les bookmarks'; // libelle de la permission
2010-05-01 12:52:47 +02:00
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
2008-10-01 21:10:17 +02:00
$this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 333; // id de la permission
$this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission
2019-05-07 23:03:45 +02:00
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
2008-10-01 21:10:17 +02:00
$this->rights[$r][4] = 'supprimer';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
2008-10-01 21:10:17 +02:00
}
2005-09-05 10:44:15 +02:00
}