dolibarr  20.0.0-beta
Functions
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. More...
 
 dolSavePageAlias ($filealias, $object, $objectpage)
 Save an alias page on disk (A page that include the reference page). More...
 
 dolSavePageContent ($filetpl, Website $object, WebsitePage $objectpage, $backupold=0)
 Save content of a page on disk (page name is generally ID_of_page.php). More...
 
 dolSaveIndexPage ($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object=null)
 Save content of the index.php and/or the wrapper.php page. More...
 
 dolSaveHtmlHeader ($filehtmlheader, $htmlheadercontent)
 Save content of a page on disk. More...
 
 dolSaveCssFile ($filecss, $csscontent)
 Save content of a page on disk. More...
 
 dolSaveJsFile ($filejs, $jscontent)
 Save content of a page on disk. More...
 
 dolSaveRobotFile ($filerobot, $robotcontent)
 Save content of a page on disk. More...
 
 dolSaveHtaccessFile ($filehtaccess, $htaccess)
 Save content of a page on disk. More...
 
 dolSaveManifestJson ($file, $content)
 Save content of a page on disk. More...
 
 dolSaveReadme ($file, $content)
 Save content of a page on disk. More...
 
 dolSaveLicense ($file, $content)
 Save content of a page on disk. More...
 
 showWebsiteTemplates (Website $website)
 Show list of themes. More...
 
 checkPHPCode (&$phpfullcodestringold, &$phpfullcodestring)
 Check a new string containing only php code (including <php tag) More...
 

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 (before the change). For example "<?php echo 'a' ?><php echo 'b' ?>"
string$phpfullcodestringPHP new string. For example "<?php echo 'a' ?><php echo 'c' ?>"
Returns
int Error or not
See also
dolKeepOnlyPhpCode()

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

◆ 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 411 of file website2.lib.php.

◆ 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 471 of file website2.lib.php.

◆ 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 391 of file website2.lib.php.

◆ 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 302 of file website2.lib.php.

◆ 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 431 of file website2.lib.php.

◆ 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 531 of file website2.lib.php.

◆ 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 491 of file website2.lib.php.

◆ 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 31 of file website2.lib.php.

◆ 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 61 of file website2.lib.php.

◆ 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 139 of file website2.lib.php.

◆ 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 511 of file website2.lib.php.

◆ 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 451 of file website2.lib.php.

◆ 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 550 of file website2.lib.php.