dolibarr 19.0.3
website2.lib.php File Reference

Library for website module (rare functions not required for execution of website) More...

Go to the source code of this file.

Functions

 dolSaveMasterFile ($filemaster)
 Save content of a page on disk.
 
 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).
 
 dolSaveIndexPage ($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object=null)
 Save content of the index.php and/or the wrapper.php page.
 
 dolSaveHtmlHeader ($filehtmlheader, $htmlheadercontent)
 Save content of a page on disk.
 
 dolSaveCssFile ($filecss, $csscontent)
 Save content of a page on disk.
 
 dolSaveJsFile ($filejs, $jscontent)
 Save content of a page on disk.
 
 dolSaveRobotFile ($filerobot, $robotcontent)
 Save content of a page on disk.
 
 dolSaveHtaccessFile ($filehtaccess, $htaccess)
 Save content of a page on disk.
 
 dolSaveManifestJson ($file, $content)
 Save content of a page on disk.
 
 dolSaveReadme ($file, $content)
 Save content of a page on disk.
 
 dolSaveLicense ($file, $content)
 Save content of a page on disk.
 
 showWebsiteTemplates (Website $website)
 Show list of themes.
 
 checkPHPCode ($phpfullcodestringold, $phpfullcodestring)
 Check a new string containing only php code (including <php tag)
 

Detailed Description

Library for website module (rare functions not required for execution of website)

Definition in file website2.lib.php.

Function Documentation

◆ checkPHPCode()

checkPHPCode ( $phpfullcodestringold,
$phpfullcodestring )

Check a new string containing only php code (including <php tag)

  • Block if bad code in the new string.
  • Block also if user has no permission to change PHP code.
Parameters
string$phpfullcodestringoldPHP old string. For exemple "<?php echo 'a' ?><php echo 'b' ?>"
string$phpfullcodestringPHP new string. For exemple "<?php echo 'a' ?><php echo 'c' ?>"
Returns
int Error or not
See also
dolKeepOnlyPhpCode()

Definition at line 659 of file website2.lib.php.

References dol_is_file(), getDolGlobalString(), and setEventMessages().

◆ dolSaveCssFile()

dolSaveCssFile ( $filecss,
$csscontent )

Save content of a page on disk.

Parameters
string$filecssFull path of filename to generate
string$csscontentContent of file
Returns
boolean True if OK

Definition at line 399 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveHtaccessFile()

dolSaveHtaccessFile ( $filehtaccess,
$htaccess )

Save content of a page on disk.

Parameters
string$filehtaccessFull path of filename to generate
string$htaccessContent of file
Returns
boolean True if OK

Definition at line 459 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveHtmlHeader()

dolSaveHtmlHeader ( $filehtmlheader,
$htmlheadercontent )

Save content of a page on disk.

Parameters
string$filehtmlheaderFull path of filename to generate
string$htmlheadercontentContent of file
Returns
boolean True if OK

Definition at line 379 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveIndexPage()

dolSaveIndexPage ( $pathofwebsite,
$fileindex,
$filetpl,
$filewrapper,
$object = null )

Save content of the index.php and/or the wrapper.php page.

Parameters
string$pathofwebsitePath of website root
string$fileindexFull path of file index.php
string$filetplFile tpl the index.php page redirect to (used only if $fileindex is provided)
string$filewrapperFull path of file wrapper.php
Website$objectObject website
Returns
boolean True if OK

Definition at line 290 of file website2.lib.php.

References dol_delete_file(), dol_mkdir(), dol_syslog(), dolChmod(), and getDolGlobalString().

Referenced by Website\createFromClone(), Website\importWebSite(), and Website\rebuildWebSiteFiles().

◆ dolSaveJsFile()

dolSaveJsFile ( $filejs,
$jscontent )

Save content of a page on disk.

For example into documents/website/mywebsite/javascript.js.php file.

Parameters
string$filejsFull path of filename to generate
string$jscontentContent of file
Returns
boolean True if OK

Definition at line 419 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveLicense()

dolSaveLicense ( $file,
$content )

Save content of a page on disk.

Parameters
string$fileFull path of filename to generate
string$contentContent of file
Returns
boolean True if OK

Definition at line 519 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveManifestJson()

dolSaveManifestJson ( $file,
$content )

Save content of a page on disk.

Parameters
string$fileFull path of filename to generate
string$contentContent of file
Returns
boolean True if OK

Definition at line 479 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveMasterFile()

dolSaveMasterFile ( $filemaster)

Save content of a page on disk.

Parameters
string$filemasterFull path of filename master.inc.php for website to generate
Returns
boolean True if OK

Definition at line 32 of file website2.lib.php.

References dol_delete_file(), dol_syslog(), and dolChmod().

Referenced by Website\importWebSite().

◆ dolSavePageAlias()

dolSavePageAlias ( $filealias,
$object,
$objectpage )

Save an alias page on disk (A page that include the reference page).

It saves file into the root directory but also into language subdirectory.

Parameters
string$filealiasFull path of filename to generate
Website$objectObject website
WebsitePage$objectpageObject websitepage
Returns
boolean True if OK
See also
dolSavePageContent()

Definition at line 63 of file website2.lib.php.

References dol_syslog(), dolChmod(), and getDolGlobalString().

Referenced by Website\createFromClone(), Website\importWebSite(), and Website\rebuildWebSiteFiles().

◆ dolSavePageContent()

dolSavePageContent ( $filetpl,
Website $object,
WebsitePage $objectpage,
$backupold = 0 )

Save content of a page on disk (page name is generally ID_of_page.php).

Page contents are always saved into "root" directory. Only aliases pages saved with dolSavePageAlias() can be in root or language subdir.

Parameters
string$filetplFull path of filename to generate
Website$objectObject website
WebsitePage$objectpageObject websitepage
int$backupold1=Make a backup of old page
Returns
boolean True if OK
See also
dolSavePageAlias()

Definition at line 141 of file website2.lib.php.

References dol_delete_file(), dol_is_file(), dol_move(), dol_print_error(), dol_syslog(), dolChmod(), and getDolGlobalString().

Referenced by Website\createFromClone(), Website\importWebSite(), and Website\rebuildWebSiteFiles().

◆ dolSaveReadme()

dolSaveReadme ( $file,
$content )

Save content of a page on disk.

Parameters
string$fileFull path of filename to generate
string$contentContent of file
Returns
boolean True if OK

Definition at line 499 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ dolSaveRobotFile()

dolSaveRobotFile ( $filerobot,
$robotcontent )

Save content of a page on disk.

Parameters
string$filerobotFull path of filename to generate
string$robotcontentContent of file
Returns
boolean True if OK

Definition at line 439 of file website2.lib.php.

References dol_mkdir(), dol_syslog(), and dolChmod().

◆ showWebsiteTemplates()

showWebsiteTemplates ( Website $website)

Show list of themes.

Show all thumbs of themes/skins

Parameters
Website$websiteObject website to load the template into
Returns
void

Definition at line 538 of file website2.lib.php.

References dol_filemtime(), dol_filesize(), dol_print_date(), getAdvancedPreviewUrl(), getDolGlobalInt(), and img_picto().