29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
42 public $element =
'website';
47 public $table_element =
'website';
53 public $ismultientitymanaged = 1;
56 protected $childtablesoncascade = array();
62 public $picto =
'globe';
97 public $date_creation;
102 public $date_modification;
111 public $fk_default_home;
116 public $fk_user_creat;
121 public $fk_user_modif;
131 public $use_manifest;
144 const STATUS_DRAFT = 0;
145 const STATUS_VALIDATED = 1;
168 global $conf, $langs;
176 if (isset($this->entity)) {
177 $this->entity = (int) $this->entity;
179 if (isset($this->
ref)) {
180 $this->
ref = trim($this->
ref);
185 if (isset($this->
status)) {
188 if (empty($this->date_creation)) {
189 $this->date_creation = $now;
191 if (empty($this->date_modification)) {
192 $this->date_modification = $now;
195 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
196 $tmparray = explode(
',', $this->otherlang);
197 if (is_array($tmparray)) {
198 foreach ($tmparray as $key => $val) {
200 if (empty(trim($val))) {
201 unset($tmparray[$key]);
204 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
206 $this->otherlang = join(
',', $tmparray);
210 if (empty($this->entity)) {
211 $this->entity = $conf->entity;
213 if (empty($this->lang)) {
214 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
219 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element.
'(';
222 $sql .=
'description,';
224 $sql .=
'otherlang,';
226 $sql .=
'fk_default_home,';
227 $sql .=
'virtualhost,';
228 $sql .=
'fk_user_creat,';
229 $sql .=
'date_creation,';
232 $sql .=
') VALUES (';
233 $sql .=
' '.((empty($this->entity) && $this->entity !=
'0') ?
'NULL' : $this->entity).
',';
234 $sql .=
' '.(!isset($this->
ref) ?
'NULL' :
"'".$this->db->escape($this->
ref).
"'").
',';
236 $sql .=
' '.(!isset($this->lang) ?
'NULL' :
"'".$this->db->escape($this->lang).
"'").
',';
237 $sql .=
' '.(!isset($this->otherlang) ?
'NULL' :
"'".$this->db->escape($this->otherlang).
"'").
',';
238 $sql .=
' '.(!isset($this->
status) ?
'1' : $this->status).
',';
239 $sql .=
' '.(!isset($this->fk_default_home) ?
'NULL' : $this->fk_default_home).
',';
240 $sql .=
' '.(!isset($this->virtualhost) ?
'NULL' :
"'".$this->db->escape($this->virtualhost).
"'").
",";
241 $sql .=
' '.(!isset($this->fk_user_creat) ? $user->id : $this->fk_user_creat).
',';
242 $sql .=
' '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_creation).
"'").
",";
243 $sql .=
' '.((int) $this->
position).
",";
244 $sql .=
' '.(!isset($this->date_modification) ||
dol_strlen($this->date_modification) == 0 ?
'NULL' :
"'".$this->db->idate($this->date_modification).
"'");
249 $resql = $this->db->query($sql);
252 $this->errors[] =
'Error '.$this->db->lasterror();
253 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
257 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
260 $tmplangarray = explode(
',', $this->otherlang);
261 if (is_array($tmplangarray)) {
262 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
263 foreach ($tmplangarray as $val) {
264 if (trim($val) == $this->lang) {
267 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val), DOL_DATA_ROOT);
272 dol_mkdir($conf->medias->multidir_output[$conf->entity].
'/image/'.$this->ref, DOL_DATA_ROOT);
273 dol_mkdir($conf->medias->multidir_output[$conf->entity].
'/js/'.$this->ref, DOL_DATA_ROOT);
287 $stringtodolibarrfile =
"# Some properties for Dolibarr web site CMS\n";
288 $stringtodolibarrfile .=
"param=value\n";
290 file_put_contents($conf->website->dir_output.
'/'.$this->ref.
'/.dolibarr', $stringtodolibarrfile);
295 $this->db->rollback();
296 if ($this->db->lasterrno() ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
315 public function fetch($id, $ref =
null)
321 $sql .=
" t.entity,";
323 $sql .=
" t.position,";
324 $sql .=
" t.description,";
326 $sql .=
" t.otherlang,";
327 $sql .=
" t.status,";
328 $sql .=
" t.fk_default_home,";
329 $sql .=
" t.use_manifest,";
330 $sql .=
" t.virtualhost,";
331 $sql .=
" t.fk_user_creat,";
332 $sql .=
" t.fk_user_modif,";
333 $sql .=
" t.date_creation,";
334 $sql .=
" t.tms as date_modification";
335 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
336 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
338 $sql .=
" AND t.ref = '".$this->db->escape($ref).
"'";
340 $sql .=
" AND t.rowid = ".(int) $id;
343 $resql = $this->db->query($sql);
345 $numrows = $this->db->num_rows($resql);
347 $obj = $this->db->fetch_object($resql);
349 $this->
id = $obj->rowid;
351 $this->entity = $obj->entity;
352 $this->
ref = $obj->ref;
355 $this->lang = $obj->lang;
356 $this->otherlang = $obj->otherlang;
357 $this->
status = $obj->status;
358 $this->fk_default_home = $obj->fk_default_home;
359 $this->virtualhost = $obj->virtualhost;
360 $this->use_manifest = $obj->use_manifest;
361 $this->fk_user_creat = $obj->fk_user_creat;
362 $this->fk_user_modif = $obj->fk_user_modif;
363 $this->date_creation = $this->db->jdate($obj->date_creation);
364 $this->date_modification = $this->db->jdate($obj->date_modification);
366 $this->db->free($resql);
379 $this->errors[] =
'Error '.$this->db->lasterror();
380 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
393 $this->lines = array();
397 return count($this->lines) ? 1 : 0;
412 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
420 $sql .=
" t.entity,";
422 $sql .=
" t.description,";
424 $sql .=
" t.otherlang,";
425 $sql .=
" t.status,";
426 $sql .=
" t.fk_default_home,";
427 $sql .=
" t.virtualhost,";
428 $sql .=
" t.fk_user_creat,";
429 $sql .=
" t.fk_user_modif,";
430 $sql .=
" t.date_creation,";
431 $sql .=
" t.tms as date_modification";
432 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->table_element.
" as t";
433 $sql .=
" WHERE t.entity IN (".getEntity(
'website').
")";
436 if (count($filter) > 0) {
437 foreach ($filter as $key => $value) {
438 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
441 if (count($sqlwhere) > 0) {
442 $sql .=
' AND '.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere);
445 if (!empty($sortfield)) {
446 $sql .= $this->db->order($sortfield, $sortorder);
448 if (!empty($limit)) {
449 $sql .= $this->db->plimit($limit, $offset);
452 $resql = $this->db->query($sql);
454 $num = $this->db->num_rows($resql);
456 while ($obj = $this->db->fetch_object($resql)) {
457 $record =
new self($this->db);
459 $record->id = $obj->rowid;
461 $record->entity = $obj->entity;
462 $record->ref = $obj->ref;
463 $record->description = $obj->description;
464 $record->lang = $obj->lang;
465 $record->otherlang = $obj->otherlang;
466 $record->status = $obj->status;
467 $record->fk_default_home = $obj->fk_default_home;
468 $record->virtualhost = $obj->virtualhost;
469 $record->fk_user_creat = $obj->fk_user_creat;
470 $record->fk_user_modif = $obj->fk_user_modif;
471 $record->date_creation = $this->db->jdate($obj->date_creation);
472 $record->date_modification = $this->db->jdate($obj->date_modification);
474 $records[$record->id] = $record;
476 $this->db->free($resql);
480 $this->errors[] =
'Error '.$this->db->lasterror();
481 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
497 global $conf, $langs;
505 if (isset($this->entity)) {
506 $this->entity = (int) $this->entity;
508 if (isset($this->
ref)) {
509 $this->
ref = trim($this->
ref);
514 if (isset($this->
status)) {
519 $this->lang = preg_replace(
'/[_-].*$/',
'', trim($this->lang));
520 $tmparray = explode(
',', $this->otherlang);
521 if (is_array($tmparray)) {
522 foreach ($tmparray as $key => $val) {
524 if (empty(trim($val))) {
525 unset($tmparray[$key]);
528 $tmparray[$key] = preg_replace(
'/[_-].*$/',
'', trim($val));
530 $this->otherlang = join(
',', $tmparray);
532 if (empty($this->lang)) {
533 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"MainLanguage"));
541 $sql =
'UPDATE '.MAIN_DB_PREFIX.$this->table_element.
' SET';
542 $sql .=
' entity = '.(isset($this->entity) ? $this->entity :
"null").
',';
543 $sql .=
' ref = '.(isset($this->
ref) ?
"'".$this->db->escape($this->
ref).
"'" :
"null").
',';
544 $sql .=
' description = '.(isset($this->
description) ?
"'".$this->db->escape($this->
description).
"'" :
"null").
',';
545 $sql .=
' lang = '.(isset($this->lang) ?
"'".$this->db->escape($this->lang).
"'" :
"null").
',';
546 $sql .=
' otherlang = '.(isset($this->otherlang) ?
"'".$this->db->escape($this->otherlang).
"'" :
"null").
',';
547 $sql .=
' status = '.(isset($this->
status) ? $this->
status :
"null").
',';
548 $sql .=
' fk_default_home = '.(($this->fk_default_home > 0) ? $this->fk_default_home :
"null").
',';
549 $sql .=
' use_manifest = '.((int) $this->use_manifest).
',';
550 $sql .=
' virtualhost = '.(($this->virtualhost !=
'') ?
"'".$this->db->escape($this->virtualhost).
"'" :
"null").
',';
551 $sql .=
' fk_user_modif = '.(!isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).
',';
552 $sql .=
' date_creation = '.(!isset($this->date_creation) ||
dol_strlen($this->date_creation) != 0 ?
"'".$this->db->idate($this->date_creation).
"'" :
'null').
',';
553 $sql .=
' tms = '.(dol_strlen($this->date_modification) != 0 ?
"'".$this->db->idate($this->date_modification).
"'" :
"'".$this->db->idate(
dol_now()).
"'");
554 $sql .=
' WHERE rowid='.((int) $this->
id);
558 $resql = $this->db->query($sql);
561 $this->errors[] =
'Error '.$this->db->lasterror();
562 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
565 if (!$error && !$notrigger) {
570 $tmplangarray = explode(
',', $this->otherlang);
571 if (is_array($tmplangarray)) {
572 dol_mkdir($conf->website->dir_output.
'/'.$this->ref);
573 foreach ($tmplangarray as $val) {
574 if (trim($val) == $this->lang) {
577 dol_mkdir($conf->website->dir_output.
'/'.$this->ref.
'/'.trim($val));
589 $this->db->rollback();
607 public function delete(
User $user, $notrigger =
false)
618 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'website_page';
619 $sql .=
' WHERE fk_website = '.((int) $this->
id);
621 $resql = $this->db->query($sql);
624 $this->errors[] =
'Error '.$this->db->lasterror();
625 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
635 if (!$error && !empty($this->
ref)) {
636 $pathofwebsite = DOL_DATA_ROOT.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.$this->
ref;
643 $this->db->rollback();
665 global $conf, $langs;
666 global $dolibarr_main_data_root;
675 if (empty($newref)) {
676 $this->error =
'ErrorBadParameter';
680 $object =
new self($this->db);
683 if ($object->fetch(0, $newref) > 0) {
684 $this->error =
'ErrorNewRefIsAlreadyUsed';
691 $object->fetch($fromid);
693 $oldidforhome = $object->fk_default_home;
694 $oldref = $object->ref;
696 $pathofwebsiteold = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($oldref);
697 $pathofwebsitenew = $dolibarr_main_data_root.($conf->entity > 1 ?
'/'.$conf->entity :
'').
'/website/'.
dol_sanitizeFileName($newref);
700 $fileindex = $pathofwebsitenew.
'/index.php';
704 unset($object->fk_user_creat);
705 unset($object->import_key);
708 $object->ref = $newref;
709 $object->fk_default_home = 0;
710 $object->virtualhost =
'';
711 $object->date_creation = $now;
712 $object->fk_user_creat = $user->id;
713 $object->position = ((int) $object->position) + 1;
714 $object->status = self::STATUS_DRAFT;
715 if (empty($object->lang)) {
716 $object->lang = substr($langs->defaultlang, 0, 2);
720 $object->context[
'createfromclone'] =
'createfromclone';
721 $result = $object->create($user);
724 $this->error = $object->error;
725 $this->errors = $object->errors;
726 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
730 dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0,
null, 2);
733 $pathtomedias = DOL_DATA_ROOT.
'/medias';
734 $pathtomediasinwebsite = $pathofwebsitenew.
'/medias';
736 dol_syslog(
"Create symlink for ".$pathtomedias.
" into name ".$pathtomediasinwebsite);
737 dol_mkdir(dirname($pathtomediasinwebsite));
738 $result = symlink($pathtomedias, $pathtomediasinwebsite);
742 $pathofmediasjsold = DOL_DATA_ROOT.
'/medias/js/'.$oldref;
743 $pathofmediasjsnew = DOL_DATA_ROOT.
'/medias/js/'.$newref;
744 dolCopyDir($pathofmediasjsold, $pathofmediasjsnew, $conf->global->MAIN_UMASK, 0);
746 $pathofmediasimageold = DOL_DATA_ROOT.
'/medias/image/'.$oldref;
747 $pathofmediasimagenew = DOL_DATA_ROOT.
'/medias/image/'.$newref;
748 dolCopyDir($pathofmediasimageold, $pathofmediasimagenew, $conf->global->MAIN_UMASK, 0);
754 $listofpages = $objectpages->fetchAll($fromid);
755 foreach ($listofpages as $pageid => $objectpageold) {
757 $filetplold = $pathofwebsitenew.
'/page'.$pageid.
'.tpl.php';
761 $objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl,
'', 0, $object->id, 1);
764 if (is_object($objectpagenew) && $objectpagenew->pageurl) {
765 $filealias = $pathofwebsitenew.
'/'.$objectpagenew->pageurl.
'.php';
766 $filetplnew = $pathofwebsitenew.
'/page'.$objectpagenew->id.
'.tpl.php';
779 if ($pageid == $oldidforhome) {
780 $newidforhome = $objectpagenew->id;
791 $object->fk_default_home = $newidforhome;
792 $res = $object->update($user);
799 $filetpl = $pathofwebsitenew.
'/page'.$newidforhome.
'.tpl.php';
800 $filewrapper = $pathofwebsitenew.
'/wrapper.php';
804 $result =
dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl, $filewrapper, $object);
808 unset($object->context[
'createfromclone']);
816 $this->db->rollback();
833 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $maxlen = 24, $morecss =
'')
835 global $langs, $conf, $db;
836 global $dolibarr_main_authentication, $dolibarr_main_demo;
843 $label =
'<u>'.$langs->trans(
"WebSite").
'</u>';
845 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->
ref.
'<br>';
846 $label .=
'<b>'.$langs->trans(
'MainLanguage').
':</b> '.$this->lang;
848 $linkstart =
'<a href="'.DOL_URL_ROOT.
'/website/card.php?id='.$this->
id.
'"';
849 $linkstart .= ($notooltip ?
'' :
' title="'.dol_escape_htmltag($label, 1).
'" class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"');
853 $linkstart = $linkend =
'';
856 $result .= ($linkstart.img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ?
'' :
'class="classfortooltip"')).$linkend);
857 if ($withpicto != 2) {
861 $result .= $linkstart.$this->ref.$linkend;
889 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
892 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
893 $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
894 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv(
'Offline');
895 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv(
'Online');
898 $statusType =
'status5';
899 if ($status == self::STATUS_VALIDATED) {
900 $statusType =
'status4';
903 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
920 $this->
ref =
'myspecimenwebsite';
923 $this->otherlang =
'fr,es';
925 $this->fk_default_home =
null;
926 $this->virtualhost =
'http://myvirtualhost';
927 $this->fk_user_creat = $user->id;
928 $this->fk_user_modif = $user->id;
929 $this->date_creation =
dol_now();
941 global $conf, $mysoc;
945 if (empty($website->id) || empty($website->ref)) {
950 dol_syslog(
"Create temp dir ".$conf->website->dir_temp);
952 if (!is_writable($conf->website->dir_temp)) {
953 setEventMessages(
"Temporary dir ".$conf->website->dir_temp.
" is not writable",
null,
'errors');
957 $destdir = $conf->website->dir_temp.
'/'.$website->ref;
961 $countreallydeleted = 0;
963 if ($counttodelete != $countreallydeleted) {
964 setEventMessages(
"Failed to clean temp directory ".$destdir,
null,
'errors');
968 $arrayreplacementinfilename = array();
969 $arrayreplacementincss = array();
970 $arrayreplacementincss[
'file=image/'.$website->ref.
'/'] =
"file=image/__WEBSITE_KEY__/";
971 $arrayreplacementincss[
'file=js/'.$website->ref.
'/'] =
"file=js/__WEBSITE_KEY__/";
972 $arrayreplacementincss[
'medias/image/'.$website->ref.
'/'] =
"medias/image/__WEBSITE_KEY__/";
973 $arrayreplacementincss[
'medias/js/'.$website->ref.
'/'] =
"medias/js/__WEBSITE_KEY__/";
974 if ($mysoc->logo_small) {
975 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_small] =
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__";
977 if ($mysoc->logo_mini) {
978 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini] =
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__";
981 $arrayreplacementincss[
'file=logos%2Fthumbs%2F'.$mysoc->logo] =
"file=logos%2Fthumbs%2F__LOGO_KEY__";
986 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/containers');
987 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey');
988 dol_mkdir($conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey');
991 $srcdir = $conf->website->dir_output.
'/'.$website->ref;
992 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers';
994 dol_syslog(
"Copy pages from ".$srcdir.
" into ".$destdir);
995 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2, array(
'old',
'back'));
998 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md')) {
999 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/README.md', $conf->website->dir_temp.
'/'.$website->ref.
'/README.md');
1001 if (
dol_is_file($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE')) {
1002 dol_copy($conf->website->dir_temp.
'/'.$website->ref.
'/containers/LICENSE', $conf->website->dir_temp.
'/'.$website->ref.
'/LICENSE');
1006 $srcdir = DOL_DATA_ROOT.
'/medias/image/'.$website->ref;
1007 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/image/websitekey';
1009 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1010 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1013 $srcdir = DOL_DATA_ROOT.
'/medias/js/'.$website->ref;
1014 $destdir = $conf->website->dir_temp.
'/'.$website->ref.
'/medias/js/websitekey';
1016 dol_syslog(
"Copy content from ".$srcdir.
" into ".$destdir);
1017 dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
1020 $cssindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/styles.css.php';
1025 $htmldeaderindestdir = $conf->website->dir_temp.
'/'.$website->ref.
'/containers/htmlheader.html';
1031 $filesql = $conf->website->dir_temp.
'/'.$website->ref.
'/website_pages.sql';
1032 $fp = fopen($filesql,
"w");
1039 $listofpages = $objectpages->fetchAll($website->id);
1043 foreach ($listofpages as $pageid => $objectpageold) {
1044 $objectpageold->newid = $i;
1048 foreach ($listofpages as $pageid => $objectpageold) {
1051 foreach ($listofpages as $pageid2 => $objectpageold2) {
1052 if ($pageid2 == $objectpageold->fk_page) {
1053 $newfk_page = $objectpageold2->newid;
1057 $objectpageold->newfk_page = $newfk_page;
1060 foreach ($listofpages as $pageid => $objectpageold) {
1061 $allaliases = $objectpageold->pageurl;
1062 $allaliases .= ($objectpageold->aliasalt ?
','.$objectpageold->aliasalt :
'');
1064 $line =
'-- File generated by Dolibarr '.DOL_VERSION.
' -- '.
dol_print_date(
dol_now(
'gmt'),
'standard',
'gmt').
' UTC --;';
1067 $line .=
'-- Page ID '.$objectpageold->id.
' -> '.$objectpageold->newid.
'__+MAX_llx_website_page__ - Aliases '.$allaliases.
' --;';
1072 $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)';
1074 $line .=
" VALUES(";
1075 $line .= $objectpageold->newid.
"__+MAX_llx_website_page__, ";
1076 $line .= ($objectpageold->newfk_page ? $this->db->escape($objectpageold->newfk_page).
"__+MAX_llx_website_page__" :
"null").
", ";
1077 $line .=
"__WEBSITE_ID__, ";
1078 $line .=
"'".$this->db->escape($objectpageold->pageurl).
"', ";
1079 $line .=
"'".$this->db->escape($objectpageold->aliasalt).
"', ";
1080 $line .=
"'".$this->db->escape($objectpageold->title).
"', ";
1081 $line .=
"'".$this->db->escape($objectpageold->description).
"', ";
1082 $line .=
"'".$this->db->escape($objectpageold->lang).
"', ";
1083 $line .=
"'".$this->db->escape($objectpageold->image).
"', ";
1084 $line .=
"'".$this->db->escape($objectpageold->keywords).
"', ";
1085 $line .=
"'".$this->db->escape($objectpageold->status).
"', ";
1086 $line .=
"'".$this->db->idate($objectpageold->date_creation).
"', ";
1087 $line .=
"'".$this->db->idate($objectpageold->date_modification).
"', ";
1088 $line .= ($objectpageold->import_key ?
"'".$this->db->escape($objectpageold->import_key).
"'" :
"null").
", ";
1089 $line .=
"'".$this->db->escape($objectpageold->grabbed_from).
"', ";
1090 $line .=
"'".$this->db->escape($objectpageold->type_container).
"', ";
1093 $stringtoexport = $objectpageold->htmlheader;
1094 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1095 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1096 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1097 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1098 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1100 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1101 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1102 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1103 $line .=
"'".$this->db->escape(str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport)).
"', ";
1106 $stringtoexport = $objectpageold->content;
1107 $stringtoexport = str_replace(array(
"\r\n",
"\r",
"\n"),
"__N__", $stringtoexport);
1108 $stringtoexport = str_replace(
'file=image/'.$website->ref.
'/',
"file=image/__WEBSITE_KEY__/", $stringtoexport);
1109 $stringtoexport = str_replace(
'file=js/'.$website->ref.
'/',
"file=js/__WEBSITE_KEY__/", $stringtoexport);
1110 $stringtoexport = str_replace(
'medias/image/'.$website->ref.
'/',
"medias/image/__WEBSITE_KEY__/", $stringtoexport);
1111 $stringtoexport = str_replace(
'medias/js/'.$website->ref.
'/',
"medias/js/__WEBSITE_KEY__/", $stringtoexport);
1112 $stringtoexport = str_replace(
'"image/'.$website->ref.
'/',
'"image/__WEBSITE_KEY__/', $stringtoexport);
1113 $stringtoexport = str_replace(
'"/image/'.$website->ref.
'/',
'"/image/__WEBSITE_KEY__/', $stringtoexport);
1114 $stringtoexport = str_replace(
'"js/'.$website->ref.
'/',
'"js/__WEBSITE_KEY__/', $stringtoexport);
1115 $stringtoexport = str_replace(
'"/js/'.$website->ref.
'/',
'"/js/__WEBSITE_KEY__/', $stringtoexport);
1117 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_small,
"file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
1118 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo_mini,
"file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
1119 $stringtoexport = str_replace(
'file=logos%2Fthumbs%2F'.$mysoc->logo,
"file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
1122 $line .=
"'".$this->db->escape($stringtoexport).
"', ";
1123 $line .=
"'".$this->db->escape($objectpageold->author_alias).
"', ";
1124 $line .= (int) $objectpageold->allowed_in_frames;
1132 if ($this->fk_default_home > 0 && ($objectpageold->id == $this->fk_default_home) && ($objectpageold->newid > 0)) {
1134 $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__;";
1140 $line =
"\n-- For Dolibarr v14+ --;\n";
1141 $line .=
"UPDATE llx_website SET lang = '".$this->db->escape($this->lang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1142 $line .=
"UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang).
"' WHERE rowid = __WEBSITE_ID__;\n";
1150 $filedir = $conf->website->dir_temp.
'/'.$website->ref.
'/.';
1151 $fileglob = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-*.zip';
1152 $filename = $conf->website->dir_temp.
'/'.$website->ref.
'/website_'.$website->ref.
'-'.
dol_print_date(
dol_now(),
'dayhourlog').
'-V'.((float) DOL_VERSION).
'.zip';
1155 $result = dol_compress_file($filedir, $filename,
'zip');
1161 $this->error = $errormsg;
1175 global $conf, $mysoc;
1182 if (empty($object->ref)) {
1183 $this->error =
'Function importWebSite called on object not loaded (object->ref is empty)';
1188 dol_mkdir($conf->website->dir_temp.
'/'.$object->ref);
1190 $filename = basename($pathtofile);
1191 if (!preg_match(
'/^website_(.*)-(.*)$/', $filename, $reg)) {
1192 $this->errors[] =
'Bad format for filename '.$filename.
'. Must be website_XXX-VERSION.';
1196 $result =
dol_uncompress($pathtofile, $conf->website->dir_temp.
'/'.$object->ref);
1198 if (!empty($result[
'error'])) {
1199 $this->errors[] =
'Failed to unzip file '.$pathtofile.
'.';
1203 $arrayreplacement = array();
1204 $arrayreplacement[
'__WEBSITE_ID__'] = $object->id;
1205 $arrayreplacement[
'__WEBSITE_KEY__'] = $object->ref;
1206 $arrayreplacement[
'__N__'] = $this->db->escape(
"\n");
1207 $arrayreplacement[
'__LOGO_SMALL_KEY__'] = $this->db->escape($mysoc->logo_small);
1208 $arrayreplacement[
'__LOGO_MINI_KEY__'] = $this->db->escape($mysoc->logo_mini);
1209 $arrayreplacement[
'__LOGO_KEY__'] = $this->db->escape($mysoc->logo);
1212 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/containers', $conf->website->dir_output.
'/'.$object->ref, 0, 1);
1215 $cssindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/styles.css.php';
1218 $htmldeaderindestdir = $conf->website->dir_output.
'/'.$object->ref.
'/htmlheader.html';
1222 $filemaster = $conf->website->dir_output.
'/'.$object->ref.
'/master.inc.php';
1225 $this->errors[] =
'Failed to write file '.$filemaster;
1229 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/image/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/image/'.$object->ref, 0, 1);
1230 dolCopyDir($conf->website->dir_temp.
'/'.$object->ref.
'/medias/js/websitekey', $conf->website->dir_output.
'/'.$object->ref.
'/medias/js/'.$object->ref, 0, 1);
1232 $sqlfile = $conf->website->dir_temp.
"/".$object->ref.
'/website_pages.sql';
1239 $sqlgetrowid =
'SELECT MAX(rowid) as max from '.MAIN_DB_PREFIX.
'website_page';
1240 $resql = $this->db->query($sqlgetrowid);
1242 $obj = $this->db->fetch_object($resql);
1243 $maxrowid = $obj->max;
1247 $runsql =
run_sql($sqlfile, 1,
'', 0,
'',
'none', 0, 1, 0, 0, 1);
1249 $this->errors[] =
'Failed to load sql file '.$sqlfile.
' (ret='.((int) $runsql).
')';
1256 $fp = fopen($sqlfile,
"r");
1258 while (!feof($fp)) {
1262 $buf = fgets($fp, 65000);
1263 if (preg_match(
'/^-- Page ID (\d+)\s[^\s]+\s(\d+).*Aliases\s(.*)\s--;/i', $buf, $reg)) {
1265 $newid = ($reg[2] + $maxrowid);
1266 $aliasesarray = explode(
',', $reg[3]);
1268 dol_syslog(
"Found ID ".$oldid.
" to replace with ID ".$newid.
" and shortcut aliases to create: ".$reg[3]);
1270 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);
1272 $objectpagestatic->fetch($newid);
1275 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1278 $this->errors[] =
'Failed to write file '.basename($filetpl);
1283 if (is_array($aliasesarray)) {
1284 foreach ($aliasesarray as $aliasshortcuttocreate) {
1285 if (trim($aliasshortcuttocreate)) {
1286 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1289 $this->errors[] =
'Failed to write file '.basename($filealias);
1301 $sql =
"SELECT fk_default_home FROM ".MAIN_DB_PREFIX.
"website WHERE rowid = ".((int) $object->id);
1302 $resql = $this->db->query($sql);
1304 $obj = $this->db->fetch_object($resql);
1306 $object->fk_default_home = $obj->fk_default_home;
1314 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1315 dolSaveIndexPage($pathofwebsite, $pathofwebsite.
'/index.php', $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php', $pathofwebsite.
'/wrapper.php', $object);
1318 $this->db->rollback();
1321 $this->db->commit();
1339 if (empty($object->ref)) {
1340 $this->error =
'Function rebuildWebSiteFiles called on object not loaded (object->ref is empty)';
1346 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"website_page WHERE fk_website = ".((int) $this->
id);
1348 $resql = $this->db->query($sql);
1350 $this->error = $this->db->lasterror();
1354 $num = $this->db->num_rows($resql);
1359 $obj = $this->db->fetch_object($resql);
1361 $newid = $obj->rowid;
1363 $objectpagestatic->fetch($newid);
1365 $aliasesarray = explode(
',', $objectpagestatic->aliasalt);
1367 $filetpl = $conf->website->dir_output.
'/'.$object->ref.
'/page'.$newid.
'.tpl.php';
1370 $this->errors[] =
'Failed to write file '.basename($filetpl);
1375 if (!empty($objectpagestatic->pageurl) && !in_array($objectpagestatic->pageurl, $aliasesarray)) {
1376 $aliasesarray[] = $objectpagestatic->pageurl;
1380 if (is_array($aliasesarray)) {
1381 foreach ($aliasesarray as $aliasshortcuttocreate) {
1382 if (trim($aliasshortcuttocreate)) {
1383 $filealias = $conf->website->dir_output.
'/'.$object->ref.
'/'.trim($aliasshortcuttocreate).
'.php';
1386 $this->errors[] =
'Failed to write file '.basename($filealias);
1398 $pathofwebsite = $conf->website->dir_output.
'/'.$object->ref;
1399 $fileindex = $pathofwebsite.
'/index.php';
1401 if ($object->fk_default_home > 0) {
1402 $filetpl = $pathofwebsite.
'/page'.$object->fk_default_home.
'.tpl.php';
1404 $filewrapper = $pathofwebsite.
'/wrapper.php';
1405 dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object);
1422 return (empty($this->otherlang) ?
false :
true);
1436 global $websitepagefile, $website;
1438 if (!is_object($weblangs)) {
1439 return 'ERROR componentSelectLang called with parameter $weblangs not defined';
1442 $arrayofspecialmainlanguages = array(
1473 if (!empty($websitepagefile)) {
1474 $websitepagefileshort = basename($websitepagefile);
1475 if ($websitepagefileshort ==
'index.php') {
1476 $pageid = $website->fk_default_home;
1478 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), $websitepagefileshort);
1481 $tmppage->fetch($pageid);
1486 if (!is_array($languagecodes) && $pageid > 0) {
1487 $languagecodes = array();
1489 $sql =
"SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
1490 $sql .=
" FROM ".MAIN_DB_PREFIX.
"website_page as wp";
1491 $sql .=
" WHERE wp.fk_website = ".((int) $website->id);
1492 $sql .=
" AND (wp.fk_page = ".((int) $pageid).
" OR wp.rowid = ".((int) $pageid);
1493 if ($tmppage->fk_page > 0) {
1494 $sql .=
" OR wp.fk_page = ".((int) $tmppage->fk_page).
" OR wp.rowid = ".((int) $tmppage->fk_page);
1498 $resql = $this->db->query($sql);
1500 while ($obj = $this->db->fetch_object($resql)) {
1501 $newlang = $obj->lang;
1502 if ($obj->rowid == $pageid) {
1503 $newlang = $obj->lang;
1505 if (!in_array($newlang, $languagecodes)) {
1506 $languagecodes[] = $newlang;
1513 $languagecodeselected = substr($weblangs->defaultlang, 0, 2);
1514 if (!empty($websitepagefile)) {
1515 $pageid = str_replace(array(
'.tpl.php',
'page'), array(
'',
''), basename($websitepagefile));
1517 $pagelang = substr($tmppage->lang, 0, 2);
1518 $languagecodeselected = substr($pagelang, 0, 2);
1519 if (!in_array($pagelang, $languagecodes)) {
1520 $languagecodes[] = $pagelang;
1525 $weblangs->load(
'languages');
1528 $url = $_SERVER[
"REQUEST_URI"];
1529 $url = preg_replace(
'/(\?|&)l=([a-zA-Z_]*)/',
'', $url);
1531 $url .= (preg_match(
'/\?/', $url) ?
'&' :
'?').
'l=';
1532 if (!preg_match(
'/^\//', $url)) {
1537 $MAXHEIGHT = 4 * $HEIGHTOPTION;
1538 $nboflanguage = count($languagecodes);
1540 $out =
'<!-- componentSelectLang'.$htmlname.
' -->'.
"\n";
1543 $out .=
'.componentSelectLang'.$htmlname.
':hover { height: '.min($MAXHEIGHT, ($HEIGHTOPTION * $nboflanguage)).
'px; overflow-x: hidden; overflow-y: '.((($HEIGHTOPTION * $nboflanguage) > $MAXHEIGHT) ?
' scroll' :
'hidden').
'; }'.
"\n";
1544 $out .=
'.componentSelectLang'.$htmlname.
' li { line-height: '.$HEIGHTOPTION.
'px; }'.
"\n";
1545 $out .=
'.componentSelectLang'.$htmlname.
' {
1546 display: inline-block;
1548 height: '.$HEIGHTOPTION.
'px;
1550 transition: all .3s ease;
1552 vertical-align: top;
1554 .componentSelectLang'.$htmlname.
':hover, .componentSelectLang'.$htmlname.
':hover a { background-color: #fff; color: #000 !important; }
1555 ul.componentSelectLang'.$htmlname.
' { width: 150px; }
1556 ul.componentSelectLang'.$htmlname.
':hover .fa { visibility: hidden; }
1557 .componentSelectLang'.$htmlname.
' a { text-decoration: none; width: 100%; }
1558 .componentSelectLang'.$htmlname.
' li { display: block; padding: 0px 15px; margin-left: 0; margin-right: 0; }
1559 .componentSelectLang'.$htmlname.
' li:hover { background-color: #EEE; }
1562 $out .=
'<ul class="componentSelectLang'.$htmlname.($morecss ?
' '.$morecss :
'').
'">';
1564 if ($languagecodeselected) {
1566 if (strlen($languagecodeselected) == 2) {
1567 $languagecodeselected = (empty($arrayofspecialmainlanguages[$languagecodeselected]) ? $languagecodeselected.
'_'.strtoupper($languagecodeselected) : $arrayofspecialmainlanguages[$languagecodeselected]);
1570 $countrycode = strtolower(substr($languagecodeselected, -2));
1571 $label = $weblangs->trans(
"Language_".$languagecodeselected);
1572 if ($countrycode ==
'us') {
1573 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1575 $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>';
1576 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1577 $out .=
'</a></li>';
1580 if (is_array($languagecodes)) {
1581 foreach ($languagecodes as $languagecode) {
1583 if (strlen($languagecode) == 2) {
1584 $languagecode = (empty($arrayofspecialmainlanguages[$languagecode]) ? $languagecode.
'_'.strtoupper($languagecode) : $arrayofspecialmainlanguages[$languagecode]);
1587 if ($languagecode == $languagecodeselected) {
1591 $countrycode = strtolower(substr($languagecode, -2));
1592 $label = $weblangs->trans(
"Language_".$languagecode);
1593 if ($countrycode ==
'us') {
1594 $label = preg_replace(
'/\s*\(.*\)/',
'', $label);
1596 $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>';
1597 if (empty($i) && empty($languagecodeselected)) {
1598 $out .=
'<span class="fa fa-caret-down" style="padding-left: 5px;" />';
1600 $out .=
'</a></li>';
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
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).