Debug module website
This commit is contained in:
parent
522f21e528
commit
302ee97d31
@ -62,8 +62,9 @@ function dolWebsiteOutput($content)
|
||||
{
|
||||
global $website;
|
||||
|
||||
// Replace relative link with dolibarr URL
|
||||
// Replace relative link / with dolibarr URL
|
||||
$content=preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageid='.$website->fk_default_home.'"', $content, -1, $nbrep);
|
||||
// Replace relative link /xxx.php with dolibarr URL
|
||||
$content=preg_replace('/(href=")\/?([^\"]*)(\.php\")/', '\1'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website->ref.'&pageref=\2"', $content, -1, $nbrep);
|
||||
}
|
||||
|
||||
|
||||
@ -19,9 +19,9 @@ AddPage=Add page
|
||||
HomePage=Home Page
|
||||
PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page.
|
||||
RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this.
|
||||
PageContent=Page/Content
|
||||
PageDeleted=Page/Content '%s' of website %s deleted
|
||||
PageAdded=Page/Content '%s' added
|
||||
PageContent=Page/Contenair
|
||||
PageDeleted=Page/Contenair '%s' of website %s deleted
|
||||
PageAdded=Page/Contenair '%s' added
|
||||
ViewSiteInNewTab=View site in new tab
|
||||
ViewPageInNewTab=View page in new tab
|
||||
SetAsHomePage=Set as Home page
|
||||
@ -33,4 +33,4 @@ PreviewSiteServedByDolibarr=Preview %s in a new tab.<br><br>The %s will be serve
|
||||
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
|
||||
NoPageYet=No pages yet
|
||||
SyntaxHelp=Help on code syntax
|
||||
YouCanEditHtmlSource=You can edit HTML source code using the "Source" button in editor. You can also include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Content with the following syntax: <strong><?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?></strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong><a href="/document.php?modulepart=medias&file=filename.ext"></strong>.
|
||||
YouCanEditHtmlSource=You can edit HTML source code using the "Source" button in editor. You can also include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax: <strong><?php dolIncludeHtmlContent($websitekey.'/contentaliastoinclude.php'); ?></strong><br><br>To include a link to download a file stored into the documents/medias directory, use syntax:<br><strong><a href="/document.php?modulepart=medias&file=filename.ext"></strong>.
|
||||
|
||||
@ -1176,8 +1176,10 @@ if ($action == 'preview')
|
||||
// Replace php code. Note $objectpage->content come from database and does not contains body tags.
|
||||
$content = preg_replace('/<\?php.*\?>/ims', '<span style="background: #ddd; border: 1px solid #ccc; border-radius: 4px;">...php...</span>', $objectpage->content);
|
||||
|
||||
// Replace internal relative links with Dolibarr links
|
||||
// TODO
|
||||
// Replace relative link / with dolibarr URL
|
||||
$content = preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/websites/index.php?website='.$object->ref.'&pageid='.$object->fk_default_home.'"', $content, -1, $nbrep);
|
||||
// Replace relative link /xxx.php with dolibarr URL
|
||||
$content = preg_replace('/(href=")\/?([^\"]*)(\.php\")/', '\1'.DOL_URL_ROOT.'/websites/index.php?website='.$object->ref.'&pageref=\2"', $content, -1, $nbrep);
|
||||
|
||||
|
||||
$out.=$content."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user