dolibarr 19.0.4
modExternalSite.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2009 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
28include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
29
30
35{
41 public function __construct($db)
42 {
43 $this->db = $db;
44
45 // Id for module (must be unique).
46 // Use here a free id.
47 $this->numero = 100;
48
49 // Family can be 'crm','financial','hr','projects','product','technic','other'
50 // It is used to sort modules in module setup page
51 $this->family = "interface";
52 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
53 $this->name = preg_replace('/^mod/i', '', get_class($this));
54 // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
55 $this->description = "This module include an external web site or page into Dolibarr menus and view it into a Dolibarr frame.";
56 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57 $this->version = 'dolibarr';
58 // Key used in llx_const table to save module status enabled/disabled (XXX is id value)
59 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
60 // Name of png file (without png) used for this module
61 $this->picto = 'website';
62 // Call to inside lang's file
63 $this->langfiles = array("externalsite");
64
65 // Data directories to create when module is enabled
66 $this->dirs = array();
67
68 // Config pages. Put here list of php page names stored in admmin directory used to setup module
69 $this->config_page_url = array("index.php@externalsite");
70
71 // Dependencies
72 $this->depends = array(); // List of modules id that must be enabled if this module is enabled
73 $this->requiredby = array(); // List of modules id to disable if this one is disabled
74
75 // Constants
76 // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
77 // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
78 // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0)
79 // );
80 $this->const = array(0=>array('EXTERNALSITE_LABEL', 'chaine', 'ExternalSite', 'To declare label to use into external site menu entry', 0));
81
82 // Boxes
83 $this->boxes = array(); // List of boxes
84 $r = 0;
85
86 // Add here list of php file(s) stored in core/boxes that contains class to show a box.
87 // Example:
88 //$this->boxes[$r][1] = "myboxa.php";
89 //$r++;
90 //$this->boxes[$r][1] = "myboxb.php";
91 //$r++;
92
93 // Permissions
94 $this->rights_class = 'externalsite'; // Permission key
95 $this->rights = array(); // Permission array used by this module
96
97 // Menus
98 //------
99 $r = 0;
100
101 $this->menu[$r] = array(
102 'fk_menu'=>0,
103 'type'=>'top',
104 'titre'=>'__[EXTERNALSITE_LABEL]__',
105 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth em092"'),
106 'mainmenu'=>'externalsite',
107 'url'=>'/externalsite/frames.php',
108 'langs'=>'other',
109 'position'=>100,
110 'perms'=>'',
111 'enabled'=>'$conf->externalsite->enabled',
112 'target'=>'',
113 'user'=>0
114 );
115 $r++;
116 }
117}
Class DolibarrModules.
Description and activation class for module ExternalSite.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124