dolibarr 18.0.6
|
Library for website module. More...
Go to the source code of this file.
Functions | |
dolStripPhpCode ($str, $replacewith='') | |
Remove PHP code part from a string. | |
dolKeepOnlyPhpCode ($str) | |
Keep only PHP code part from a HTML string page. | |
dolWebsiteReplacementOfLinks ($website, $content, $removephppart=0, $contenttype='html', $containerid='') | |
Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content. | |
dolReplaceSmileyCodeWithUTF8 ($content) | |
Converts smiley string into the utf8 sequence. | |
dolWebsiteOutput ($content, $contenttype='html', $containerid='') | |
Render a string of an HTML content and output it. | |
dolWebsiteIncrementCounter ($websiteid, $websitepagetype, $websitepageid) | |
Increase the website counter of page access. | |
redirectToContainer ($containerref, $containeraliasalt='', $containerid=0, $permanent=0) | |
Format img tags to introduce viewimage on img src. | |
includeContainer ($containerref) | |
Clean an HTML page to report only content, so we can include it into another page. | |
getStructuredData ($type, $data=array()) | |
Return HTML content to add structured data for an article, news or Blog Post. | |
getSocialNetworkHeaderCards ($params=null) | |
Return HTML content to add as header card for an article, news or Blog Post or home page. | |
getSocialNetworkSharingLinks () | |
Return HTML content to add structured data for an article, news or Blog Post. | |
getPagesFromSearchCriterias ($type, $algo, $searchstring, $max=25, $sortfield='date_creation', $sortorder='DESC', $langcode='', $otherfilters='null', $status=1) | |
Return list of containers object that match a criteria. | |
getAllImages ($object, $objectpage, $urltograb, &$tmp, &$action, $modifylinks=0, $grabimages=1, $grabimagesinto='subpage') | |
Download all images found into page content $tmp. | |
Library for website module.
Definition in file website.lib.php.
dolKeepOnlyPhpCode | ( | $str | ) |
Keep only PHP code part from a HTML string page.
string | $str | String to clean |
Definition at line 76 of file website.lib.php.
dolReplaceSmileyCodeWithUTF8 | ( | $content | ) |
Converts smiley string into the utf8 sequence.
string | $content | Content to replace |
Definition at line 229 of file website.lib.php.
Referenced by dolWebsiteOutput().
dolStripPhpCode | ( | $str, | |
$replacewith = '' ) |
Remove PHP code part from a string.
string | $str | String to clean |
string | $replacewith | String to use as replacement |
Definition at line 32 of file website.lib.php.
Referenced by dolWebsiteReplacementOfLinks(), and getStructuredData().
dolWebsiteIncrementCounter | ( | $websiteid, | |
$websitepagetype, | |||
$websitepageid ) |
Increase the website counter of page access.
int | $websiteid | ID of website |
string | $websitepagetype | Type of page ('blogpost', 'page', ...) |
int | $websitepageid | ID of page |
Definition at line 441 of file website.lib.php.
References dol_getdate(), dol_mktime(), dol_now(), and getDolGlobalInt().
dolWebsiteOutput | ( | $content, | |
$contenttype = 'html', | |||
$containerid = '' ) |
Render a string of an HTML content and output it.
Used to ouput the page when viewed from a server (Dolibarr or Apache).
string | $content | Content string |
string | $contenttype | Content type |
int | $containerid | Contenair id |
Definition at line 280 of file website.lib.php.
References dol_syslog(), and dolReplaceSmileyCodeWithUTF8().
dolWebsiteReplacementOfLinks | ( | $website, | |
$content, | |||
$removephppart = 0, | |||
$contenttype = 'html', | |||
$containerid = '' ) |
Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content.
It replaces also dynamic content with '...php...' Used to ouput the page on the Preview from backoffice.
Website | $website | Web site object |
string | $content | Content to replace |
int | $removephppart | 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections. |
string | $contenttype | Content type |
int | $containerid | Contenair id |
Definition at line 121 of file website.lib.php.
References dol_syslog(), and dolStripPhpCode().
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.
Website | $object | Object website |
WebsitePage | $objectpage | Object website page |
string | $urltograb | URL to grab (exemple: http://www.nltechno.com/ or http://www.nltechno.com/dir1/ or http://www.nltechno.com/dir1/mapage1) |
string | $tmp | Content to parse |
string | $action | Var $action |
string | $modifylinks | 0=Do not modify content, 1=Replace links with a link to viewimage |
int | $grabimages | 0=Do not grab images, 1=Grab images |
string | $grabimagesinto | 'root' or 'subpage' |
Definition at line 1147 of file website.lib.php.
References dol_mkdir(), dol_syslog(), dolChmod(), getRootURLFromURL(), getURLContent(), and setEventMessages().
getPagesFromSearchCriterias | ( | $type, | |
$algo, | |||
$searchstring, | |||
$max = 25, | |||
$sortfield = 'date_creation', | |||
$sortorder = 'DESC', | |||
$langcode = '', | |||
$otherfilters = 'null', | |||
$status = 1 ) |
Return list of containers object that match a criteria.
WARNING: This function can be used by websites.
string | $type | Type of container to search into (Example: '', 'page', 'blogpost', 'page,blogpost', ...) |
string | $algo | Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,...') |
string | $searchstring | Search string |
int | $max | Max number of answers |
string | $sortfield | Sort Fields |
string | $sortorder | Sort order ('DESC' or 'ASC') |
string | $langcode | Language code ('' or 'en', 'fr', 'es', ...) |
array | $otherfilters | Other filters |
int | $status | 0 or 1, or -1 for both |
Definition at line 982 of file website.lib.php.
References dol_strlen().
getSocialNetworkHeaderCards | ( | $params = null | ) |
Return HTML content to add as header card for an article, news or Blog Post or home page.
array | $params | Array of parameters |
Definition at line 839 of file website.lib.php.
getSocialNetworkSharingLinks | ( | ) |
Return HTML content to add structured data for an article, news or Blog Post.
Definition at line 913 of file website.lib.php.
References dol_escape_htmltag().
getStructuredData | ( | $type, | |
$data = array() ) |
Return HTML content to add structured data for an article, news or Blog Post.
Use the json-ld format. Example: <?php getStructureData('blogpost'); ?> <?php getStructureData('software', array('name'=>'Name', 'os'=>'Windows', 'price'=>10)); ?>
string | $type | 'blogpost', 'product', 'software', 'organization', 'qa', ... |
array | $data | Array of data parameters for structured data |
Definition at line 634 of file website.lib.php.
References dol_escape_json(), dol_print_date(), dol_string_nohtmltag(), and dolStripPhpCode().
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.
string | $containerref | Path to file to include (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php') |
Definition at line 580 of file website.lib.php.
redirectToContainer | ( | $containerref, | |
$containeraliasalt = '', | |||
$containerid = 0, | |||
$permanent = 0 ) |
Format img tags to introduce viewimage on img src.
string | $content | Content string |
string | $containerref | Ref of container to redirect to (Example: 'mypage' or 'mypage.php'). |
string | $containeraliasalt | Ref of alternative aliases to redirect to. |
int | $containerid | Id of container. |
int | $permanent | 0=Use temporary redirect 302, 1=Use permanent redirect 301 |
Definition at line 504 of file website.lib.php.
References setEventMessages().