dolibarr  7.0.0-beta
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@capnetworks.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 <http://www.gnu.org/licenses/>.
18  */
19 
28 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
29 
30 
35 {
36 
42  function __construct($db)
43  {
44  $this->db = $db;
45 
46  // Id for module (must be unique).
47  // Use here a free id.
48  $this->numero = 100;
49 
50  // Family can be 'crm','financial','hr','projects','product','technic','other'
51  // It is used to sort modules in module setup page
52  $this->family = "other";
53  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
54  $this->name = preg_replace('/^mod/i','',get_class($this));
55  // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
56  $this->description = "This module include an external web site or page into Dolibarr menus and view it into a Dolibarr frame.";
57  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
58  $this->version = 'dolibarr';
59  // Key used in llx_const table to save module status enabled/disabled (XXX is id value)
60  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
61  // Where to store the module in setup page (0=common,1=interface,2=other)
62  $this->special = 1;
63  // Name of png file (without png) used for this module
64  $this->picto='bookmark';
65  // Call to inside lang's file
66  $this->langfiles = array("externalsite");
67 
68  // Data directories to create when module is enabled
69  $this->dirs = array();
70 
71  // Config pages. Put here list of php page names stored in admmin directory used to setup module
72  $this->config_page_url = array("externalsite.php@externalsite");
73 
74  // Dependencies
75  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
76  $this->requiredby = array(); // List of modules id to disable if this one is disabled
77 
78  // Constants
79  // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
80  // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
81  // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0)
82  // );
83  $this->const = array(0=>array('EXTERNALSITE_LABEL','chaine','ExternalSite','To declare label to use into external site menu entry', 0));
84 
85  // Boxes
86  $this->boxes = array(); // List of boxes
87  $r=0;
88 
89  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
90  // Example:
91  //$this->boxes[$r][1] = "myboxa.php";
92  //$r++;
93  //$this->boxes[$r][1] = "myboxb.php";
94  //$r++;
95 
96  // Permissions
97  $this->rights_class = 'externalsite'; // Permission key
98  $this->rights = array(); // Permission array used by this module
99 
100  // Menus
101  //------
102  $r=0;
103 
104  $this->menu[$r]=array(
105  'fk_menu'=>0,
106  'type'=>'top',
107  'titre'=>'__[EXTERNALSITE_LABEL]__',
108  'mainmenu'=>'externalsite',
109  'url'=>'/externalsite/frames.php',
110  'langs'=>'other',
111  'position'=>100,
112  'perms'=>'',
113  'enabled'=>'$conf->externalsite->enabled',
114  'target'=>'',
115  'user'=>0
116  );
117  $r++;
118 
119  }
120 }
121 
Class DolibarrModules.
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
__construct($db)
Constructor.
Description and activation class for module ExternalSite.