25 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
44 $this->numero = 10000;
48 $this->family =
"portal";
49 $this->module_position =
'50';
51 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
52 $this->
description =
"Enable to build and serve public web sites with CMS features";
54 $this->version =
'dolibarr';
56 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
58 $this->picto =
'website';
61 $this->dirs = array(
"/website/temp");
64 $this->config_page_url = array(
'website.php');
67 $this->hidden = !empty($conf->global->MODULE_WEBSITE_DISABLED);
68 $this->depends = array(
'modFckeditor');
69 $this->requiredby = array();
70 $this->conflictwith = array();
71 $this->phpmin = array(5, 4);
72 $this->langfiles = array(
"website");
75 $this->
const = array();
81 $this->boxes = array();
84 $this->rights = array();
85 $this->rights_class =
'website';
88 $this->rights[$r][0] = 10001;
89 $this->rights[$r][1] =
'Read website content';
90 $this->rights[$r][3] = 0;
91 $this->rights[$r][4] =
'read';
94 $this->rights[$r][0] = 10002;
95 $this->rights[$r][1] =
'Create/modify website content (html and javascript content)';
96 $this->rights[$r][3] = 0;
97 $this->rights[$r][4] =
'write';
100 $this->rights[$r][0] = 10003;
101 $this->rights[$r][1] =
'Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers.';
102 $this->rights[$r][3] = 0;
103 $this->rights[$r][4] =
'writephp';
106 $this->rights[$r][0] = 10005;
107 $this->rights[$r][1] =
'Delete website content';
108 $this->rights[$r][3] = 0;
109 $this->rights[$r][4] =
'delete';
114 $this->menu[$r] = array(
'fk_menu'=>
'0',
117 'mainmenu'=>
'website',
118 'url'=>
'/website/index.php',
121 'enabled'=>
'$conf->website->enabled',
122 'perms'=>
'$user->rights->website->read',
130 $this->export_code[$r] = $this->rights_class.
'_'.$r;
131 $this->export_label[$r] =
'MyWebsitePages';
132 $this->export_icon[$r] =
'globe';
133 $keyforclass =
'WebsitePage'; $keyforclassfile =
'/website/class/websitepage.class.php'; $keyforelement =
'Website';
134 include DOL_DOCUMENT_ROOT.
'/core/commonfieldsinexport.inc.php';
137 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
138 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'website_page as t, '.MAIN_DB_PREFIX.
'website as p';
139 $this->export_sql_end[$r] .=
' WHERE t.fk_website = p.rowid';
140 $this->export_sql_end[$r] .=
' AND p.entity IN ('.getEntity(
'website').
')';
153 public function init($options =
'')
155 global $conf, $langs;
158 $this->
remove($options);
161 $dirarray = array(
'common/flags'=>
'flags',
'common/octicons/build/svg'=>
'octicons');
162 foreach ($dirarray as $dirfrom => $dirtarget)
164 $src = DOL_DOCUMENT_ROOT.
'/theme/'.$dirfrom;
165 $dest = DOL_DATA_ROOT.
'/medias/image/'.$dirtarget;
169 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
174 $langs->load(
"errors");
175 $this->error = $langs->trans(
'ErrorFailToCopyDir', $src, $dest);
182 $srcroot = DOL_DOCUMENT_ROOT.
'/install/doctemplates/websites';
183 $destroot = DOL_DATA_ROOT.
'/doctemplates/websites';
187 $docs =
dol_dir_list($srcroot,
'files', 0,
'website_.*(\.zip|\.jpg)$');
188 foreach ($docs as $cursorfile) {
189 $src = $srcroot.
'/'.$cursorfile[
'name'];
190 $dest = $destroot.
'/'.$cursorfile[
'name'];
192 $result =
dol_copy($src, $dest, 0, 1);
194 $langs->load(
"errors");
195 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
201 return $this->
_init($sql, $options);
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement=null, $excludesubdir=0)
Copy a dir to another dir.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Class to describe Websites module.
_init($array_sql, $options= '')
Enables a module.
init($options= '')
Function called when module is enabled.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
__construct($db)
Constructor.