40 $mastercontent =
'<?php'.
"\n";
41 $mastercontent .=
'// File generated to link to the master file - DO NOT MODIFY - It is just an include'.
"\n";
42 $mastercontent .=
"if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
43 $mastercontent .=
" if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1);\n";
44 $mastercontent .=
" require_once '".DOL_DOCUMENT_ROOT.
"/master.inc.php';\n";
45 $mastercontent .=
"}\n";
46 $mastercontent .=
'?>'.
"\n";
47 $result = file_put_contents($filemaster, $mastercontent);
68 dol_syslog(
"dolSavePageAlias We regenerate the alias page filealias=".$filealias);
70 $aliascontent =
'<?php'.
"\n";
71 $aliascontent .=
"// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
72 $aliascontent .=
'global $dolibarr_main_data_root;'.
"\n";
73 $aliascontent .=
'if (empty($dolibarr_main_data_root)) require \'./page'.$objectpage->id.
'.tpl.php\'; ';
74 $aliascontent .=
'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.
'.tpl.php\';'.
"\n";
75 $aliascontent .=
'?>'.
"\n";
76 $result = file_put_contents($filealias, $aliascontent);
77 if ($result ===
false) {
78 dol_syslog(
"Failed to write file ".$filealias, LOG_WARNING);
83 if ($objectpage->lang && in_array($objectpage->lang, explode(
',', $object->otherlang))) {
84 $dirname = dirname($filealias);
85 $filename = basename($filealias);
86 $filealiassub = $dirname.
'/'.$objectpage->lang.
'/'.$filename;
88 $aliascontent =
'<?php'.
"\n";
89 $aliascontent .=
"// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
90 $aliascontent .=
'global $dolibarr_main_data_root;'.
"\n";
91 $aliascontent .=
'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.
'.tpl.php\'; ';
92 $aliascontent .=
'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.
'.tpl.php\';'.
"\n";
93 $aliascontent .=
'?>'.
"\n";
94 $result = file_put_contents($filealiassub, $aliascontent);
95 if ($result ===
false) {
96 dol_syslog(
"Failed to write file ".$filealiassub, LOG_WARNING);
99 } elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(
',', $object->otherlang))) {
101 if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) {
102 $dirname = dirname($filealias);
103 $filename = basename($filealias);
104 foreach (explode(
',', $object->otherlang) as $sublang) {
106 if (empty(trim($sublang)))
continue;
107 $filealiassub = $dirname.
'/'.$sublang.
'/'.$filename;
109 $aliascontent =
'<?php'.
"\n";
110 $aliascontent .=
"// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
111 $aliascontent .=
'global $dolibarr_main_data_root;'.
"\n";
112 $aliascontent .=
'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.
'.tpl.php\'; ';
113 $aliascontent .=
'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.
'.tpl.php\';'.
"\n";
114 $aliascontent .=
'?>'.
"\n";
115 $result = file_put_contents($filealiassub, $aliascontent);
116 if ($result ===
false) {
117 dol_syslog(
"Failed to write file ".$filealiassub, LOG_WARNING);
124 return ($result ?
true:
false);
144 dol_syslog(
"dolSavePageContent We regenerate the tpl page filetpl=".$filetpl);
146 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
151 $result =
dol_move($filetpl, $filetpl.
'.old', 0, 1, 0, 0);
161 if ($objectpage->lang) {
162 $shortlangcode = substr($objectpage->lang, 0, 2);
164 if (empty($shortlangcode)) {
165 $shortlangcode = substr($object->lang, 0, 2);
169 $tplcontent .=
"<?php // BEGIN PHP\n";
170 $tplcontent .=
'$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'.
"\n";
171 $tplcontent .=
"if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
172 $tplcontent .=
' $pathdepth = count(explode(\'/\', $_SERVER[\'SCRIPT_NAME\'])) - 2;'.
"\n";
173 $tplcontent .=
' require_once ($pathdepth ? str_repeat(\'../\', $pathdepth) : \'./\').\'master.inc.php\';'.
"\n";
174 $tplcontent .=
"} // Not already loaded\n";
175 $tplcontent .=
"require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
176 $tplcontent .=
"require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
177 $tplcontent .=
"ob_start();\n";
178 $tplcontent .=
"// END PHP ?>\n";
179 if (!empty($conf->global->WEBSITE_FORCE_DOCTYPE_HTML5)) {
180 $tplcontent .=
"<!DOCTYPE html>\n";
182 $tplcontent .=
'<html'.($shortlangcode ?
' lang="'.$shortlangcode.
'"' :
'').
'>'.
"\n";
183 $tplcontent .=
'<head>'.
"\n";
184 $tplcontent .=
'<title>'.dol_string_nohtmltag($objectpage->title, 0,
'UTF-8').
'</title>'.
"\n";
185 $tplcontent .=
'<meta charset="utf-8">'.
"\n";
186 $tplcontent .=
'<meta http-equiv="content-type" content="text/html; charset=utf-8" />'.
"\n";
187 $tplcontent .=
'<meta name="robots" content="index, follow" />'.
"\n";
188 $tplcontent .=
'<meta name="viewport" content="width=device-width, initial-scale=1.0">'.
"\n";
189 $tplcontent .=
'<meta name="keywords" content="'.dol_string_nohtmltag($objectpage->keywords).
'" />'.
"\n";
190 $tplcontent .=
'<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 0,
'UTF-8').
'" />'.
"\n";
191 $tplcontent .=
'<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0,
'UTF-8').
'" />'.
"\n";
192 $tplcontent .=
'<meta name="generator" content="'.DOL_APPLICATION_TITLE.
' '.DOL_VERSION.
' (https://www.dolibarr.org)" />'.
"\n";
193 $tplcontent .=
'<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag($objectpage->id).
'" />'.
"\n";
195 if ($object->virtualhost) {
196 $tplcontent .=
'<link rel="canonical" href="'.(($objectpage->id == $object->fk_default_home) ?
'/' : (($shortlangcode != substr($object->lang, 0, 2) ?
'/'.$shortlangcode :
'').
'/'.$objectpage->pageurl.
'.php')).
'" />'.
"\n";
199 if ($object->isMultiLang()) {
201 $translationof = $objectpage->fk_page;
202 if ($translationof) {
204 $tmppage->fetch($translationof);
205 if ($tmppage->id > 0) {
206 $tmpshortlangcode =
'';
207 if ($tmppage->lang) {
208 $tmpshortlangcode = preg_replace(
'/[_-].*$/',
'', $tmppage->lang);
210 if (empty($tmpshortlangcode)) {
211 $tmpshortlangcode = preg_replace(
'/[_-].*$/',
'', $object->lang);
213 if ($tmpshortlangcode != $shortlangcode) {
214 $tplcontent .=
'<link rel="alternate" hreflang="'.$tmpshortlangcode.
'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $tmppage->id ?
'/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ?
'/'.$tmpshortlangcode :
'').
'/'.$tmppage->pageurl.
'.php').
'" />'.
"\n";
220 $sql =
"SELECT rowid as id, lang, pageurl from ".MAIN_DB_PREFIX.
'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ?
", ".$translationof :
'')).
")";
221 $resql = $db->query($sql);
223 $num_rows = $db->num_rows($resql);
225 while ($obj = $db->fetch_object($resql)) {
226 $tmpshortlangcode =
'';
228 $tmpshortlangcode = preg_replace(
'/[_-].*$/',
'', $obj->lang);
230 if ($tmpshortlangcode != $shortlangcode) {
231 $tplcontent .=
'<link rel="alternate" hreflang="'.$tmpshortlangcode.
'" href="<?php echo $website->virtualhost; ?>'.($object->fk_default_home == $obj->id ?
'/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ?
'/'.$tmpshortlangcode :
'')).
'/'.$obj->pageurl.
'.php').
'" />'.
"\n";
240 $tplcontent .=
'<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ?
'/' : (($shortlangcode != substr($object->lang, 0, 2)) ?
'/'.$shortlangcode :
'')).
'/'.$objectpage->pageurl.
'.php") { ?>'.
"\n";
241 $tplcontent .=
'<link rel="alternate" hreflang="'.$shortlangcode.
'" href="<?php echo $website->virtualhost; ?>'.(($object->fk_default_home == $objectpage->id) ?
'/' : (($shortlangcode != substr($object->lang, 0, 2)) ?
'/'.$shortlangcode :
'').
'/'.$objectpage->pageurl.
'.php').
'" />'.
"\n";
243 $tplcontent .=
'<?php } ?>'.
"\n";
246 $tplcontent .=
'<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'.
"\n";
247 $tplcontent .=
'<!-- Include link to CSS file -->'.
"\n";
249 $tplcontent .=
'<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'.
"\n";
250 $tplcontent .=
'<!-- Include link to JS file -->'.
"\n";
251 $tplcontent .=
'<script nonce="'.getNonce().
'" async src="/javascript.js.php"></script>'.
"\n";
253 $tplcontent .=
'<!-- Include HTML header from common file -->'.
"\n";
254 $tplcontent .=
'<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'.
"\n";
255 $tplcontent .=
'<!-- Include HTML header from page header block -->'.
"\n";
256 $tplcontent .= preg_replace(
'/<\/?html>/ims',
'', $objectpage->htmlheader).
"\n";
257 $tplcontent .=
'</head>'.
"\n";
259 $tplcontent .=
'<!-- File generated by Dolibarr website module editor -->'.
"\n";
260 $tplcontent .=
'<body id="bodywebsite" class="bodywebsite bodywebpage-'.$objectpage->ref.
'">'.
"\n";
261 $tplcontent .= $objectpage->content.
"\n";
262 $tplcontent .=
'</body>'.
"\n";
263 $tplcontent .=
'</html>'.
"\n";
265 $tplcontent .=
'<?php // BEGIN PHP'.
"\n";
266 $tplcontent .=
'$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp, "html", '.$objectpage->id.
'); dolWebsiteIncrementCounter('.$object->id.
', "'.$objectpage->type_container.
'", '.$objectpage->id.
');'.
"\n";
267 $tplcontent .=
"// END PHP ?>\n";
270 $result = file_put_contents($filetpl, $tplcontent);
288function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object =
null)
299 $indexcontent =
'<?php'.
"\n";
300 $indexcontent .=
"// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n";
301 $indexcontent .=
'$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'.
"\n";
302 $indexcontent .=
"if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded\n";
303 $indexcontent .=
'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'.
"\n";
304 $indexcontent .=
" require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
305 $indexcontent .=
" require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
306 $indexcontent .=
' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'.
"\n";
307 $indexcontent .=
"}\n";
308 $indexcontent .=
"include_once './".basename($filetpl).
"'\n";
309 $indexcontent .=
'// END PHP ?>'.
"\n";
311 $result1 = file_put_contents($fileindex, $indexcontent);
315 if (is_object($object) && $object->fk_default_home > 0) {
317 $objectpage->fetch($object->fk_default_home);
320 if (empty($objectpage->lang) || !in_array($objectpage->lang, explode(
',', $object->otherlang))) {
321 if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && is_object($object) && !empty($object->otherlang)) {
322 $dirname = dirname($fileindex);
323 foreach (explode(
',', $object->otherlang) as $sublang) {
325 if (empty(trim($sublang)))
continue;
326 $fileindexsub = $dirname.
'/'.$sublang.
'/index.php';
330 $indexcontent =
'<?php'.
"\n";
331 $indexcontent .=
"// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n";
332 $indexcontent .=
'$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'.
"\n";
333 $indexcontent .=
"if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once '".$relpath.
"/master.inc.php'; } // Load master if not already loaded\n";
334 $indexcontent .=
'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'.
"\n";
335 $indexcontent .=
" require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
336 $indexcontent .=
" require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
337 $indexcontent .=
' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'.
"\n";
338 $indexcontent .=
"}\n";
339 $indexcontent .=
"include_once '".$relpath.
"/".basename($filetpl).
"'\n";
340 $indexcontent .=
'// END PHP ?>'.
"\n";
341 $result = file_put_contents($fileindexsub, $indexcontent);
342 if ($result ===
false) {
343 dol_syslog(
"Failed to write file ".$fileindexsub, LOG_WARNING);
356 $wrappercontent = file_get_contents(DOL_DOCUMENT_ROOT.
'/website/samples/wrapper.php');
358 $result2 = file_put_contents($filewrapper, $wrappercontent);
364 return ($result1 && $result2);
377 global $conf, $pathofwebsite;
379 dol_syslog(
"Save html header into ".$filehtmlheader);
382 $result = file_put_contents($filehtmlheader, $htmlheadercontent);
397 global $conf, $pathofwebsite;
402 $result = file_put_contents($filecss, $csscontent);
417 global $conf, $pathofwebsite;
422 $result = file_put_contents($filejs, $jscontent);
437 global $conf, $pathofwebsite;
439 dol_syslog(
"Save robot file into ".$filerobot);
442 $result = file_put_contents($filerobot, $robotcontent);
457 global $conf, $pathofwebsite;
459 dol_syslog(
"Save htaccess file into ".$filehtaccess);
462 $result = file_put_contents($filehtaccess, $htaccess);
477 global $conf, $pathofwebsite;
479 dol_syslog(
"Save manifest.js.php file into ".$file);
482 $result = file_put_contents($file, $content);
497 global $conf, $pathofwebsite;
499 dol_syslog(
"Save README.md file into ".$file);
502 $result = file_put_contents($file, $content);
517 global $conf, $pathofwebsite;
522 $result = file_put_contents($file, $content);
536 global $conf, $langs, $db, $form, $user;
538 $dirthemes = array(
'/doctemplates/websites');
539 if (!empty($conf->modules_parts[
'websitetemplates'])) {
540 foreach ($conf->modules_parts[
'websitetemplates'] as $reldir) {
541 $dirthemes = array_merge($dirthemes, (array) ($reldir.
'doctemplates/websites'));
544 $dirthemes = array_unique($dirthemes);
549 print
'<!-- For website template import -->'.
"\n";
550 print
'<table class="noborder centpercent">';
553 print
'<tr class="liste_titre"><th class="titlefield">';
554 print $form->textwithpicto($langs->trans(
"Templates"), $langs->trans(
"ThemeDir").
' : '.join(
", ", $dirthemes));
556 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?website='.urlencode($website->ref).
'&importsite=1" target="_blank" rel="noopener noreferrer external">';
560 print
'<th class="right">';
561 $url =
'https://www.dolistore.com/43-web-site-templates';
562 print
'<a href="'.$url.
'" target="_blank" rel="noopener noreferrer external">';
563 print
img_picto(
'',
'globe',
'class="pictofixedwidth"').$langs->trans(
'DownloadMoreSkins');
567 print
'<tr><td colspan="'.$colspan.
'">';
569 print
'<table class="nobordernopadding centpercent"><tr><td><div class="center">';
571 if (count($dirthemes)) {
573 foreach ($dirthemes as $dir) {
575 $dirtheme = DOL_DATA_ROOT.$dir;
576 if (is_dir($dirtheme)) {
577 $handle = opendir($dirtheme);
578 if (is_resource($handle)) {
579 while (($subdir = readdir($handle)) !==
false) {
580 if (is_file($dirtheme.
"/".$subdir) && substr($subdir, 0, 1) <>
'.' && substr($subdir, 0, 3) <>
'CVS' && preg_match(
'/\.zip$/i', $subdir)) {
581 $subdirwithoutzip = preg_replace(
'/\.zip$/i',
'', $subdir);
584 if (
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2 && preg_match(
'/_dev$/i', $subdir)) {
587 if (
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1 && preg_match(
'/_exp$/i', $subdir)) {
591 print
'<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
593 $templatedir = $dirtheme.
"/".$subdir;
594 $file = $dirtheme.
"/".$subdirwithoutzip.
".jpg";
595 $url = DOL_URL_ROOT.
'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.
".jpg";
597 if (!file_exists($file)) {
598 $url = DOL_URL_ROOT.
'/public/theme/common/nophoto.png';
601 $originalfile = basename($file);
602 $entity = $conf->entity;
603 $modulepart =
'doctemplateswebsite';
609 if (!empty($urladvanced)) {
610 $ret .=
'<a class="'.$urladvanced[
'css'].
'" target="'.$urladvanced[
'target'].
'" mime="'.$urladvanced[
'mime'].
'" href="'.$urladvanced[
'url'].
'">';
612 $ret .=
'<a href="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.urlencode($modulepart).
'&entity='.((int) $entity).
'&file='.urlencode($originalfile).
'&cache='.((int) $cache).
'">';
615 print
'<img class="img-skinthumb shadow" src="'.$url.
'" border="0" alt="'.$title.
'" title="'.$title.
'" style="margin-bottom: 5px;">';
622 if ($user->hasRight(
'website',
'delete')) {
623 print
' <a href="'.$_SERVER[
"PHP_SELF"].
'?action=deletetemplate&token='.newToken().
'&website='.urlencode($website->ref).
'&templateuserfile='.urlencode($subdir).
'">'.
img_picto(
'',
'delete').
'</a>';
625 print
'<br><a href="'.$_SERVER[
"PHP_SELF"].
'?action=importsiteconfirm&token='.newToken().
'&website='.urlencode($website->ref).
'&templateuserfile='.urlencode($subdir).
'" class="button">'.$langs->trans(
"Load").
'</a>';
635 print
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>';
638 print
'</div></td></tr></table>';
657 global $conf, $langs, $user;
661 if (empty($phpfullcodestringold) && empty($phpfullcodestring)) {
666 $forbiddenphpcommands = array();
667 if (empty($conf->global->WEBSITE_PHP_ALLOW_EXEC)) {
668 $forbiddenphpcommands = array(
"exec",
"passthru",
"shell_exec",
"system",
"proc_open",
"popen",
"eval",
"dol_eval",
"executeCLI");
670 if (empty($conf->global->WEBSITE_PHP_ALLOW_WRITE)) {
671 $forbiddenphpcommands = array_merge($forbiddenphpcommands, array(
"fopen",
"file_put_contents",
"fputs",
"fputscsv",
"fwrite",
"fpassthru",
"unlink",
"mkdir",
"rmdir",
"symlink",
"touch",
"umask"));
673 foreach ($forbiddenphpcommands as $forbiddenphpcommand) {
674 if (preg_match(
'/'.$forbiddenphpcommand.
'\s*\(/ms', $phpfullcodestring)) {
676 setEventMessages($langs->trans(
"DynamicPHPCodeContainsAForbiddenInstruction", $forbiddenphpcommand),
null,
'errors');
681 $forbiddenphpchars = array();
682 if (empty($conf->global->WEBSITE_PHP_ALLOW_DANGEROUS_CHARS)) {
683 $forbiddenphpchars = array(
"`");
685 foreach ($forbiddenphpchars as $forbiddenphpchar) {
686 if (preg_match(
'/'.$forbiddenphpchar.
'/ms', $phpfullcodestring)) {
688 setEventMessages($langs->trans(
"DynamicPHPCodeContainsAForbiddenInstruction", $forbiddenphpchar),
null,
'errors');
693 if (preg_match(
'/[}\]]\(/ims', $phpfullcodestring)) {
695 setEventMessages($langs->trans(
"DynamicPHPCodeContainsAForbiddenInstruction",
']('),
null,
'errors');
698 if (preg_match(
'/\$[a-z0-9_]+\(/ims', $phpfullcodestring)) {
700 setEventMessages($langs->trans(
"DynamicPHPCodeContainsAForbiddenInstruction",
'$...('),
null,
'errors');
703 if ($phpfullcodestringold != $phpfullcodestring) {
704 if (!$error && empty($user->rights->website->writephp)) {
706 setEventMessages($langs->trans(
"NotAllowedToAddDynamicContent"),
null,
'errors');
709 $dolibarrdataroot = preg_replace(
'/([\\/]+)$/i',
'', DOL_DATA_ROOT);
710 $allowimportsite =
true;
711 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
712 if (
dol_is_file($dolibarrdataroot.
'/installmodules.lock')) {
713 $allowimportsite =
false;
716 if (!$allowimportsite) {
721 $message = $langs->trans(
'InstallModuleFromWebHasBeenDisabledContactUs');
724 $message = $langs->trans(
"InstallModuleFromWebHasBeenDisabledByFile", $dolibarrdataroot.
'/installmodules.lock');
dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvirus=0, $indexdatabase=1, $moreinfo=array())
Move a file into another name.
dol_filemtime($pathoffile)
Return time of a file.
dol_filesize($pathoffile)
Return size of a file.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_is_file($pathoffile)
Return if path is a file.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param='')
Return URL we can use for advanced preview links.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
checkPHPCode($phpfullcodestringold, $phpfullcodestring)
Check a new string containing only php code (including <php tag)
dolSaveMasterFile($filemaster)
Save content of a page on disk.
showWebsiteTemplates(Website $website)
Show list of themes.
dolSaveLicense($file, $content)
Save content of a page on disk.
dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent)
Save content of a page on disk.
dolSaveReadme($file, $content)
Save content of a page on disk.
dolSaveManifestJson($file, $content)
Save content of a page on disk.
dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object=null)
Save content of the index.php and/or the wrapper.php page.
dolSavePageAlias($filealias, $object, $objectpage)
Save an alias page on disk (A page that include the reference page).
dolSaveHtaccessFile($filehtaccess, $htaccess)
Save content of a page on disk.
dolSaveJsFile($filejs, $jscontent)
Save content of a page on disk.
dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $backupold=0)
Save content of a page on disk (page name is generally ID_of_page.php).
dolSaveCssFile($filecss, $csscontent)
Save content of a page on disk.
dolSaveRobotFile($filerobot, $robotcontent)
Save content of a page on disk.