Enhance logs

This commit is contained in:
Laurent Destailleur 2019-08-13 06:52:07 +02:00
parent 277a693c16
commit 7891c8d856
2 changed files with 5 additions and 4 deletions

View File

@ -29,14 +29,15 @@
* @param Website $website Web site object
* @param string $content Content to replace
* @param int $removephppart 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
* @param string $contenttype Content type
* @return boolean True if OK
* @see dolWebsiteOutput() for function used to replace content in a web server context
*/
function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0)
function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype='html')
{
$nbrep = 0;
dol_syslog('dolWebsiteReplacementOfLinks start', LOG_DEBUG);
dol_syslog('dolWebsiteReplacementOfLinks start (contenttype='.$contenttype." USEDOLIBARRSERVER=".(defined('USEDOLIBARRSERVER')?'1':'')." USEDOLIBARREDITOR=".(defined('USEDOLIBARREDITOR')?'1':'').')', LOG_DEBUG);
// Replace php code. Note $content may come from database and does not contains body tags.
$replacewith='...php...';

View File

@ -3154,7 +3154,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
}*/
$out.="\n<html><head>\n";
$out.="<!-- htmlheader/style of page from database -->\n";
$out.=dolWebsiteReplacementOfLinks($object, $objectpage->htmlheader, 1);
$out.=dolWebsiteReplacementOfLinks($object, $objectpage->htmlheader, 1, 'htmlheader');
$out.="</head>\n";
$out.="\n<body>";
@ -3172,7 +3172,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
include $filecss;
$csscontent = ob_get_contents();
ob_end_clean();
$tmpout.= dolWebsiteReplacementOfLinks($object, $csscontent, 1);
$tmpout.= dolWebsiteReplacementOfLinks($object, $csscontent, 1, 'css');
$tmpout.= '/* Include style from the HTML header of page */'."\n";
// Clean the html header of page to get only <style> content
$tmp = preg_split('(<style[^>]*>|</style>)', $objectpage->htmlheader);