29 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
42 public $element =
'website';
47 public $table_element =
'website';
52 public $ismultientitymanaged = 1;
55 protected $childtablesoncascade = array();
61 public $picto =
'globe';
96 public $date_creation;
101 public $date_modification;
107 public $fk_default_home;
112 public $fk_user_creat;
117 public $fk_user_modif;
127 public $use_manifest;
142 const STATUS_DRAFT = 0;
143 const STATUS_VALIDATED = 1;
167 global $conf, $langs;
175 if (isset($this->entity)) {
176 $this->entity = (int) $this->entity;
178 if (isset($this->
ref)) {
179 $this->
ref = trim($this->
ref);
184 if (isset($this->status)) {
185 $this->status = (int) $this->status;
187 if (empty($this->date_creation)) {
188 $this->date_creation = $now;
190 if (empty($this->date_modification)) {
191 $this->date_modification = $now;
194 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
195 $tmparray = explode(
',', $this->otherlang);
196 if (is_array($tmparray)) {
197 foreach ($tmparray as $key => $val) {
199 if (empty(trim($val))) {
200 unset($tmparray[$key]);
203 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
205 $this->otherlang = join(
',', $tmparray);
209 if (empty($this->entity)) {
210 $this->entity = $conf->entity;
212 if (empty($this->lang)) {
213 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
218 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.
'(';
221 $sql .=
'description,';
223 $sql .=
'otherlang,';
225 $sql .=
'fk_default_home,';
226 $sql .=
'virtualhost,';
227 $sql .=
'fk_user_creat,';
228 $sql .=
'date_creation,';
231 $sql .=
') VALUES (';
232 $sql .=
' '.((empty($this->entity) && $this->entity !=
'0') ?
'NULL' : $this->entity).
',';
233 $sql .=
' '.(!isset($this->
ref) ?
'NULL' :
"'".$this->db->escape($this->
ref).
"'").
',';
235 $sql .=
' '.(!isset($this->lang) ?
'NULL' :
"'".$this->db->escape($this->lang).
"'").
',';
236 $sql .=
' '.(!isset($this->otherlang) ?
'NULL' :
"'".$this->db->escape($this->otherlang).
"'").
',';
237 $sql .=
' '.(!isset($this->status) ?
'1' : $this->status).
',';
238 $sql .=
' '.(!isset($this->fk_default_home) ?
'NULL' : $this->fk_default_home).
',';
239 $sql .=
' '.(!isset($this->virtualhost) ?
'NULL' :
"'".$this->db->escape($this->virtualhost).
"'").
",";
240 $sql .=
' '.(!isset($this->fk_user_creat) ? $user->id : $this->fk_user_creat).
',';
241 $sql .=
' '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_creation).
"'").
",";
243 $sql .=
' '.(!isset($this->date_modification) ||
dol_strlen($this->date_modification) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_modification).
"'");
248 $resql = $this->db->query(
$sql);
251 $this->errors[] =
'Error '.$this->db->lasterror();
252 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
256 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
259 $tmplangarray = explode(
',', $this->otherlang);
260 if (is_array($tmplangarray)) {
261 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
262 foreach ($tmplangarray as $val) {
263 if (trim($val) == $this->lang) {
266 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
282 $stringtodolibarrfile =
"# Some properties for Dolibarr web site CMS\n";
283 $stringtodolibarrfile .=
"param=value\n";
285 file_put_contents($conf->website->dir_output.
'/'.$this->ref.
'/.dolibarr', $stringtodolibarrfile);
290 $this->db->rollback();
291 if ($this->db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
310 public function fetch($id, $ref =
null)
316 $sql .=
" t.entity,";
318 $sql .=
" t.position,";
319 $sql .=
" t.description,";
321 $sql .=
" t.otherlang,";
322 $sql .=
" t.status,";
323 $sql .=
" t.fk_default_home,";
324 $sql .=
" t.use_manifest,";
325 $sql .=
" t.virtualhost,";
326 $sql .=
" t.fk_user_creat,";
327 $sql .=
" t.fk_user_modif,";
328 $sql .=
" t.date_creation,";
329 $sql .=
" t.tms as date_modification";
330 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
331 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
333 $sql .=
" AND t.ref = '".$this->db->escape($ref).
"'";
335 $sql .=
" AND t.rowid = ".(int) $id;
338 $resql = $this->db->query(
$sql);
340 $numrows = $this->db->num_rows($resql);
342 $obj = $this->db->fetch_object($resql);
344 $this->
id = $obj->rowid;
346 $this->entity = $obj->entity;
347 $this->
ref = $obj->ref;
350 $this->lang = $obj->lang;
351 $this->otherlang = $obj->otherlang;
352 $this->status = $obj->status;
353 $this->fk_default_home = $obj->fk_default_home;
354 $this->virtualhost = $obj->virtualhost;
355 $this->use_manifest = $obj->use_manifest;
356 $this->fk_user_creat = $obj->fk_user_creat;
357 $this->fk_user_modif = $obj->fk_user_modif;
358 $this->date_creation = $this->db->jdate($obj->date_creation);
359 $this->date_modification = $this->db->jdate($obj->date_modification);
361 $this->db->free($resql);
374 $this->errors[] =
'Error '.$this->db->lasterror();
375 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
388 $this->lines = array();
392 return count($this->lines) ? 1 : 0;
408 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
414 $sql .=
" t.entity,";
416 $sql .=
" t.description,";
418 $sql .=
" t.otherlang,";
419 $sql .=
" t.status,";
420 $sql .=
" t.fk_default_home,";
421 $sql .=
" t.virtualhost,";
422 $sql .=
" t.fk_user_creat,";
423 $sql .=
" t.fk_user_modif,";
424 $sql .=
" t.date_creation,";
425 $sql .=
" t.tms as date_modification";
426 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
427 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
430 if (count($filter) > 0) {
431 foreach ($filter as $key => $value) {
432 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
435 if (count($sqlwhere) > 0) {
436 $sql .=
' AND '.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere);
439 if (!empty($sortfield)) {
440 $sql .= $this->db->order($sortfield, $sortorder);
442 if (!empty($limit)) {
443 $sql .= $this->db->plimit($limit, $offset);
445 $this->lines = array();
447 $resql = $this->db->query(
$sql);
449 $num = $this->db->num_rows($resql);
451 while ($obj = $this->db->fetch_object($resql)) {
452 $line =
new self($this->db);
454 $line->id = $obj->rowid;
456 $line->entity = $obj->entity;
457 $line->ref = $obj->ref;
458 $line->description = $obj->description;
459 $line->lang = $obj->lang;
460 $line->otherlang = $obj->otherlang;
461 $line->status = $obj->status;
462 $line->fk_default_home = $obj->fk_default_home;
463 $line->virtualhost = $obj->virtualhost;
464 $this->fk_user_creat = $obj->fk_user_creat;
465 $this->fk_user_modif = $obj->fk_user_modif;
466 $line->date_creation = $this->db->jdate($obj->date_creation);
467 $line->date_modification = $this->db->jdate($obj->date_modification);
469 $this->lines[$line->id] = $line;
471 $this->db->free($resql);
475 $this->errors[] =
'Error '.$this->db->lasterror();
476 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
492 global $conf, $langs;
500 if (isset($this->entity)) {
501 $this->entity = (int) $this->entity;
503 if (isset($this->
ref)) {
504 $this->
ref = trim($this->
ref);
509 if (isset($this->status)) {
510 $this->status = (int) $this->status;
514 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
515 $tmparray = explode(
',', $this->otherlang);
516 if (is_array($tmparray)) {
517 foreach ($tmparray as $key => $val) {
519 if (empty(trim($val))) {
520 unset($tmparray[$key]);
523 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
525 $this->otherlang = join(
',', $tmparray);
527 if (empty($this->lang)) {
528 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
536 $sql =
'UPDATE '.MAIN_DB_PREFIX.$this->table_element.
' SET';
537 $sql .=
' entity = '.(isset($this->entity) ? $this->entity :
"null").
',';
538 $sql .=
' ref = '.(isset($this->
ref) ?
"'".$this->db->escape($this->
ref).
"'" :
"null").
',';
540 $sql .=
' lang = '.(isset($this->lang) ?
"'".$this->db->escape($this->lang).
"'" :
"null").
',';
541 $sql .=
' otherlang = '.(isset($this->otherlang) ?
"'".$this->db->escape($this->otherlang).
"'" :
"null").
',';
542 $sql .=
' status = '.(isset($this->status) ? $this->status :
"null").
',';
543 $sql .=
' fk_default_home = '.(($this->fk_default_home > 0) ? $this->fk_default_home :
"null").
',';
544 $sql .=
' use_manifest = '.((int) $this->use_manifest).
',';
545 $sql .=
' virtualhost = '.(($this->virtualhost !=
'') ?
"'".$this->db->escape($this->virtualhost).
"'" :
"null").
',';
546 $sql .=
' fk_user_modif = '.(!isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).
',';
547 $sql .=
' date_creation = '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) != 0 ?
"'".$this->db->idate($this->date_creation).
"'" :
'null').
',';
548 $sql .=
' tms = '.(dol_strlen($this->date_modification) != 0 ?
"'".$this->db->idate($this->date_modification).
"'" :
"'".$this->db->idate(
dol_now()).
"'");
549 $sql .=
' WHERE rowid='.((int) $this->
id);
553 $resql = $this->db->query(
$sql);
556 $this->errors[] =
'Error '.$this->db->lasterror();
557 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
560 if (!$error && !$notrigger) {
565 $tmplangarray = explode(
',', $this->otherlang);
566 if (is_array($tmplangarray)) {
567 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
568 foreach ($tmplangarray as $val) {
569 if (trim($val) == $this->lang) {
572 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
584 $this->db->rollback();
602 public function delete(
User $user, $notrigger =
false)
613 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'website_page';
614 $sql .=
' WHERE fk_website = '.((int) $this->
id);
616 $resql = $this->db->query(
$sql);
619 $this->errors[] =
'Error '.$this->db->lasterror();
620 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
630 if (!$error && !empty($this->
ref)) {
631 $pathofwebsite = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$this->
ref;
638 $this->db->rollback();
660 global $conf, $langs;
661 global $dolibarr_main_data_root;
670 if (empty($newref)) {
671 $this->error =
'ErrorBadParameter';
675 $object =
new self($this->db);
678 if ($object->fetch(0, $newref) > 0) {
679 $this->error =
'ErrorNewRefIsAlreadyUsed';
686 $object->fetch($fromid);
688 $oldidforhome = $object->fk_default_home;
689 $oldref = $object->ref;
691 $pathofwebsiteold = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($oldref);
692 $pathofwebsitenew = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($newref);
695 $fileindex = $pathofwebsitenew.
'/index.php';
699 unset($object->fk_user_creat);
700 unset($object->import_key);
703 $object->ref = $newref;
704 $object->fk_default_home = 0;
705 $object->virtualhost =
'';
706 $object->date_creation = $now;
707 $object->fk_user_creat = $user->id;
708 $object->position = ((int) $object->position) + 1;
709 $object->status = self::STATUS_DRAFT;
710 if (empty($object->lang)) {
711 $object->lang = substr($langs->defaultlang, 0, 2);
715 $object->context[
'createfromclone'] =
'createfromclone';
716 $result = $object->create($user);
719 $this->error = $object->error;
720 $this->errors = $object->errors;
721 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
725 dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0,
null, 2);
728 $pathtomedias = DOL_DATA_ROOT.
'/medias';
729 $pathtomediasinwebsite = $pathofwebsitenew.
'/medias';
731 dol_syslog(
"Create symlink for ".$pathtomedias.
" into name ".$pathtomediasinwebsite);
732 dol_mkdir(dirname($pathtomediasinwebsite));
733 $result = symlink($pathtomedias, $pathtomediasinwebsite);
737 $pathofmediasjsold = DOL_DATA_ROOT.
'/medias/js/'.$oldref;
738 $pathofmediasjsnew = DOL_DATA_ROOT.
'/medias/js/'.$newref;
739 dolCopyDir($pathofmediasjsold, $pathofmediasjsnew, $conf->global->MAIN_UMASK, 0);
741 $pathofmediasimageold = DOL_DATA_ROOT.
'/medias/image/'.$oldref;
742 $pathofmediasimagenew = DOL_DATA_ROOT.
'/medias/image/'.$newref;
743 dolCopyDir($pathofmediasimageold, $pathofmediasimagenew, $conf->global->MAIN_UMASK, 0);
749 $listofpages = $objectpages->fetchAll($fromid);
750 foreach ($listofpages as $pageid => $objectpageold) {
752 $filetplold = $pathofwebsitenew.
'/page'.$pageid.
'.tpl.php';
756 $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl,
'', 0, $object->id, 1);
759 if (is_object($objectpagenew) && $objectpagenew->pageurl) {
760 $filealias = $pathofwebsitenew.
'/'.$objectpagenew->pageurl.
'.php';
761 $filetplnew = $pathofwebsitenew.
'/page'.$objectpagenew->id.
'.tpl.php';
774 if ($pageid == $oldidforhome) {
775 $newidforhome = $objectpagenew->id;
786 $object->fk_default_home = $newidforhome;
787 $res = $object->update($user);
794 $filetpl = $pathofwebsitenew.
'/page'.$newidforhome.
'.tpl.php';
795 $filewrapper = $pathofwebsitenew.
'/wrapper.php';
799 $result =
dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl, $filewrapper, $object);
803 unset($object->context[
'createfromclone']);
811 $this->db->rollback();
828 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
830 global $langs, $conf, $db;
831 global $dolibarr_main_authentication, $dolibarr_main_demo;
838 $label =
'<u>'.$langs->trans(
"WebSite").
'</u>';
840 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
841 $label .=
'<b>'.$langs->trans(
'MainLanguage').
':</b> '.$this->lang;
843 $linkstart =
'<a href="'.DOL_URL_ROOT.
'/website/card.php?id='.$this->
id.
'"';
844 $linkstart .= ($notooltip ?
'' :
' title="'.dol_escape_htmltag($label, 1).
'" class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"');
848 $linkstart = $linkend =
'';
851 $result .= ($linkstart.img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ?
'' :
'class="classfortooltip"')).$linkend);
852 if ($withpicto != 2) {
856 $result .= $linkstart.$this->ref.$linkend;
868 return $this->
LibStatut($this->status, $mode);
884 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
887 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
888 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
889 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
890 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
893 $statusType =
'status5';
894 if ($status == self::STATUS_VALIDATED) {
895 $statusType =
'status4';
898 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
915 $this->
ref =
'myspecimenwebsite';
918 $this->otherlang =
'fr,es';
920 $this->fk_default_home =
null;
921 $this->virtualhost =
'http://myvirtualhost';
922 $this->fk_user_creat = $user->id;
923 $this->fk_user_modif = $user->id;
924 $this->date_creation =
dol_now();
936 global $conf, $mysoc;
940 if (empty($website->id) || empty($website->ref)) {
945 dol_syslog(
"Create temp dir ".$conf->website->dir_temp);
947 if (!is_writable($conf->website->dir_temp)) {
948 setEventMessages(
"Temporary dir ".$conf->website->dir_temp.
" is not writable",
null,
'errors');
952 $destdir = $conf->website->dir_temp.
'/'.$website->ref;
955 $count = 0; $countreallydeleted = 0;
957 if ($counttodelete != $countreallydeleted) {
958 setEventMessages(
"Failed to clean temp directory ".$destdir,
null,
'errors');
962 $arrayreplacementinfilename = array();
963 $arrayreplacementincss = array();
964 $arrayreplacementincss[
'file=image/'.$website->ref.
'/'] =
"file=image/__WEBSITE_KEY__/";
965 $arrayreplacementincss[
'file=js/'.$website->ref.
'/'] =
"file=js/__WEBSITE_KEY__/";
966 $arrayreplacementincss[
'medias/image/'.$website->ref.
'/'] =
"medias/image/__WEBSITE_KEY__/";
967 $arrayreplacementincss[
'medias/js/'.$website->ref.
'/'] =
"medias/js/__WEBSITE_KEY__/";
968 if ($mysoc->logo_small) {
969 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_small] =
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__";
971 if ($mysoc->logo_mini) {
972 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini] =
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__";
975 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo] =
"file=logos%2Fthumbs%2F__LOGO_KEY__";
980 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/containers');
981 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey');
982 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey');
985 $srcdir = $conf->website->dir_output.
'/'.$website->ref;
986 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers';
988 dol_syslog(
"Copy pages from ".$srcdir.
" into ".$destdir);
989 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array(
'old',
'back'));
992 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md')) {
993 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md', $conf->website->dir_temp.
'/'.$website->ref.
'/README.md');
995 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE')) {
996 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE', $conf->website->dir_temp.
'/'.$website->ref.
'/LICENSE');
1000 $srcdir = DOL_DATA_ROOT.
'/medias/image/'.$website->ref;
1001 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey';
1003 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1004 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1007 $srcdir = DOL_DATA_ROOT.
'/medias/js/'.$website->ref;
1008 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey';
1010 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1011 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1014 $cssindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/styles.css.php';
1019 $htmldeaderindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/htmlheader.html';
1025 $filesql = $conf->website->dir_temp.
'/'.$website->ref.
'/website_pages.sql';
1026 $fp = fopen($filesql,
"w");
1033 $listofpages = $objectpages->fetchAll($website->id);
1037 foreach ($listofpages as $pageid => $objectpageold) {
1038 $objectpageold->newid = $i;
1042 foreach ($listofpages as $pageid => $objectpageold) {
1045 foreach ($listofpages as $pageid2 => $objectpageold2) {
1046 if ($pageid2 == $objectpageold->fk_page) {
1047 $newfk_page = $objectpageold2->newid;
1051 $objectpageold->newfk_page = $newfk_page;
1054 foreach ($listofpages as $pageid => $objectpageold) {
1055 $allaliases = $objectpageold->pageurl;
1056 $allaliases .= ($objectpageold->aliasalt ?
','.$objectpageold->aliasalt :
'');
1058 $line =
'-- File generated by Dolibarr '.DOL_VERSION.
' -- '.
dol_print_date(
dol_now(
'gmt'),
'standard',
'gmt').
' UTC --;';
1061 $line .=
'-- Page ID '.$objectpageold->id.
' -> '.$objectpageold->newid.
'__+MAX_llx_website_page__ - Aliases '.$allaliases.
' --;';
1066 $line =
'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames)';
1068 $line .=
" VALUES(";
1069 $line .= $objectpageold->newid.
"__+MAX_llx_website_page__, ";
1070 $line .= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page).
"__+MAX_llx_website_page__" :
"null").
", ";
1071 $line .=
"__WEBSITE_ID__, ";
1072 $line .=
"'".$this->db->escape($objectpageold->pageurl).
"', ";
1073 $line .=
"'".$this->db->escape($objectpageold->aliasalt).
"', ";
1074 $line .=
"'".$this->db->escape($objectpageold->title).
"', ";
1075 $line .=
"'".$this->db->escape($objectpageold->description).
"', ";
1076 $line .=
"'".$this->db->escape($objectpageold->lang).
"', ";
1077 $line .=
"'".$this->db->escape($objectpageold->image).
"', ";
1078 $line .=
"'".$this->db->escape($objectpageold->keywords).
"', ";
1079 $line .=
"'".$this->db->escape($objectpageold->status).
"', ";
1080 $line .=
"'".$this->db->idate($objectpageold->date_creation).
"', ";
1081 $line .=
"'".$this->db->idate($objectpageold->date_modification).
"', ";
1082 $line .= ($objectpageold->import_key ?
"'".$this->db->escape($objectpageold->import_key).
"'" :
"null").
", ";
1083 $line .=
"'".$this->db->escape($objectpageold->grabbed_from).
"', ";
1084 $line .=
"'".$this->db->escape($objectpageold->type_container).
"', ";
1087 $stringtoexport = $objectpageold->htmlheader;
1088 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1089 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1090 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1091 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1092 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1094 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1095 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1096 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1097 $line .=
"'".$this->db->escape(str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport)).
"', ";
1100 $stringtoexport = $objectpageold->content;
1101 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1102 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1103 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1104 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1105 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1106 $stringtoexport = str_replace(
'"image/'.$website->ref.
'/',
'"image/__WEBSITE_KEY__/', $stringtoexport);
1107 $stringtoexport = str_replace(
'"/image/'.$website->ref.
'/',
'"/image/__WEBSITE_KEY__/', $stringtoexport);
1108 $stringtoexport = str_replace(
'"js/'.$website->ref.
'/',
'"js/__WEBSITE_KEY__/', $stringtoexport);
1109 $stringtoexport = str_replace(
'"/js/'.$website->ref.
'/',
'"/js/__WEBSITE_KEY__/', $stringtoexport);
1111 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1112 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1113 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1116 $line .=
"'".$this->db->escape($stringtoexport).
"', ";
1117 $line .=
"'".$this->db->escape($objectpageold->author_alias).
"', ";
1118 $line .= (int) $objectpageold->allowed_in_frames;
1126 if ($this->fk_default_home > 0 && ($objectpageold->id == $this->fk_default_home) && ($objectpageold->newid > 0)) {
1128 $line =
"UPDATE llx_website SET fk_default_home = ".($objectpageold->newid > 0 ? $this->db->escape($objectpageold->newid).
"__+MAX_llx_website_page__" :
"null").
" WHERE rowid = __WEBSITE_ID__;";
1134 $line =
"\n-- For Dolibarr v14+ --;\n";
1135 $line .=
"UPDATE llx_website SET lang = '".$this->db->escape($this->lang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1136 $line .=
"UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1144 $filedir = $conf->website->dir_temp.
'/'.$website->ref.
'/.';
1145 $fileglob = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-*.zip';
1146 $filename = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-'.
dol_print_date(
dol_now(),
'dayhourlog').
'-V'.((
float) DOL_VERSION).
'.zip';
1149 $result = dol_compress_file($filedir, $filename,
'zip');
1155 $this->error = $errormsg;
1169 global $conf, $mysoc;
1176 if (empty($object->ref)) {
1177 $this->error =
'Function importWebSite called on object not loaded (object->ref is empty)';
1182 dol_mkdir($conf->website->dir_temp.
'/'.$object->ref);
1184 $filename = basename($pathtofile);
1185 if (!preg_match(
'/^website_(.*)-(.*)$/', $filename, $reg)) {
1186 $this->errors[] =
'Bad format for filename '.$filename.
'. Must be website_XXX-VERSION.';
1190 $result =
dol_uncompress($pathtofile, $conf->website->dir_temp.
'/'.$object->ref);
1192 if (!empty($result[
'error'])) {
1193 $this->errors[] =
'Failed to unzip file '.$pathtofile.
'.';
1197 $arrayreplacement = array();
1198 $arrayreplacement[
'__WEBSITE_ID__'] = $object->id;
1199 $arrayreplacement[
'__WEBSITE_KEY__'] = $object->ref;
1200 $arrayreplacement[
'__N__'] = $this->db->escape(
"\n");
1201 $arrayreplacement[
'__LOGO_SMALL_KEY__'] = $this->db->escape($mysoc->logo_small);
1202 $arrayreplacement[
'__LOGO_MINI_KEY__'] = $this->db->escape($mysoc->logo_mini);
1203 $arrayreplacement[
'__LOGO_KEY__'] = $this->db->escape($mysoc->logo);
1206 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/containers', $conf->website->dir_output.
'/'.$object->ref, 0, 1);
1209 $cssindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/styles.css.php';
1212 $htmldeaderindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/htmlheader.html';
1216 $filemaster = $conf->website->dir_output.
'/'.$object->ref.
'/master.inc.php';
1219 $this->errors[] =
'Failed to write file '.$filemaster;
1223 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/image/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/image/'.$object->ref, 0, 1);
1224 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/js/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/js/'.$object->ref, 0, 1);
1226 $sqlfile = $conf->website->dir_temp.
"/".$object->ref.
'/website_pages.sql';
1233 $sqlgetrowid =
'SELECT MAX(rowid) as max from '.MAIN_DB_PREFIX.
'website_page';
1234 $resql = $this->db->query($sqlgetrowid);
1236 $obj = $this->db->fetch_object($resql);
1237 $maxrowid = $obj->max;
1241 $runsql =
run_sql($sqlfile, 1,
'', 0,
'',
'none', 0, 1, 0, 0, 1);
1243 $this->errors[] =
'Failed to load sql file '.$sqlfile.
' (ret='.((int) $runsql).
')';
1250 $fp = fopen($sqlfile,
"r");
1252 while (!feof($fp)) {
1256 $buf = fgets($fp, 65000);
1257 if (preg_match(
'/^-- Page ID (\d+)\s[^\s]+\s(\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) {
1259 $newid = ($reg[2] + $maxrowid);
1260 $aliasesarray = explode(
',', $reg[3]);
1262 dol_syslog(
"Found ID ".$oldid.
" to replace with ID ".$newid.
" and shortcut aliases to create: ".$reg[3]);
1264 dol_move($conf->website->dir_output.
'/'.$object->ref.
'/page'.$oldid.
'.tpl.php', $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php', 0, 1, 0, 0);
1266 $objectpagestatic->fetch($newid);
1269 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1272 $this->errors[] =
'Failed to write file '.basename($filetpl);
1277 if (is_array($aliasesarray)) {
1278 foreach ($aliasesarray as $aliasshortcuttocreate) {
1279 if (trim($aliasshortcuttocreate)) {
1280 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1283 $this->errors[] =
'Failed to write file '.basename($filealias);
1295 $sql =
"SELECT fk_default_home FROM ".MAIN_DB_PREFIX.
"website WHERE rowid = ".((int) $object->id);
1296 $resql = $this->db->query(
$sql);
1298 $obj = $this->db->fetch_object($resql);
1300 $object->fk_default_home = $obj->fk_default_home;
1308 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1309 dolSaveIndexPage($pathofwebsite, $pathofwebsite.
'/index.php', $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php', $pathofwebsite.
'/wrapper.php', $object);
1312 $this->db->rollback();
1315 $this->db->commit();
1333 if (empty($object->ref)) {
1334 $this->error =
'Function rebuildWebSiteFiles called on object not loaded (object->ref is empty)';
1340 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"website_page WHERE fk_website = ".((int) $this->
id);
1342 $resql = $this->db->query(
$sql);
1344 $this->error = $this->db->lasterror();
1348 $num = $this->db->num_rows($resql);
1353 $obj = $this->db->fetch_object($resql);
1355 $newid = $obj->rowid;
1357 $objectpagestatic->fetch($newid);
1359 $aliasesarray = explode(
',', $objectpagestatic->aliasalt);
1361 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1364 $this->errors[] =
'Failed to write file '.basename($filetpl);
1369 if (!empty($objectpagestatic->pageurl) && !in_array($objectpagestatic->pageurl, $aliasesarray)) {
1370 $aliasesarray[] = $objectpagestatic->pageurl;
1374 if (is_array($aliasesarray)) {
1375 foreach ($aliasesarray as $aliasshortcuttocreate) {
1376 if (trim($aliasshortcuttocreate)) {
1377 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1380 $this->errors[] =
'Failed to write file '.basename($filealias);
1392 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1393 $fileindex = $pathofwebsite.
'/index.php';
1395 if ($object->fk_default_home > 0) {
1396 $filetpl = $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php';
1398 $filewrapper = $pathofwebsite.
'/wrapper.php';
1399 dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object);
1416 return (empty($this->otherlang) ?
false :
true);
1430 global $websitepagefile, $website;
1432 if (!is_object($weblangs)) {
1433 return 'ERROR componentSelectLang called with parameter $weblangs not defined';
1436 $arrayofspecialmainlanguages = array(
1467 if (!empty($websitepagefile)) {
1468 $websitepagefileshort = basename($websitepagefile);
1469 if ($websitepagefileshort ==
'index.php') {
1470 $pageid = $website->fk_default_home;
1472 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), $websitepagefileshort);
1475 $tmppage->fetch($pageid);
1480 if (!is_array($languagecodes) && $pageid > 0) {
1481 $languagecodes = array();
1483 $sql =
"SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
1484 $sql .=
" FROM ".MAIN_DB_PREFIX.
"website_page as wp";
1485 $sql .=
" WHERE wp.fk_website = ".((int) $website->id);
1486 $sql .=
" AND (wp.fk_page = ".((int) $pageid).
" OR wp.rowid = ".((int) $pageid);
1487 if ($tmppage->fk_page > 0) {
1488 $sql .=
" OR wp.fk_page = ".((int) $tmppage->fk_page).
" OR wp.rowid = ".((int) $tmppage->fk_page);
1492 $resql = $this->db->query(
$sql);
1494 while ($obj = $this->db->fetch_object($resql)) {
1495 $newlang = $obj->lang;
1496 if ($obj->rowid == $pageid) {
1497 $newlang = $obj->lang;
1499 if (!in_array($newlang, $languagecodes)) {
1500 $languagecodes[] = $newlang;
1507 $languagecodeselected = substr($weblangs->defaultlang, 0, 2);
1508 if (!empty($websitepagefile)) {
1509 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), basename($websitepagefile));
1511 $pagelang = substr($tmppage->lang, 0, 2);
1512 $languagecodeselected = substr($pagelang, 0, 2);
1513 if (!in_array($pagelang, $languagecodes)) {
1514 $languagecodes[] = $pagelang;
1519 $weblangs->load(
'languages');
1522 $url = $_SERVER[
"REQUEST_URI"];
1523 $url = preg_replace(
'/(\?|&)l=([a-zA-Z_]*)/',
'', $url);
1525 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'l=';
1526 if (!preg_match(
'/^\//', $url)) {
1531 $MAXHEIGHT = 4 * $HEIGHTOPTION;
1532 $nboflanguage = count($languagecodes);
1534 $out =
'<!-- componentSelectLang'.$htmlname.
' -->'.
"\n";
1537 $out .=
'.componentSelectLang'.$htmlname.
':hover { height: '.min($MAXHEIGHT, ($HEIGHTOPTION * $nboflanguage)).
'px; overflow-x: hidden; overflow-y: '.((($HEIGHTOPTION * $nboflanguage) > $MAXHEIGHT) ?
' scroll' :
'hidden').
'; }'.
"\n";
1538 $out .=
'.componentSelectLang'.$htmlname.
' li { line-height: '.$HEIGHTOPTION.
'px; }'.
"\n";
1539 $out .=
'.componentSelectLang'.$htmlname.
' {
1540 display: inline-block;
1542 height: '.$HEIGHTOPTION.
'px;
1544 transition: all .3s ease;
1546 vertical-align: top;
1548 .componentSelectLang'.$htmlname.
':hover, .componentSelectLang'.$htmlname.
':hover a { background-color: #fff; color: #000 !important; }
1549 ul.componentSelectLang'.$htmlname.
' { width: 150px; }
1550 ul.componentSelectLang'.$htmlname.
':hover .fa { visibility: hidden; }
1551 .componentSelectLang'.$htmlname.
' a { text-decoration: none; width: 100%; }
1552 .componentSelectLang'.$htmlname.
' li { display: block; padding: 0px 15px; margin-left: 0; margin-right: 0; }
1553 .componentSelectLang'.$htmlname.
' li:hover { background-color: #EEE; }
1556 $out .=
'<ul class="componentSelectLang'.$htmlname.($morecss ?
' '.$morecss :
'').
'">';
1558 if ($languagecodeselected) {
1560 if (strlen($languagecodeselected) == 2) {
1561 $languagecodeselected = (empty($arrayofspecialmainlanguages[$languagecodeselected]) ? $languagecodeselected.
'_'.strtoupper($languagecodeselected) : $arrayofspecialmainlanguages[$languagecodeselected]);
1564 $countrycode = strtolower(substr($languagecodeselected, -2));
1565 $label = $weblangs->trans(
"Language_".$languagecodeselected);
1566 if ($countrycode ==
'us') {
1567 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1569 $out .=
'<li><a href="'.$url.substr($languagecodeselected, 0, 2).
'"><img height="12px" src="/medias/image/common/flags/'.$countrycode.
'.png" style="margin-right: 5px;"/><span class="websitecomponentlilang">'.$label.
'</span>';
1570 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1571 $out .=
'</a></li>';
1574 if (is_array($languagecodes)) {
1575 foreach ($languagecodes as $languagecode) {
1577 if (strlen($languagecode) == 2) {
1578 $languagecode = (empty($arrayofspecialmainlanguages[$languagecode]) ? $languagecode.
'_'.strtoupper($languagecode) : $arrayofspecialmainlanguages[$languagecode]);
1581 if ($languagecode == $languagecodeselected) {
1585 $countrycode = strtolower(substr($languagecode, -2));
1586 $label = $weblangs->trans(
"Language_".$languagecode);
1587 if ($countrycode ==
'us') {
1588 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1590 $out .=
'<li><a href="'.$url.substr($languagecode, 0, 2).
'"><img height="12px" src="/medias/image/common/flags/'.$countrycode.
'.png" style="margin-right: 5px;"/><span class="websitecomponentlilang">'.$label.
'</span>';
1591 if (empty($i) && empty($languagecodeselected)) {
1592 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1594 $out .=
'</a></li>';
run_sql($sqlfile, $silent=1, $entity=0, $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0, $colspan=0, $onlysqltoimportwebsite=0, $database='')
Launch a sql file.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
Class to manage Dolibarr database access.
Class to manage Dolibarr users.
fetchLines()
Load object lines in memory from the database.
update(User $user, $notrigger=false)
Update object into database.
isMultiLang()
Return if web site is a multilanguage web site.
rebuildWebSiteFiles()
Rebuild all files of all the pages/containers of a website.
exportWebSite()
Generate a zip with all data of web site.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
componentSelectLang($languagecodes, $weblangs, $morecss='', $htmlname='')
Component to select language inside a container (Full CSS Only)
createFromClone($user, $fromid, $newref, $newlang='')
Load a website its id and create a new one in database.
__construct(DoliDB $db)
Constructor.
getLibStatut($mode=0)
Return the label of the status.
LibStatut($status, $mode=0)
Return the label of a given status.
getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
Return a link to the user card (with optionally the picto) Use this->id,this->lastname,...
fetch($id, $ref=null)
Load object in memory from the database.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load all object in memory ($this->records) from the database.
importWebSite($pathtofile)
Open a zip with all data of web site and load it into database.
create(User $user, $notrigger=false)
Create object into database.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0, $indexdatabase=1, $nolog=0)
Remove a directory $dir and its subdirectories (or only files and subdirectories)
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_uncompress($inputfile, $outputdir)
Uncompress a file.
dol_is_file($pathoffile)
Return if path is a file.
dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0, $indexdatabase=0, $arrayreplacementisregex=0)
Make replacement of strings into a file.
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement=null, $excludesubdir=0, $excludefileext=null)
Copy a dir to another dir.
dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvirus=0, $indexdatabase=1)
Move a file into another name.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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.
dol_now($mode='auto')
Return date for now.
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_sanitizePathName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a path name.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
div float
Buy price without taxes.
dolSaveMasterFile($filemaster)
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).
dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, $backupold=0)
Save content of a page on disk (page name is generally ID_of_page.php).