29require_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).
"'").
",";
242 $sql .=
' '.((int) $this->
position).
",";
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), DOL_DATA_ROOT);
271 dol_mkdir($conf->medias->multidir_output[$conf->entity].
'/image/'.$this->ref, DOL_DATA_ROOT);
272 dol_mkdir($conf->medias->multidir_output[$conf->entity].
'/js/'.$this->ref, DOL_DATA_ROOT);
286 $stringtodolibarrfile =
"# Some properties for Dolibarr web site CMS\n";
287 $stringtodolibarrfile .=
"param=value\n";
289 file_put_contents($conf->website->dir_output.
'/'.$this->ref.
'/.dolibarr', $stringtodolibarrfile);
294 $this->db->rollback();
295 if ($this->db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
314 public function fetch($id, $ref =
null)
320 $sql .=
" t.entity,";
322 $sql .=
" t.position,";
323 $sql .=
" t.description,";
325 $sql .=
" t.otherlang,";
326 $sql .=
" t.status,";
327 $sql .=
" t.fk_default_home,";
328 $sql .=
" t.use_manifest,";
329 $sql .=
" t.virtualhost,";
330 $sql .=
" t.fk_user_creat,";
331 $sql .=
" t.fk_user_modif,";
332 $sql .=
" t.date_creation,";
333 $sql .=
" t.tms as date_modification";
334 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
335 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
337 $sql .=
" AND t.ref = '".$this->db->escape($ref).
"'";
339 $sql .=
" AND t.rowid = ".(int) $id;
342 $resql = $this->db->query($sql);
344 $numrows = $this->db->num_rows($resql);
346 $obj = $this->db->fetch_object($resql);
348 $this->
id = $obj->rowid;
350 $this->entity = $obj->entity;
351 $this->
ref = $obj->ref;
354 $this->lang = $obj->lang;
355 $this->otherlang = $obj->otherlang;
356 $this->status = $obj->status;
357 $this->fk_default_home = $obj->fk_default_home;
358 $this->virtualhost = $obj->virtualhost;
359 $this->use_manifest = $obj->use_manifest;
360 $this->fk_user_creat = $obj->fk_user_creat;
361 $this->fk_user_modif = $obj->fk_user_modif;
362 $this->date_creation = $this->db->jdate($obj->date_creation);
363 $this->date_modification = $this->db->jdate($obj->date_modification);
365 $this->db->free($resql);
378 $this->errors[] =
'Error '.$this->db->lasterror();
379 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
392 $this->lines = array();
396 return count($this->lines) ? 1 : 0;
412 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
418 $sql .=
" t.entity,";
420 $sql .=
" t.description,";
422 $sql .=
" t.otherlang,";
423 $sql .=
" t.status,";
424 $sql .=
" t.fk_default_home,";
425 $sql .=
" t.virtualhost,";
426 $sql .=
" t.fk_user_creat,";
427 $sql .=
" t.fk_user_modif,";
428 $sql .=
" t.date_creation,";
429 $sql .=
" t.tms as date_modification";
430 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
431 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
434 if (count($filter) > 0) {
435 foreach ($filter as $key => $value) {
436 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
439 if (count($sqlwhere) > 0) {
440 $sql .=
' AND '.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere);
443 if (!empty($sortfield)) {
444 $sql .= $this->db->order($sortfield, $sortorder);
446 if (!empty($limit)) {
447 $sql .= $this->db->plimit($limit, $offset);
449 $this->records = array();
451 $resql = $this->db->query($sql);
453 $num = $this->db->num_rows($resql);
455 while ($obj = $this->db->fetch_object($resql)) {
456 $line =
new self($this->db);
458 $line->id = $obj->rowid;
460 $line->entity = $obj->entity;
461 $line->ref = $obj->ref;
462 $line->description = $obj->description;
463 $line->lang = $obj->lang;
464 $line->otherlang = $obj->otherlang;
465 $line->status = $obj->status;
466 $line->fk_default_home = $obj->fk_default_home;
467 $line->virtualhost = $obj->virtualhost;
468 $this->fk_user_creat = $obj->fk_user_creat;
469 $this->fk_user_modif = $obj->fk_user_modif;
470 $line->date_creation = $this->db->jdate($obj->date_creation);
471 $line->date_modification = $this->db->jdate($obj->date_modification);
473 $this->records[$line->id] = $line;
475 $this->db->free($resql);
479 $this->errors[] =
'Error '.$this->db->lasterror();
480 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
496 global $conf, $langs;
504 if (isset($this->entity)) {
505 $this->entity = (int) $this->entity;
507 if (isset($this->
ref)) {
508 $this->
ref = trim($this->
ref);
513 if (isset($this->status)) {
514 $this->status = (int) $this->status;
518 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
519 $tmparray = explode(
',', $this->otherlang);
520 if (is_array($tmparray)) {
521 foreach ($tmparray as $key => $val) {
523 if (empty(trim($val))) {
524 unset($tmparray[$key]);
527 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
529 $this->otherlang = join(
',', $tmparray);
531 if (empty($this->lang)) {
532 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
540 $sql =
'UPDATE '.MAIN_DB_PREFIX.$this->table_element.
' SET';
541 $sql .=
' entity = '.(isset($this->entity) ? $this->entity :
"null").
',';
542 $sql .=
' ref = '.(isset($this->
ref) ?
"'".$this->db->escape($this->
ref).
"'" :
"null").
',';
543 $sql .=
' description = '.(isset($this->
description) ?
"'".$this->db->escape($this->
description).
"'" :
"null").
',';
544 $sql .=
' lang = '.(isset($this->lang) ?
"'".$this->db->escape($this->lang).
"'" :
"null").
',';
545 $sql .=
' otherlang = '.(isset($this->otherlang) ?
"'".$this->db->escape($this->otherlang).
"'" :
"null").
',';
546 $sql .=
' status = '.(isset($this->status) ? $this->status :
"null").
',';
547 $sql .=
' fk_default_home = '.(($this->fk_default_home > 0) ? $this->fk_default_home :
"null").
',';
548 $sql .=
' use_manifest = '.((int) $this->use_manifest).
',';
549 $sql .=
' virtualhost = '.(($this->virtualhost !=
'') ?
"'".$this->db->escape($this->virtualhost).
"'" :
"null").
',';
550 $sql .=
' fk_user_modif = '.(!isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).
',';
551 $sql .=
' date_creation = '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) != 0 ?
"'".$this->db->idate($this->date_creation).
"'" :
'null').
',';
552 $sql .=
' tms = '.(dol_strlen($this->date_modification) != 0 ?
"'".$this->db->idate($this->date_modification).
"'" :
"'".$this->db->idate(
dol_now()).
"'");
553 $sql .=
' WHERE rowid='.((int) $this->
id);
557 $resql = $this->db->query($sql);
560 $this->errors[] =
'Error '.$this->db->lasterror();
561 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
564 if (!$error && !$notrigger) {
569 $tmplangarray = explode(
',', $this->otherlang);
570 if (is_array($tmplangarray)) {
571 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
572 foreach ($tmplangarray as $val) {
573 if (trim($val) == $this->lang) {
576 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
588 $this->db->rollback();
606 public function delete(
User $user, $notrigger =
false)
617 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'website_page';
618 $sql .=
' WHERE fk_website = '.((int) $this->
id);
620 $resql = $this->db->query($sql);
623 $this->errors[] =
'Error '.$this->db->lasterror();
624 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
634 if (!$error && !empty($this->
ref)) {
635 $pathofwebsite = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$this->
ref;
642 $this->db->rollback();
664 global $conf, $langs;
665 global $dolibarr_main_data_root;
674 if (empty($newref)) {
675 $this->error =
'ErrorBadParameter';
679 $object =
new self($this->db);
682 if ($object->fetch(0, $newref) > 0) {
683 $this->error =
'ErrorNewRefIsAlreadyUsed';
690 $object->fetch($fromid);
692 $oldidforhome = $object->fk_default_home;
693 $oldref = $object->ref;
695 $pathofwebsiteold = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($oldref);
696 $pathofwebsitenew = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($newref);
699 $fileindex = $pathofwebsitenew.
'/index.php';
703 unset($object->fk_user_creat);
704 unset($object->import_key);
707 $object->ref = $newref;
708 $object->fk_default_home = 0;
709 $object->virtualhost =
'';
710 $object->date_creation = $now;
711 $object->fk_user_creat = $user->id;
712 $object->position = ((int) $object->position) + 1;
713 $object->status = self::STATUS_DRAFT;
714 if (empty($object->lang)) {
715 $object->lang = substr($langs->defaultlang, 0, 2);
719 $object->context[
'createfromclone'] =
'createfromclone';
720 $result = $object->create($user);
723 $this->error = $object->error;
724 $this->errors = $object->errors;
725 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
729 dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0,
null, 2);
732 $pathtomedias = DOL_DATA_ROOT.
'/medias';
733 $pathtomediasinwebsite = $pathofwebsitenew.
'/medias';
735 dol_syslog(
"Create symlink for ".$pathtomedias.
" into name ".$pathtomediasinwebsite);
736 dol_mkdir(dirname($pathtomediasinwebsite));
737 $result = symlink($pathtomedias, $pathtomediasinwebsite);
741 $pathofmediasjsold = DOL_DATA_ROOT.
'/medias/js/'.$oldref;
742 $pathofmediasjsnew = DOL_DATA_ROOT.
'/medias/js/'.$newref;
743 dolCopyDir($pathofmediasjsold, $pathofmediasjsnew, $conf->global->MAIN_UMASK, 0);
745 $pathofmediasimageold = DOL_DATA_ROOT.
'/medias/image/'.$oldref;
746 $pathofmediasimagenew = DOL_DATA_ROOT.
'/medias/image/'.$newref;
747 dolCopyDir($pathofmediasimageold, $pathofmediasimagenew, $conf->global->MAIN_UMASK, 0);
753 $listofpages = $objectpages->fetchAll($fromid);
754 foreach ($listofpages as $pageid => $objectpageold) {
756 $filetplold = $pathofwebsitenew.
'/page'.$pageid.
'.tpl.php';
760 $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl,
'', 0, $object->id, 1);
763 if (is_object($objectpagenew) && $objectpagenew->pageurl) {
764 $filealias = $pathofwebsitenew.
'/'.$objectpagenew->pageurl.
'.php';
765 $filetplnew = $pathofwebsitenew.
'/page'.$objectpagenew->id.
'.tpl.php';
778 if ($pageid == $oldidforhome) {
779 $newidforhome = $objectpagenew->id;
790 $object->fk_default_home = $newidforhome;
791 $res = $object->update($user);
798 $filetpl = $pathofwebsitenew.
'/page'.$newidforhome.
'.tpl.php';
799 $filewrapper = $pathofwebsitenew.
'/wrapper.php';
803 $result =
dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl, $filewrapper, $object);
807 unset($object->context[
'createfromclone']);
815 $this->db->rollback();
832 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
834 global $langs, $conf, $db;
835 global $dolibarr_main_authentication, $dolibarr_main_demo;
842 $label =
'<u>'.$langs->trans(
"WebSite").
'</u>';
844 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
845 $label .=
'<b>'.$langs->trans(
'MainLanguage').
':</b> '.$this->lang;
847 $linkstart =
'<a href="'.DOL_URL_ROOT.
'/website/card.php?id='.$this->
id.
'"';
848 $linkstart .= ($notooltip ?
'' :
' title="'.dol_escape_htmltag($label, 1).
'" class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"');
852 $linkstart = $linkend =
'';
855 $result .= ($linkstart.img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ?
'' :
'class="classfortooltip"')).$linkend);
856 if ($withpicto != 2) {
860 $result .= $linkstart.$this->ref.$linkend;
872 return $this->
LibStatut($this->status, $mode);
888 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
891 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
892 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
893 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
894 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
897 $statusType =
'status5';
898 if ($status == self::STATUS_VALIDATED) {
899 $statusType =
'status4';
902 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
919 $this->
ref =
'myspecimenwebsite';
922 $this->otherlang =
'fr,es';
924 $this->fk_default_home =
null;
925 $this->virtualhost =
'http://myvirtualhost';
926 $this->fk_user_creat = $user->id;
927 $this->fk_user_modif = $user->id;
928 $this->date_creation =
dol_now();
940 global $conf, $mysoc;
944 if (empty($website->id) || empty($website->ref)) {
949 dol_syslog(
"Create temp dir ".$conf->website->dir_temp);
951 if (!is_writable($conf->website->dir_temp)) {
952 setEventMessages(
"Temporary dir ".$conf->website->dir_temp.
" is not writable",
null,
'errors');
956 $destdir = $conf->website->dir_temp.
'/'.$website->ref;
959 $count = 0; $countreallydeleted = 0;
961 if ($counttodelete != $countreallydeleted) {
962 setEventMessages(
"Failed to clean temp directory ".$destdir,
null,
'errors');
966 $arrayreplacementinfilename = array();
967 $arrayreplacementincss = array();
968 $arrayreplacementincss[
'file=image/'.$website->ref.
'/'] =
"file=image/__WEBSITE_KEY__/";
969 $arrayreplacementincss[
'file=js/'.$website->ref.
'/'] =
"file=js/__WEBSITE_KEY__/";
970 $arrayreplacementincss[
'medias/image/'.$website->ref.
'/'] =
"medias/image/__WEBSITE_KEY__/";
971 $arrayreplacementincss[
'medias/js/'.$website->ref.
'/'] =
"medias/js/__WEBSITE_KEY__/";
972 if ($mysoc->logo_small) {
973 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_small] =
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__";
975 if ($mysoc->logo_mini) {
976 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini] =
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__";
979 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo] =
"file=logos%2Fthumbs%2F__LOGO_KEY__";
984 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/containers');
985 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey');
986 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey');
989 $srcdir = $conf->website->dir_output.
'/'.$website->ref;
990 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers';
992 dol_syslog(
"Copy pages from ".$srcdir.
" into ".$destdir);
993 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array(
'old',
'back'));
996 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md')) {
997 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md', $conf->website->dir_temp.
'/'.$website->ref.
'/README.md');
999 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE')) {
1000 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE', $conf->website->dir_temp.
'/'.$website->ref.
'/LICENSE');
1004 $srcdir = DOL_DATA_ROOT.
'/medias/image/'.$website->ref;
1005 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey';
1007 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1008 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1011 $srcdir = DOL_DATA_ROOT.
'/medias/js/'.$website->ref;
1012 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey';
1014 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1015 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1018 $cssindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/styles.css.php';
1023 $htmldeaderindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/htmlheader.html';
1029 $filesql = $conf->website->dir_temp.
'/'.$website->ref.
'/website_pages.sql';
1030 $fp = fopen($filesql,
"w");
1037 $listofpages = $objectpages->fetchAll($website->id);
1041 foreach ($listofpages as $pageid => $objectpageold) {
1042 $objectpageold->newid = $i;
1046 foreach ($listofpages as $pageid => $objectpageold) {
1049 foreach ($listofpages as $pageid2 => $objectpageold2) {
1050 if ($pageid2 == $objectpageold->fk_page) {
1051 $newfk_page = $objectpageold2->newid;
1055 $objectpageold->newfk_page = $newfk_page;
1058 foreach ($listofpages as $pageid => $objectpageold) {
1059 $allaliases = $objectpageold->pageurl;
1060 $allaliases .= ($objectpageold->aliasalt ?
','.$objectpageold->aliasalt :
'');
1062 $line =
'-- File generated by Dolibarr '.DOL_VERSION.
' -- '.
dol_print_date(
dol_now(
'gmt'),
'standard',
'gmt').
' UTC --;';
1065 $line .=
'-- Page ID '.$objectpageold->id.
' -> '.$objectpageold->newid.
'__+MAX_llx_website_page__ - Aliases '.$allaliases.
' --;';
1070 $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)';
1072 $line .=
" VALUES(";
1073 $line .= $objectpageold->newid.
"__+MAX_llx_website_page__, ";
1074 $line .= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page).
"__+MAX_llx_website_page__" :
"null").
", ";
1075 $line .=
"__WEBSITE_ID__, ";
1076 $line .=
"'".$this->db->escape($objectpageold->pageurl).
"', ";
1077 $line .=
"'".$this->db->escape($objectpageold->aliasalt).
"', ";
1078 $line .=
"'".$this->db->escape($objectpageold->title).
"', ";
1079 $line .=
"'".$this->db->escape($objectpageold->description).
"', ";
1080 $line .=
"'".$this->db->escape($objectpageold->lang).
"', ";
1081 $line .=
"'".$this->db->escape($objectpageold->image).
"', ";
1082 $line .=
"'".$this->db->escape($objectpageold->keywords).
"', ";
1083 $line .=
"'".$this->db->escape($objectpageold->status).
"', ";
1084 $line .=
"'".$this->db->idate($objectpageold->date_creation).
"', ";
1085 $line .=
"'".$this->db->idate($objectpageold->date_modification).
"', ";
1086 $line .= ($objectpageold->import_key ?
"'".$this->db->escape($objectpageold->import_key).
"'" :
"null").
", ";
1087 $line .=
"'".$this->db->escape($objectpageold->grabbed_from).
"', ";
1088 $line .=
"'".$this->db->escape($objectpageold->type_container).
"', ";
1091 $stringtoexport = $objectpageold->htmlheader;
1092 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1093 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1094 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1095 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1096 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1098 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1099 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1100 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1101 $line .=
"'".$this->db->escape(str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport)).
"', ";
1104 $stringtoexport = $objectpageold->content;
1105 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1106 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1107 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1108 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1109 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1110 $stringtoexport = str_replace(
'"image/'.$website->ref.
'/',
'"image/__WEBSITE_KEY__/', $stringtoexport);
1111 $stringtoexport = str_replace(
'"/image/'.$website->ref.
'/',
'"/image/__WEBSITE_KEY__/', $stringtoexport);
1112 $stringtoexport = str_replace(
'"js/'.$website->ref.
'/',
'"js/__WEBSITE_KEY__/', $stringtoexport);
1113 $stringtoexport = str_replace(
'"/js/'.$website->ref.
'/',
'"/js/__WEBSITE_KEY__/', $stringtoexport);
1115 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1116 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1117 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1120 $line .=
"'".$this->db->escape($stringtoexport).
"', ";
1121 $line .=
"'".$this->db->escape($objectpageold->author_alias).
"', ";
1122 $line .= (int) $objectpageold->allowed_in_frames;
1130 if ($this->fk_default_home > 0 && ($objectpageold->id == $this->fk_default_home) && ($objectpageold->newid > 0)) {
1132 $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__;";
1138 $line =
"\n-- For Dolibarr v14+ --;\n";
1139 $line .=
"UPDATE llx_website SET lang = '".$this->db->escape($this->lang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1140 $line .=
"UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1148 $filedir = $conf->website->dir_temp.
'/'.$website->ref.
'/.';
1149 $fileglob = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-*.zip';
1150 $filename = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-'.
dol_print_date(
dol_now(),
'dayhourlog').
'-V'.((float) DOL_VERSION).
'.zip';
1153 $result = dol_compress_file($filedir, $filename,
'zip');
1159 $this->error = $errormsg;
1173 global $conf, $mysoc;
1180 if (empty($object->ref)) {
1181 $this->error =
'Function importWebSite called on object not loaded (object->ref is empty)';
1186 dol_mkdir($conf->website->dir_temp.
'/'.$object->ref);
1188 $filename = basename($pathtofile);
1189 if (!preg_match(
'/^website_(.*)-(.*)$/', $filename, $reg)) {
1190 $this->errors[] =
'Bad format for filename '.$filename.
'. Must be website_XXX-VERSION.';
1194 $result =
dol_uncompress($pathtofile, $conf->website->dir_temp.
'/'.$object->ref);
1196 if (!empty($result[
'error'])) {
1197 $this->errors[] =
'Failed to unzip file '.$pathtofile.
'.';
1201 $arrayreplacement = array();
1202 $arrayreplacement[
'__WEBSITE_ID__'] = $object->id;
1203 $arrayreplacement[
'__WEBSITE_KEY__'] = $object->ref;
1204 $arrayreplacement[
'__N__'] = $this->db->escape(
"\n");
1205 $arrayreplacement[
'__LOGO_SMALL_KEY__'] = $this->db->escape($mysoc->logo_small);
1206 $arrayreplacement[
'__LOGO_MINI_KEY__'] = $this->db->escape($mysoc->logo_mini);
1207 $arrayreplacement[
'__LOGO_KEY__'] = $this->db->escape($mysoc->logo);
1210 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/containers', $conf->website->dir_output.
'/'.$object->ref, 0, 1);
1213 $cssindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/styles.css.php';
1216 $htmldeaderindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/htmlheader.html';
1220 $filemaster = $conf->website->dir_output.
'/'.$object->ref.
'/master.inc.php';
1223 $this->errors[] =
'Failed to write file '.$filemaster;
1227 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/image/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/image/'.$object->ref, 0, 1);
1228 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/js/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/js/'.$object->ref, 0, 1);
1230 $sqlfile = $conf->website->dir_temp.
"/".$object->ref.
'/website_pages.sql';
1237 $sqlgetrowid =
'SELECT MAX(rowid) as max from '.MAIN_DB_PREFIX.
'website_page';
1238 $resql = $this->db->query($sqlgetrowid);
1240 $obj = $this->db->fetch_object($resql);
1241 $maxrowid = $obj->max;
1245 $runsql =
run_sql($sqlfile, 1,
'', 0,
'',
'none', 0, 1, 0, 0, 1);
1247 $this->errors[] =
'Failed to load sql file '.$sqlfile.
' (ret='.((int) $runsql).
')';
1254 $fp = fopen($sqlfile,
"r");
1256 while (!feof($fp)) {
1260 $buf = fgets($fp, 65000);
1261 if (preg_match(
'/^-- Page ID (\d+)\s[^\s]+\s(\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) {
1263 $newid = ($reg[2] + $maxrowid);
1264 $aliasesarray = explode(
',', $reg[3]);
1266 dol_syslog(
"Found ID ".$oldid.
" to replace with ID ".$newid.
" and shortcut aliases to create: ".$reg[3]);
1268 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);
1270 $objectpagestatic->fetch($newid);
1273 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1276 $this->errors[] =
'Failed to write file '.basename($filetpl);
1281 if (is_array($aliasesarray)) {
1282 foreach ($aliasesarray as $aliasshortcuttocreate) {
1283 if (trim($aliasshortcuttocreate)) {
1284 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1287 $this->errors[] =
'Failed to write file '.basename($filealias);
1299 $sql =
"SELECT fk_default_home FROM ".MAIN_DB_PREFIX.
"website WHERE rowid = ".((int) $object->id);
1300 $resql = $this->db->query($sql);
1302 $obj = $this->db->fetch_object($resql);
1304 $object->fk_default_home = $obj->fk_default_home;
1312 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1313 dolSaveIndexPage($pathofwebsite, $pathofwebsite.
'/index.php', $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php', $pathofwebsite.
'/wrapper.php', $object);
1316 $this->db->rollback();
1319 $this->db->commit();
1337 if (empty($object->ref)) {
1338 $this->error =
'Function rebuildWebSiteFiles called on object not loaded (object->ref is empty)';
1344 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"website_page WHERE fk_website = ".((int) $this->
id);
1346 $resql = $this->db->query($sql);
1348 $this->error = $this->db->lasterror();
1352 $num = $this->db->num_rows($resql);
1357 $obj = $this->db->fetch_object($resql);
1359 $newid = $obj->rowid;
1361 $objectpagestatic->fetch($newid);
1363 $aliasesarray = explode(
',', $objectpagestatic->aliasalt);
1365 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1368 $this->errors[] =
'Failed to write file '.basename($filetpl);
1373 if (!empty($objectpagestatic->pageurl) && !in_array($objectpagestatic->pageurl, $aliasesarray)) {
1374 $aliasesarray[] = $objectpagestatic->pageurl;
1378 if (is_array($aliasesarray)) {
1379 foreach ($aliasesarray as $aliasshortcuttocreate) {
1380 if (trim($aliasshortcuttocreate)) {
1381 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1384 $this->errors[] =
'Failed to write file '.basename($filealias);
1396 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1397 $fileindex = $pathofwebsite.
'/index.php';
1399 if ($object->fk_default_home > 0) {
1400 $filetpl = $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php';
1402 $filewrapper = $pathofwebsite.
'/wrapper.php';
1403 dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object);
1420 return (empty($this->otherlang) ?
false :
true);
1434 global $websitepagefile, $website;
1436 if (!is_object($weblangs)) {
1437 return 'ERROR componentSelectLang called with parameter $weblangs not defined';
1440 $arrayofspecialmainlanguages = array(
1471 if (!empty($websitepagefile)) {
1472 $websitepagefileshort = basename($websitepagefile);
1473 if ($websitepagefileshort ==
'index.php') {
1474 $pageid = $website->fk_default_home;
1476 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), $websitepagefileshort);
1479 $tmppage->fetch($pageid);
1484 if (!is_array($languagecodes) && $pageid > 0) {
1485 $languagecodes = array();
1487 $sql =
"SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
1488 $sql .=
" FROM ".MAIN_DB_PREFIX.
"website_page as wp";
1489 $sql .=
" WHERE wp.fk_website = ".((int) $website->id);
1490 $sql .=
" AND (wp.fk_page = ".((int) $pageid).
" OR wp.rowid = ".((int) $pageid);
1491 if ($tmppage->fk_page > 0) {
1492 $sql .=
" OR wp.fk_page = ".((int) $tmppage->fk_page).
" OR wp.rowid = ".((int) $tmppage->fk_page);
1496 $resql = $this->db->query($sql);
1498 while ($obj = $this->db->fetch_object($resql)) {
1499 $newlang = $obj->lang;
1500 if ($obj->rowid == $pageid) {
1501 $newlang = $obj->lang;
1503 if (!in_array($newlang, $languagecodes)) {
1504 $languagecodes[] = $newlang;
1511 $languagecodeselected = substr($weblangs->defaultlang, 0, 2);
1512 if (!empty($websitepagefile)) {
1513 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), basename($websitepagefile));
1515 $pagelang = substr($tmppage->lang, 0, 2);
1516 $languagecodeselected = substr($pagelang, 0, 2);
1517 if (!in_array($pagelang, $languagecodes)) {
1518 $languagecodes[] = $pagelang;
1523 $weblangs->load(
'languages');
1526 $url = $_SERVER[
"REQUEST_URI"];
1527 $url = preg_replace(
'/(\?|&)l=([a-zA-Z_]*)/',
'', $url);
1529 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'l=';
1530 if (!preg_match(
'/^\//', $url)) {
1535 $MAXHEIGHT = 4 * $HEIGHTOPTION;
1536 $nboflanguage = count($languagecodes);
1538 $out =
'<!-- componentSelectLang'.$htmlname.
' -->'.
"\n";
1541 $out .=
'.componentSelectLang'.$htmlname.
':hover { height: '.min($MAXHEIGHT, ($HEIGHTOPTION * $nboflanguage)).
'px; overflow-x: hidden; overflow-y: '.((($HEIGHTOPTION * $nboflanguage) > $MAXHEIGHT) ?
' scroll' :
'hidden').
'; }'.
"\n";
1542 $out .=
'.componentSelectLang'.$htmlname.
' li { line-height: '.$HEIGHTOPTION.
'px; }'.
"\n";
1543 $out .=
'.componentSelectLang'.$htmlname.
' {
1544 display: inline-block;
1546 height: '.$HEIGHTOPTION.
'px;
1548 transition: all .3s ease;
1550 vertical-align: top;
1552 .componentSelectLang'.$htmlname.
':hover, .componentSelectLang'.$htmlname.
':hover a { background-color: #fff; color: #000 !important; }
1553 ul.componentSelectLang'.$htmlname.
' { width: 150px; }
1554 ul.componentSelectLang'.$htmlname.
':hover .fa { visibility: hidden; }
1555 .componentSelectLang'.$htmlname.
' a { text-decoration: none; width: 100%; }
1556 .componentSelectLang'.$htmlname.
' li { display: block; padding: 0px 15px; margin-left: 0; margin-right: 0; }
1557 .componentSelectLang'.$htmlname.
' li:hover { background-color: #EEE; }
1560 $out .=
'<ul class="componentSelectLang'.$htmlname.($morecss ?
' '.$morecss :
'').
'">';
1562 if ($languagecodeselected) {
1564 if (strlen($languagecodeselected) == 2) {
1565 $languagecodeselected = (empty($arrayofspecialmainlanguages[$languagecodeselected]) ? $languagecodeselected.
'_'.strtoupper($languagecodeselected) : $arrayofspecialmainlanguages[$languagecodeselected]);
1568 $countrycode = strtolower(substr($languagecodeselected, -2));
1569 $label = $weblangs->trans(
"Language_".$languagecodeselected);
1570 if ($countrycode ==
'us') {
1571 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1573 $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>';
1574 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1575 $out .=
'</a></li>';
1578 if (is_array($languagecodes)) {
1579 foreach ($languagecodes as $languagecode) {
1581 if (strlen($languagecode) == 2) {
1582 $languagecode = (empty($arrayofspecialmainlanguages[$languagecode]) ? $languagecode.
'_'.strtoupper($languagecode) : $arrayofspecialmainlanguages[$languagecode]);
1585 if ($languagecode == $languagecodeselected) {
1589 $countrycode = strtolower(substr($languagecode, -2));
1590 $label = $weblangs->trans(
"Language_".$languagecode);
1591 if ($countrycode ==
'us') {
1592 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1594 $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>';
1595 if (empty($i) && empty($languagecodeselected)) {
1596 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1598 $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.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1, $testvirus=0, $indexdatabase=1, $moreinfo=array())
Move a file into another name.
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_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.
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)
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).