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;
106 public $fk_default_home;
111 public $fk_user_creat;
121 public $use_manifest;
136 const STATUS_DRAFT = 0;
137 const STATUS_VALIDATED = 1;
161 global $conf, $langs;
169 if (isset($this->entity)) {
170 $this->entity = (int) $this->entity;
172 if (isset($this->
ref)) {
173 $this->
ref = trim($this->
ref);
178 if (isset($this->status)) {
179 $this->status = (int) $this->status;
181 if (empty($this->date_creation)) {
182 $this->date_creation = $now;
184 if (empty($this->date_modification)) {
185 $this->date_modification = $now;
188 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
189 $tmparray = explode(
',', $this->otherlang);
190 if (is_array($tmparray)) {
191 foreach ($tmparray as $key => $val) {
193 if (empty(trim($val))) {
194 unset($tmparray[$key]);
197 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
199 $this->otherlang = join(
',', $tmparray);
203 if (empty($this->entity)) {
204 $this->entity = $conf->entity;
206 if (empty($this->lang)) {
207 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
212 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.
'(';
215 $sql .=
'description,';
217 $sql .=
'otherlang,';
219 $sql .=
'fk_default_home,';
220 $sql .=
'virtualhost,';
221 $sql .=
'fk_user_creat,';
222 $sql .=
'date_creation,';
225 $sql .=
') VALUES (';
226 $sql .=
' '.((empty($this->entity) && $this->entity !=
'0') ?
'NULL' : $this->entity).
',';
227 $sql .=
' '.(!isset($this->
ref) ?
'NULL' :
"'".$this->db->escape($this->
ref).
"'").
',';
229 $sql .=
' '.(!isset($this->lang) ?
'NULL' :
"'".$this->db->escape($this->lang).
"'").
',';
230 $sql .=
' '.(!isset($this->otherlang) ?
'NULL' :
"'".$this->db->escape($this->otherlang).
"'").
',';
231 $sql .=
' '.(!isset($this->status) ?
'1' : $this->status).
',';
232 $sql .=
' '.(!isset($this->fk_default_home) ?
'NULL' : $this->fk_default_home).
',';
233 $sql .=
' '.(!isset($this->virtualhost) ?
'NULL' :
"'".$this->db->escape($this->virtualhost).
"'").
",";
234 $sql .=
' '.(!isset($this->fk_user_creat) ? $user->id : $this->fk_user_creat).
',';
235 $sql .=
' '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_creation).
"'").
",";
236 $sql .=
' '.((int) $this->position).
",";
237 $sql .=
' '.(!isset($this->date_modification) ||
dol_strlen($this->date_modification) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_modification).
"'");
245 $this->errors[] =
'Error '.$this->db->lasterror();
246 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
250 $this->
id = $this->
db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
253 $tmplangarray = explode(
',', $this->otherlang);
254 if (is_array($tmplangarray)) {
255 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
256 foreach ($tmplangarray as $val) {
257 if (trim($val) == $this->lang) {
260 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
276 $stringtodolibarrfile =
"# Some properties for Dolibarr web site CMS\n";
277 $stringtodolibarrfile .=
"param=value\n";
279 file_put_contents($conf->website->dir_output.
'/'.$this->ref.
'/.dolibarr', $stringtodolibarrfile);
284 $this->
db->rollback();
285 if ($this->
db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
304 public function fetch($id, $ref =
null)
310 $sql .=
" t.entity,";
312 $sql .=
" t.position,";
313 $sql .=
" t.description,";
315 $sql .=
" t.otherlang,";
316 $sql .=
" t.status,";
317 $sql .=
" t.fk_default_home,";
318 $sql .=
" t.use_manifest,";
319 $sql .=
" t.virtualhost,";
320 $sql .=
" t.fk_user_creat,";
321 $sql .=
" t.fk_user_modif,";
322 $sql .=
" t.date_creation,";
323 $sql .=
" t.tms as date_modification";
324 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
325 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
327 $sql .=
" AND t.ref = '".$this->db->escape($ref).
"'";
329 $sql .=
" AND t.rowid = ".(int) $id;
334 $numrows = $this->
db->num_rows(
$resql);
336 $obj = $this->
db->fetch_object(
$resql);
338 $this->
id = $obj->rowid;
340 $this->entity = $obj->entity;
341 $this->
ref = $obj->ref;
342 $this->position = $obj->position;
344 $this->lang = $obj->lang;
345 $this->otherlang = $obj->otherlang;
346 $this->status = $obj->status;
347 $this->fk_default_home = $obj->fk_default_home;
348 $this->virtualhost = $obj->virtualhost;
349 $this->use_manifest = $obj->use_manifest;
350 $this->fk_user_creat = $obj->fk_user_creat;
351 $this->fk_user_modif = $obj->fk_user_modif;
352 $this->date_creation = $this->
db->jdate($obj->date_creation);
353 $this->date_modification = $this->
db->jdate($obj->date_modification);
368 $this->errors[] =
'Error '.$this->db->lasterror();
369 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
382 $this->lines = array();
386 return count($this->lines) ? 1 : 0;
402 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
408 $sql .=
" t.entity,";
410 $sql .=
" t.description,";
412 $sql .=
" t.otherlang,";
413 $sql .=
" t.status,";
414 $sql .=
" t.fk_default_home,";
415 $sql .=
" t.virtualhost,";
416 $sql .=
" t.fk_user_creat,";
417 $sql .=
" t.fk_user_modif,";
418 $sql .=
" t.date_creation,";
419 $sql .=
" t.tms as date_modification";
420 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
421 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
424 if (count($filter) > 0) {
425 foreach ($filter as $key => $value) {
426 $sqlwhere[] = $key.
" LIKE '%".$this->
db->escape($value).
"%'";
429 if (count($sqlwhere) > 0) {
430 $sql .=
' AND '.implode(
' '.$this->
db->escape($filtermode).
' ', $sqlwhere);
433 if (!empty($sortfield)) {
434 $sql .= $this->
db->order($sortfield, $sortorder);
436 if (!empty($limit)) {
437 $sql .= $this->
db->plimit($limit, $offset);
439 $this->records = array();
445 while ($obj = $this->
db->fetch_object(
$resql)) {
446 $line =
new self($this->db);
448 $line->id = $obj->rowid;
450 $line->entity = $obj->entity;
451 $line->ref = $obj->ref;
452 $line->description = $obj->description;
453 $line->lang = $obj->lang;
454 $line->otherlang = $obj->otherlang;
455 $line->status = $obj->status;
456 $line->fk_default_home = $obj->fk_default_home;
457 $line->virtualhost = $obj->virtualhost;
458 $this->fk_user_creat = $obj->fk_user_creat;
459 $this->fk_user_modif = $obj->fk_user_modif;
460 $line->date_creation = $this->
db->jdate($obj->date_creation);
461 $line->date_modification = $this->
db->jdate($obj->date_modification);
463 $this->records[$line->id] = $line;
469 $this->errors[] =
'Error '.$this->db->lasterror();
470 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
486 global $conf, $langs;
494 if (isset($this->entity)) {
495 $this->entity = (int) $this->entity;
497 if (isset($this->
ref)) {
498 $this->
ref = trim($this->
ref);
503 if (isset($this->status)) {
504 $this->status = (int) $this->status;
508 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
509 $tmparray = explode(
',', $this->otherlang);
510 if (is_array($tmparray)) {
511 foreach ($tmparray as $key => $val) {
513 if (empty(trim($val))) {
514 unset($tmparray[$key]);
517 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
519 $this->otherlang = join(
',', $tmparray);
521 if (empty($this->lang)) {
522 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
530 $sql =
'UPDATE '.MAIN_DB_PREFIX.$this->table_element.
' SET';
531 $sql .=
' entity = '.(isset($this->entity) ? $this->entity :
"null").
',';
532 $sql .=
' ref = '.(isset($this->
ref) ?
"'".$this->db->escape($this->
ref).
"'" :
"null").
',';
533 $sql .=
' description = '.(isset($this->
description) ?
"'".$this->db->escape($this->
description).
"'" :
"null").
',';
534 $sql .=
' lang = '.(isset($this->lang) ?
"'".$this->db->escape($this->lang).
"'" :
"null").
',';
535 $sql .=
' otherlang = '.(isset($this->otherlang) ?
"'".$this->db->escape($this->otherlang).
"'" :
"null").
',';
536 $sql .=
' status = '.(isset($this->status) ? $this->status :
"null").
',';
537 $sql .=
' fk_default_home = '.(($this->fk_default_home > 0) ? $this->fk_default_home :
"null").
',';
538 $sql .=
' use_manifest = '.((int) $this->use_manifest).
',';
539 $sql .=
' virtualhost = '.(($this->virtualhost !=
'') ?
"'".$this->
db->escape($this->virtualhost).
"'" :
"null").
',';
540 $sql .=
' fk_user_modif = '.(!isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).
',';
541 $sql .=
' date_creation = '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) != 0 ?
"'".$this->db->idate($this->date_creation).
"'" :
'null').
',';
542 $sql .=
' tms = '.(dol_strlen($this->date_modification) != 0 ?
"'".$this->db->idate($this->date_modification).
"'" :
"'".$this->db->idate(
dol_now()).
"'");
543 $sql .=
' WHERE rowid='.((int) $this->
id);
550 $this->errors[] =
'Error '.$this->db->lasterror();
551 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
554 if (!$error && !$notrigger) {
559 $tmplangarray = explode(
',', $this->otherlang);
560 if (is_array($tmplangarray)) {
561 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
562 foreach ($tmplangarray as $val) {
563 if (trim($val) == $this->lang) {
566 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
578 $this->
db->rollback();
596 public function delete(
User $user, $notrigger =
false)
607 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'website_page';
608 $sql .=
' WHERE fk_website = '.((int) $this->
id);
613 $this->errors[] =
'Error '.$this->db->lasterror();
614 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
624 if (!$error && !empty($this->
ref)) {
625 $pathofwebsite = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$this->
ref;
632 $this->
db->rollback();
654 global $conf, $langs;
655 global $dolibarr_main_data_root;
664 if (empty($newref)) {
665 $this->error =
'ErrorBadParameter';
669 $object =
new self($this->db);
672 if ($object->fetch(0, $newref) > 0) {
673 $this->error =
'ErrorNewRefIsAlreadyUsed';
680 $object->fetch($fromid);
682 $oldidforhome = $object->fk_default_home;
683 $oldref = $object->ref;
685 $pathofwebsiteold = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($oldref);
686 $pathofwebsitenew = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($newref);
689 $fileindex = $pathofwebsitenew.
'/index.php';
693 unset($object->fk_user_creat);
694 unset($object->import_key);
697 $object->ref = $newref;
698 $object->fk_default_home = 0;
699 $object->virtualhost =
'';
700 $object->date_creation = $now;
701 $object->fk_user_creat = $user->id;
702 $object->position = ((int) $object->position) + 1;
703 $object->status = self::STATUS_DRAFT;
704 if (empty($object->lang)) {
705 $object->lang = substr($langs->defaultlang, 0, 2);
709 $object->context[
'createfromclone'] =
'createfromclone';
710 $result = $object->create($user);
713 $this->error = $object->error;
714 $this->errors = $object->errors;
715 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
719 dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0,
null, 2);
722 $pathtomedias = DOL_DATA_ROOT.
'/medias';
723 $pathtomediasinwebsite = $pathofwebsitenew.
'/medias';
725 dol_syslog(
"Create symlink for ".$pathtomedias.
" into name ".$pathtomediasinwebsite);
726 dol_mkdir(dirname($pathtomediasinwebsite));
727 $result = symlink($pathtomedias, $pathtomediasinwebsite);
731 $pathofmediasjsold = DOL_DATA_ROOT.
'/medias/js/'.$oldref;
732 $pathofmediasjsnew = DOL_DATA_ROOT.
'/medias/js/'.$newref;
733 dolCopyDir($pathofmediasjsold, $pathofmediasjsnew, $conf->global->MAIN_UMASK, 0);
735 $pathofmediasimageold = DOL_DATA_ROOT.
'/medias/image/'.$oldref;
736 $pathofmediasimagenew = DOL_DATA_ROOT.
'/medias/image/'.$newref;
737 dolCopyDir($pathofmediasimageold, $pathofmediasimagenew, $conf->global->MAIN_UMASK, 0);
743 $listofpages = $objectpages->fetchAll($fromid);
744 foreach ($listofpages as $pageid => $objectpageold) {
746 $filetplold = $pathofwebsitenew.
'/page'.$pageid.
'.tpl.php';
750 $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl,
'', 0, $object->id, 1);
753 if (is_object($objectpagenew) && $objectpagenew->pageurl) {
754 $filealias = $pathofwebsitenew.
'/'.$objectpagenew->pageurl.
'.php';
755 $filetplnew = $pathofwebsitenew.
'/page'.$objectpagenew->id.
'.tpl.php';
768 if ($pageid == $oldidforhome) {
769 $newidforhome = $objectpagenew->id;
780 $object->fk_default_home = $newidforhome;
781 $res = $object->update($user);
788 $filetpl = $pathofwebsitenew.
'/page'.$newidforhome.
'.tpl.php';
789 $filewrapper = $pathofwebsitenew.
'/wrapper.php';
793 $result =
dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl, $filewrapper, $object);
797 unset($object->context[
'createfromclone']);
805 $this->
db->rollback();
822 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
824 global $langs, $conf, $db;
825 global $dolibarr_main_authentication, $dolibarr_main_demo;
832 $label =
'<u>'.$langs->trans(
"WebSite").
'</u>';
834 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
835 $label .=
'<b>'.$langs->trans(
'MainLanguage').
':</b> '.$this->lang;
837 $linkstart =
'<a href="'.DOL_URL_ROOT.
'/website/card.php?id='.$this->
id.
'"';
838 $linkstart .= ($notooltip ?
'' :
' title="'.dol_escape_htmltag($label, 1).
'" class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"');
842 $linkstart = $linkend =
'';
845 $result .= ($linkstart.img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ?
'' :
'class="classfortooltip"')).$linkend);
846 if ($withpicto != 2) {
850 $result .= $linkstart.$this->ref.$linkend;
862 return $this->
LibStatut($this->status, $mode);
878 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
881 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
882 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
883 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
884 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
887 $statusType =
'status5';
888 if ($status == self::STATUS_VALIDATED) {
889 $statusType =
'status4';
892 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
909 $this->
ref =
'myspecimenwebsite';
912 $this->otherlang =
'fr,es';
914 $this->fk_default_home =
null;
915 $this->virtualhost =
'http://myvirtualhost';
916 $this->fk_user_creat = $user->id;
917 $this->fk_user_modif = $user->id;
918 $this->date_creation =
dol_now();
930 global $conf, $mysoc;
934 if (empty($website->id) || empty($website->ref)) {
939 dol_syslog(
"Create temp dir ".$conf->website->dir_temp);
941 if (!is_writable($conf->website->dir_temp)) {
942 setEventMessages(
"Temporary dir ".$conf->website->dir_temp.
" is not writable",
null,
'errors');
946 $destdir = $conf->website->dir_temp.
'/'.$website->ref;
949 $count = 0; $countreallydeleted = 0;
951 if ($counttodelete != $countreallydeleted) {
952 setEventMessages(
"Failed to clean temp directory ".$destdir,
null,
'errors');
956 $arrayreplacementinfilename = array();
957 $arrayreplacementincss = array();
958 $arrayreplacementincss[
'file=image/'.$website->ref.
'/'] =
"file=image/__WEBSITE_KEY__/";
959 $arrayreplacementincss[
'file=js/'.$website->ref.
'/'] =
"file=js/__WEBSITE_KEY__/";
960 $arrayreplacementincss[
'medias/image/'.$website->ref.
'/'] =
"medias/image/__WEBSITE_KEY__/";
961 $arrayreplacementincss[
'medias/js/'.$website->ref.
'/'] =
"medias/js/__WEBSITE_KEY__/";
962 if ($mysoc->logo_small) {
963 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_small] =
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__";
965 if ($mysoc->logo_mini) {
966 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini] =
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__";
969 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo] =
"file=logos%2Fthumbs%2F__LOGO_KEY__";
974 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/containers');
975 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey');
976 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey');
979 $srcdir = $conf->website->dir_output.
'/'.$website->ref;
980 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers';
982 dol_syslog(
"Copy pages from ".$srcdir.
" into ".$destdir);
983 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array(
'old',
'back'));
986 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md')) {
987 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md', $conf->website->dir_temp.
'/'.$website->ref.
'/README.md');
989 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE')) {
990 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE', $conf->website->dir_temp.
'/'.$website->ref.
'/LICENSE');
994 $srcdir = DOL_DATA_ROOT.
'/medias/image/'.$website->ref;
995 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey';
997 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
998 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1001 $srcdir = DOL_DATA_ROOT.
'/medias/js/'.$website->ref;
1002 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey';
1004 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1005 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1008 $cssindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/styles.css.php';
1013 $htmldeaderindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/htmlheader.html';
1019 $filesql = $conf->website->dir_temp.
'/'.$website->ref.
'/website_pages.sql';
1020 $fp = fopen($filesql,
"w");
1027 $listofpages = $objectpages->fetchAll($website->id);
1031 foreach ($listofpages as $pageid => $objectpageold) {
1032 $objectpageold->newid = $i;
1036 foreach ($listofpages as $pageid => $objectpageold) {
1039 foreach ($listofpages as $pageid2 => $objectpageold2) {
1040 if ($pageid2 == $objectpageold->fk_page) {
1041 $newfk_page = $objectpageold2->newid;
1045 $objectpageold->newfk_page = $newfk_page;
1048 foreach ($listofpages as $pageid => $objectpageold) {
1049 $allaliases = $objectpageold->pageurl;
1050 $allaliases .= ($objectpageold->aliasalt ?
','.$objectpageold->aliasalt :
'');
1052 $line =
'-- File generated by Dolibarr '.DOL_VERSION.
' -- '.
dol_print_date(
dol_now(
'gmt'),
'standard',
'gmt').
' UTC --;';
1055 $line .=
'-- Page ID '.$objectpageold->id.
' -> '.$objectpageold->newid.
'__+MAX_llx_website_page__ - Aliases '.$allaliases.
' --;';
1060 $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)';
1062 $line .=
" VALUES(";
1063 $line .= $objectpageold->newid.
"__+MAX_llx_website_page__, ";
1064 $line .= ($objectpageold->newfk_page ? $this->
db->escape($objectpageold->newfk_page).
"__+MAX_llx_website_page__" :
"null").
", ";
1065 $line .=
"__WEBSITE_ID__, ";
1066 $line .=
"'".$this->db->escape($objectpageold->pageurl).
"', ";
1067 $line .=
"'".$this->db->escape($objectpageold->aliasalt).
"', ";
1068 $line .=
"'".$this->db->escape($objectpageold->title).
"', ";
1069 $line .=
"'".$this->db->escape($objectpageold->description).
"', ";
1070 $line .=
"'".$this->db->escape($objectpageold->lang).
"', ";
1071 $line .=
"'".$this->db->escape($objectpageold->image).
"', ";
1072 $line .=
"'".$this->db->escape($objectpageold->keywords).
"', ";
1073 $line .=
"'".$this->db->escape($objectpageold->status).
"', ";
1074 $line .=
"'".$this->db->idate($objectpageold->date_creation).
"', ";
1075 $line .=
"'".$this->db->idate($objectpageold->date_modification).
"', ";
1076 $line .= ($objectpageold->import_key ?
"'".$this->db->escape($objectpageold->import_key).
"'" :
"null").
", ";
1077 $line .=
"'".$this->db->escape($objectpageold->grabbed_from).
"', ";
1078 $line .=
"'".$this->db->escape($objectpageold->type_container).
"', ";
1081 $stringtoexport = $objectpageold->htmlheader;
1082 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1083 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1084 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1085 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1086 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1088 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1089 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1090 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1091 $line .=
"'".$this->db->escape(str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport)).
"', ";
1094 $stringtoexport = $objectpageold->content;
1095 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1096 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1097 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1098 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1099 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1100 $stringtoexport = str_replace(
'"image/'.$website->ref.
'/',
'"image/__WEBSITE_KEY__/', $stringtoexport);
1101 $stringtoexport = str_replace(
'"/image/'.$website->ref.
'/',
'"/image/__WEBSITE_KEY__/', $stringtoexport);
1102 $stringtoexport = str_replace(
'"js/'.$website->ref.
'/',
'"js/__WEBSITE_KEY__/', $stringtoexport);
1103 $stringtoexport = str_replace(
'"/js/'.$website->ref.
'/',
'"/js/__WEBSITE_KEY__/', $stringtoexport);
1105 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1106 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1107 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1110 $line .=
"'".$this->db->escape($stringtoexport).
"', ";
1111 $line .=
"'".$this->db->escape($objectpageold->author_alias).
"', ";
1112 $line .= (int) $objectpageold->allowed_in_frames;
1120 if ($this->fk_default_home > 0 && ($objectpageold->id == $this->fk_default_home) && ($objectpageold->newid > 0)) {
1122 $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__;";
1128 $line =
"\n-- For Dolibarr v14+ --;\n";
1129 $line .=
"UPDATE llx_website SET lang = '".$this->db->escape($this->lang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1130 $line .=
"UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1135 if (!empty($conf->global->MAIN_UMASK)) {
1136 @chmod($filesql, octdec($conf->global->MAIN_UMASK));
1140 $filedir = $conf->website->dir_temp.
'/'.$website->ref.
'/.';
1141 $fileglob = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-*.zip';
1142 $filename = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-'.
dol_print_date(
dol_now(),
'dayhourlog').
'-V'.((
float) DOL_VERSION).
'.zip';
1145 $result = dol_compress_file($filedir, $filename,
'zip');
1151 $this->error = $errormsg;
1165 global $conf, $mysoc;
1172 if (empty($object->ref)) {
1173 $this->error =
'Function importWebSite called on object not loaded (object->ref is empty)';
1178 dol_mkdir($conf->website->dir_temp.
'/'.$object->ref);
1180 $filename = basename($pathtofile);
1181 if (!preg_match(
'/^website_(.*)-(.*)$/', $filename, $reg)) {
1182 $this->errors[] =
'Bad format for filename '.$filename.
'. Must be website_XXX-VERSION.';
1186 $result =
dol_uncompress($pathtofile, $conf->website->dir_temp.
'/'.$object->ref);
1188 if (!empty($result[
'error'])) {
1189 $this->errors[] =
'Failed to unzip file '.$pathtofile.
'.';
1193 $arrayreplacement = array();
1194 $arrayreplacement[
'__WEBSITE_ID__'] = $object->id;
1195 $arrayreplacement[
'__WEBSITE_KEY__'] = $object->ref;
1196 $arrayreplacement[
'__N__'] = $this->
db->escape(
"\n");
1197 $arrayreplacement[
'__LOGO_SMALL_KEY__'] = $this->
db->escape($mysoc->logo_small);
1198 $arrayreplacement[
'__LOGO_MINI_KEY__'] = $this->
db->escape($mysoc->logo_mini);
1199 $arrayreplacement[
'__LOGO_KEY__'] = $this->
db->escape($mysoc->logo);
1202 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/containers', $conf->website->dir_output.
'/'.$object->ref, 0, 1);
1205 $cssindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/styles.css.php';
1208 $htmldeaderindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/htmlheader.html';
1212 $filemaster = $conf->website->dir_output.
'/'.$object->ref.
'/master.inc.php';
1215 $this->errors[] =
'Failed to write file '.$filemaster;
1219 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/image/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/image/'.$object->ref, 0, 1);
1220 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/js/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/js/'.$object->ref, 0, 1);
1222 $sqlfile = $conf->website->dir_temp.
"/".$object->ref.
'/website_pages.sql';
1229 $sqlgetrowid =
'SELECT MAX(rowid) as max from '.MAIN_DB_PREFIX.
'website_page';
1230 $resql = $this->
db->query($sqlgetrowid);
1232 $obj = $this->
db->fetch_object(
$resql);
1233 $maxrowid = $obj->max;
1237 $runsql =
run_sql($sqlfile, 1,
'', 0,
'',
'none', 0, 1, 0, 0, 1);
1239 $this->errors[] =
'Failed to load sql file '.$sqlfile.
' (ret='.((int) $runsql).
')';
1246 $fp = fopen($sqlfile,
"r");
1248 while (!feof($fp)) {
1252 $buf = fgets($fp, 65000);
1253 if (preg_match(
'/^-- Page ID (\d+)\s[^\s]+\s(\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) {
1255 $newid = ($reg[2] + $maxrowid);
1256 $aliasesarray = explode(
',', $reg[3]);
1258 dol_syslog(
"Found ID ".$oldid.
" to replace with ID ".$newid.
" and shortcut aliases to create: ".$reg[3]);
1260 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);
1262 $objectpagestatic->fetch($newid);
1265 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1268 $this->errors[] =
'Failed to write file '.basename($filetpl);
1273 if (is_array($aliasesarray)) {
1274 foreach ($aliasesarray as $aliasshortcuttocreate) {
1275 if (trim($aliasshortcuttocreate)) {
1276 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1279 $this->errors[] =
'Failed to write file '.basename($filealias);
1291 $sql =
"SELECT fk_default_home FROM ".MAIN_DB_PREFIX.
"website WHERE rowid = ".((int) $object->id);
1294 $obj = $this->
db->fetch_object(
$resql);
1296 $object->fk_default_home = $obj->fk_default_home;
1304 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1305 dolSaveIndexPage($pathofwebsite, $pathofwebsite.
'/index.php', $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php', $pathofwebsite.
'/wrapper.php', $object);
1308 $this->
db->rollback();
1311 $this->
db->commit();
1329 if (empty($object->ref)) {
1330 $this->error =
'Function rebuildWebSiteFiles called on object not loaded (object->ref is empty)';
1336 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"website_page WHERE fk_website = ".((int) $this->
id);
1340 $this->error = $this->
db->lasterror();
1344 $num = $this->
db->num_rows(
$resql);
1349 $obj = $this->
db->fetch_object(
$resql);
1351 $newid = $obj->rowid;
1353 $objectpagestatic->fetch($newid);
1355 $aliasesarray = explode(
',', $objectpagestatic->aliasalt);
1357 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1360 $this->errors[] =
'Failed to write file '.basename($filetpl);
1365 if (!empty($objectpagestatic->pageurl) && !in_array($objectpagestatic->pageurl, $aliasesarray)) {
1366 $aliasesarray[] = $objectpagestatic->pageurl;
1370 if (is_array($aliasesarray)) {
1371 foreach ($aliasesarray as $aliasshortcuttocreate) {
1372 if (trim($aliasshortcuttocreate)) {
1373 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1376 $this->errors[] =
'Failed to write file '.basename($filealias);
1388 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1389 $fileindex = $pathofwebsite.
'/index.php';
1391 if ($object->fk_default_home > 0) {
1392 $filetpl = $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php';
1394 $filewrapper = $pathofwebsite.
'/wrapper.php';
1395 dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object);
1412 return (empty($this->otherlang) ?
false :
true);
1426 global $websitepagefile, $website;
1428 if (!is_object($weblangs)) {
1429 return 'ERROR componentSelectLang called with parameter $weblangs not defined';
1432 $arrayofspecialmainlanguages = array(
1463 if (!empty($websitepagefile)) {
1464 $websitepagefileshort = basename($websitepagefile);
1465 if ($websitepagefileshort ==
'index.php') {
1466 $pageid = $website->fk_default_home;
1468 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), $websitepagefileshort);
1471 $tmppage->fetch($pageid);
1476 if (!is_array($languagecodes) && $pageid > 0) {
1477 $languagecodes = array();
1479 $sql =
"SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
1480 $sql .=
" FROM ".MAIN_DB_PREFIX.
"website_page as wp";
1481 $sql .=
" WHERE wp.fk_website = ".((int) $website->id);
1482 $sql .=
" AND (wp.fk_page = ".((int) $pageid).
" OR wp.rowid = ".((int) $pageid);
1483 if ($tmppage->fk_page > 0) {
1484 $sql .=
" OR wp.fk_page = ".((int) $tmppage->fk_page).
" OR wp.rowid = ".((int) $tmppage->fk_page);
1490 while ($obj = $this->
db->fetch_object(
$resql)) {
1491 $newlang = $obj->lang;
1492 if ($obj->rowid == $pageid) {
1493 $newlang = $obj->lang;
1495 if (!in_array($newlang, $languagecodes)) {
1496 $languagecodes[] = $newlang;
1503 $languagecodeselected = substr($weblangs->defaultlang, 0, 2);
1504 if (!empty($websitepagefile)) {
1505 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), basename($websitepagefile));
1507 $pagelang = substr($tmppage->lang, 0, 2);
1508 $languagecodeselected = substr($pagelang, 0, 2);
1509 if (!in_array($pagelang, $languagecodes)) {
1510 $languagecodes[] = $pagelang;
1515 $weblangs->load(
'languages');
1518 $url = $_SERVER[
"REQUEST_URI"];
1519 $url = preg_replace(
'/(\?|&)l=([a-zA-Z_]*)/',
'', $url);
1521 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'l=';
1522 if (!preg_match(
'/^\//', $url)) {
1527 $MAXHEIGHT = 4 * $HEIGHTOPTION;
1528 $nboflanguage = count($languagecodes);
1530 $out =
'<!-- componentSelectLang'.$htmlname.
' -->'.
"\n";
1533 $out .=
'.componentSelectLang'.$htmlname.
':hover { height: '.min($MAXHEIGHT, ($HEIGHTOPTION * $nboflanguage)).
'px; overflow-x: hidden; overflow-y: '.((($HEIGHTOPTION * $nboflanguage) > $MAXHEIGHT) ?
' scroll' :
'hidden').
'; }'.
"\n";
1534 $out .=
'.componentSelectLang'.$htmlname.
' li { line-height: '.$HEIGHTOPTION.
'px; }'.
"\n";
1535 $out .=
'.componentSelectLang'.$htmlname.
' {
1536 display: inline-block;
1538 height: '.$HEIGHTOPTION.
'px;
1540 transition: all .3s ease;
1542 vertical-align: top;
1544 .componentSelectLang'.$htmlname.
':hover, .componentSelectLang'.$htmlname.
':hover a { background-color: #fff; color: #000 !important; }
1545 ul.componentSelectLang'.$htmlname.
' { width: 150px; }
1546 ul.componentSelectLang'.$htmlname.
':hover .fa { visibility: hidden; }
1547 .componentSelectLang'.$htmlname.
' a { text-decoration: none; width: 100%; }
1548 .componentSelectLang'.$htmlname.
' li { display: block; padding: 0px 15px; margin-left: 0; margin-right: 0; }
1549 .componentSelectLang'.$htmlname.
' li:hover { background-color: #EEE; }
1552 $out .=
'<ul class="componentSelectLang'.$htmlname.($morecss ?
' '.$morecss :
'').
'">';
1554 if ($languagecodeselected) {
1556 if (strlen($languagecodeselected) == 2) {
1557 $languagecodeselected = (empty($arrayofspecialmainlanguages[$languagecodeselected]) ? $languagecodeselected.
'_'.strtoupper($languagecodeselected) : $arrayofspecialmainlanguages[$languagecodeselected]);
1560 $countrycode = strtolower(substr($languagecodeselected, -2));
1561 $label = $weblangs->trans(
"Language_".$languagecodeselected);
1562 if ($countrycode ==
'us') {
1563 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1565 $out .=
'<a href="'.$url.substr($languagecodeselected, 0, 2).
'"><li><img height="12px" src="/medias/image/common/flags/'.$countrycode.
'.png" style="margin-right: 5px;"/><span class="websitecomponentlilang">'.$label.
'</span>';
1566 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1567 $out .=
'</li></a>';
1570 if (is_array($languagecodes)) {
1571 foreach ($languagecodes as $languagecode) {
1573 if (strlen($languagecode) == 2) {
1574 $languagecode = (empty($arrayofspecialmainlanguages[$languagecode]) ? $languagecode.
'_'.strtoupper($languagecode) : $arrayofspecialmainlanguages[$languagecode]);
1577 if ($languagecode == $languagecodeselected) {
1581 $countrycode = strtolower(substr($languagecode, -2));
1582 $label = $weblangs->trans(
"Language_".$languagecode);
1583 if ($countrycode ==
'us') {
1584 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1586 $out .=
'<a href="'.$url.substr($languagecode, 0, 2).
'"><li><img height="12px" src="/medias/image/common/flags/'.$countrycode.
'.png" style="margin-right: 5px;"/><span class="websitecomponentlilang">'.$label.
'</span>';
1587 if (empty($i) && empty($languagecodeselected)) {
1588 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1590 $out .=
'</li></a>';
run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0, $colspan=0, $onlysqltoimportwebsite=0)
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)
Retourne le libelle du status d'un user (actif, inactif)
LibStatut($status, $mode=0)
Renvoi le libelle d'un status donne.
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') &&!empty($user->rights->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') &&!empty($user->rights->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)) $resql
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_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another 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_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.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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).
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.
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.
$conf db
API class for accounts.
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).