diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index df799470b6d..035d0661c95 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -34,9 +34,10 @@ ViewPageInNewTab=View page in new tab SetAsHomePage=Set as Home page RealURL=Real URL ViewWebsiteInProduction=View web site using home URLs -SetHereVirtualHost=If you can create, on your web server (Apache, Nginx, ...), a dedicated Virtual Host with PHP enabled and a Root directory on %s
then enter here the virtual hostname you have created, so the preview can be done also using this direct web server access, and not only using Dolibarr server. -PreviewSiteServedByWebServer=Preview %s in a new tab.

The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:
%s
URL served by external server:
%s -PreviewSiteServedByDolibarr=Preview %s in a new tab.

The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.
URL served by Dolibarr:
%s

To use your own external web server to serve this web site, create a virtual host on your web server that point on directory
%s
then enter the name of this virtual server and click on the other preview button. +SetHereVirtualHost=If you can create, on your web server (Apache, Nginx, ...), a dedicated Virtual Host with PHP enabled and a Root directory on
%s
then enter here the virtual hostname you have created, so the preview can be done also using this dedicated web server access instead of only using Dolibarr server. +CheckVirtualHostPerms=Check also that virtual host has read access on files into
%s +PreviewSiteServedByWebServer=Preview %s in a new tab.

The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:
%s
URL served by external server:
%s +PreviewSiteServedByDolibarr=Preview %s in a new tab.

The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.
URL served by Dolibarr:
%s

To use your own external web server to serve this web site, create a virtual host on your web server that point on directory
%s
then enter the name of this virtual server and click on the other preview button. VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined NoPageYet=No pages yet SyntaxHelp=Help on specific syntax tips diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 77edf7728c3..1b4bd000e38 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1413,29 +1413,37 @@ if (count($object->records) > 0) if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone') { - print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview'); + $urlext=$virtualurl; + $urlint=$urlwithroot.'/public/website/index.php?website='.$website; + + $htmltext = $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot); + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); + print '
'; + print $form->textwithpicto('', $htmltext, 1, 'preview'); print ''; print '
'; print ''; //print ''; - $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); + $htmltext =$langs->trans("SetHereVirtualHost", $dataroot); + $htmltext.='

'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helpvirtualhost'); print '
'; - $urlext=$virtualurl; - $urlint=$urlwithroot.'/public/website/index.php?website='.$website; if (empty($object->fk_default_home)) { + $htmltext = ''.$langs->trans("YouMustDefineTheHomePage").'
'.$langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''); + $htmltext.='

'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', ''.$langs->trans("YouMustDefineTheHomePage").'
'.$langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''), 1, 'preview_ext'); + print $form->textwithpicto('', $htmltext, 1, 'preview_ext'); print '
'; } else { + $htmltext = $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''); + $htmltext.='

'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''), 1, 'preview_ext'); + print $form->textwithpicto('', $htmltext, 1, 'preview_ext'); print ''; } } @@ -1585,8 +1593,11 @@ if (count($object->records) > 0) $realpage=$urlwithroot.'/public/website/index.php?website='.$website.'&pageref='.$websitepage->pageurl; $pagealias = $websitepage->pageurl; - print 'transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); + $htmltext = $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot); + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); + + print '
'; + print $form->textwithpicto('', $htmltext, 1, 'preview'); print ''; // View page in new Tab print '
'; @@ -1597,8 +1608,11 @@ if (count($object->records) > 0) $urlext=$virtualurl.'/'.$pagealias.'.php'; $urlint=$urlwithroot.'/public/website/index.php?website='.$website; - print 'transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $virtualurl?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''), 1, 'preview_ext'); + + $htmltext = $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $virtualurl?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''); + + print ''; + print $form->textwithpicto('', $htmltext, 1, 'preview_ext'); print ''; //print ''; @@ -1884,7 +1898,9 @@ if ($action == 'createsite') print ''; print ''; - print $form->textwithpicto($langs->trans('Virtualhost'), $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/websiteref'), 1, 'help', '', 0, 2, 'tooltipvirtual'); + $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/websiteref'); + $htmltext.='

'.$langs->trans("CheckVirtualHostPerms", DOL_DOCUMENT_ROOT); + print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'tooltipvirtual'); print ''; print ''; print '';