dolibarr  9.0.0
Functions
website.lib.php File Reference

Library for website module. More...

Go to the source code of this file.

Functions

 dolWebsiteReplacementOfLinks ($website, $content, $removephppart=0)
 Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content. More...
 
 dolStripPhpCode ($str, $replacewith='')
 Remove PHP code part from a string. More...
 
 dolWebsiteOutput ($content)
 Render a string of an HTML content and output it. More...
 
 redirectToContainer ($containerref, $containeraliasalt='', $containerid=0)
 Format img tags to introduce viewimage on img src. More...
 
 includeContainer ($containerref)
 Clean an HTML page to report only content, so we can include it into another page. More...
 
 getAllImages ($object, $objectpage, $urltograb, &$tmp, &$action, $modifylinks=0, $grabimages=1, $grabimagesinto='subpage')
 Download all images found into page content $tmp. More...
 
 dolSaveMasterFile ($filemaster)
 Save content of a page on disk. More...
 
 dolSavePageAlias ($filealias, $object, $objectpage)
 Save content of a page on disk. More...
 
 dolSavePageContent ($filetpl, $object, $objectpage)
 Save content of a page on disk. More...
 
 dolSaveIndexPage ($pathofwebsite, $fileindex, $filetpl, $filewrapper)
 Save content of the index.php and 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...
 

Detailed Description

Library for website module.

Definition in file website.lib.php.

Function Documentation

◆ 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 789 of file website.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 870 of file website.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 762 of file website.lib.php.

◆ dolSaveIndexPage()

dolSaveIndexPage (   $pathofwebsite,
  $fileindex,
  $filetpl,
  $filewrapper 
)

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

Parameters
string$pathofwebsitePath of website root
string$fileindexFull path of file index.php
string$filetplFile tpl to index.php page redirect to
string$filewrapperFull path of file wrapper.php
Returns
boolean True if OK

Definition at line 718 of file website.lib.php.

◆ dolSaveJsFile()

dolSaveJsFile (   $filejs,
  $jscontent 
)

Save content of a page on disk.

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

Definition at line 816 of file website.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 593 of file website.lib.php.

◆ dolSavePageAlias()

dolSavePageAlias (   $filealias,
  $object,
  $objectpage 
)

Save content of a page on disk.

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

Definition at line 620 of file website.lib.php.

◆ dolSavePageContent()

dolSavePageContent (   $filetpl,
  $object,
  $objectpage 
)

Save content of a page on disk.

Parameters
string$filetplFull path of filename to generate
Website$objectObject website
WebsitePage$objectpageObject websitepage
Returns
boolean True if OK

Definition at line 650 of file website.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 843 of file website.lib.php.

◆ dolStripPhpCode()

dolStripPhpCode (   $str,
  $replacewith = '' 
)

Remove PHP code part from a string.

Parameters
string$strString to clean
string$replacewithString to use as replacement
Returns
string Result string without php code

Definition at line 105 of file website.lib.php.

◆ dolWebsiteOutput()

dolWebsiteOutput (   $content)

Render a string of an HTML content and output it.

Used to ouput the page when viewed from server (Dolibarr or Apache).

Parameters
string$contentContent string
Returns
void
See also
dolWebsiteReplacementOfLinks for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on

Definition at line 145 of file website.lib.php.

◆ dolWebsiteReplacementOfLinks()

dolWebsiteReplacementOfLinks (   $website,
  $content,
  $removephppart = 0 
)

Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content.

Used to ouput the page on the Preview from backoffice.

Parameters
Website$websiteWeb site object
string$contentContent to replace
int$removephppart0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
Returns
boolean True if OK
See also
dolWebsiteOutput for function used to replace content in a web server context

Definition at line 36 of file website.lib.php.

◆ getAllImages()

getAllImages (   $object,
  $objectpage,
  $urltograb,
$tmp,
$action,
  $modifylinks = 0,
  $grabimages = 1,
  $grabimagesinto = 'subpage' 
)

Download all images found into page content $tmp.

If $modifylinks is set, links to images will be replace with a link to viewimage wrapper.

Parameters
Website$objectObject website
WebsitePage$objectpageObject website page
string$urltograbURL to grab (exemple: http://www.nltechno.com/ or http://www.nltechno.com/dir1/ or http://www.nltechno.com/dir1/mapage1)
string$tmpContent to parse
string$actionVar $action
string$modifylinks0=Do not modify content, 1=Replace links with a link to viewimage
int$grabimages0=Do not grab images, 1=Grab images
string$grabimagesinto'root' or 'subpage'
Returns
void

Definition at line 415 of file website.lib.php.

◆ includeContainer()

includeContainer (   $containerref)

Clean an HTML page to report only content, so we can include it into another page.

It outputs content of file sanitized from html and body part.

Parameters
string$containerrefPath to file to include (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php')
Returns
void

Definition at line 360 of file website.lib.php.

◆ redirectToContainer()

redirectToContainer (   $containerref,
  $containeraliasalt = '',
  $containerid = 0 
)

Format img tags to introduce viewimage on img src.

Parameters
string$contentContent string
Returns
void
See also
dolWebsiteOutput Make a redirect to another container.
Parameters
string$containerrefRef of container to redirect to (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php').
string$containeraliasaltRef of alternative aliases to redirect to.
int$containeridId of container.
Returns
void

Definition at line 280 of file website.lib.php.