From 22df7d7a68291f24464d4b97d3be21896eb4ed80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Sep 2016 23:42:17 +0200 Subject: [PATCH] Work on module website --- htdocs/langs/en_US/website.lang | 3 +++ htdocs/websites/index.php | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index bb86be1620c..463d1c9e81e 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -12,6 +12,7 @@ EditMenu=Edit menu EditPageMeta=Edit Meta EditPageContent=Edit Content Website=Web site +Webpage=Web page AddPage=Add page PreviewOfSiteNotYetAvailable=Preview of your website %s not yet available. You must first add a page. RequestedPageHasNoContentYet=Requested page with id %s has not content yet or cache file .tpl.php was removed. Edit content of page to solve this. @@ -23,3 +24,5 @@ SetAsHomePage=Set as Home page RealURL=Real URL ViewWebsiteInProduction=View web site using home URLs SetHereVirtualHost=If you can set, on your web server, a dedicated virtual host with a root directory on %s, define here the virtual hostname 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 instal and setup this server before.
URL of %s 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 using path of your Dolibarr.
URL of %s served by Dolibarr:
%s diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 60ec0475d71..230f2d5a017 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -622,12 +622,14 @@ if (count($object->records) > 0) print $form->textwithpicto('', $htmltext); print ''; - print ''; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer"), 1, 'preview_ext'); + $urlext=$realurl; + $urlint=DOL_URL_ROOT.'/public/websites/index.php?website='.$website; + print ''; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlext), 1, 'preview_ext'); print ''; print ''; - print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr"), 1, 'preview'); + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlint), 1, 'preview'); print ''; } @@ -732,16 +734,17 @@ if (count($object->records) > 0) print '
'; print ''; //print ''; - $htmltext=$langs->trans("PageAlias", $pagealias); + $htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias); print $form->textwithpicto('', $htmltext); print '
'; - print ''; - print $form->textwithpicto('', $langs->trans("PreviewPageServedByWebServer"), 1, 'preview_ext'); + $urlext=$realurl.'/'.$pagealias.'.php'; + print ''; + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $urlext), 1, 'preview_ext'); print ''; print ''; - print $form->textwithpicto('', $langs->trans("PreviewPageServedByDolibarr"), 1, 'preview'); + print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage), 1, 'preview'); print ''; // View page in new Tab //print ''; @@ -819,9 +822,10 @@ if ($action == 'editcss') dol_fiche_head(); + print ''."\n"; print ''; - print '
'; + print '
'; print $langs->trans('WebSite'); print ''; print $website; @@ -858,6 +862,7 @@ if ($action == 'editmeta' || $action == 'create') dol_fiche_head(); + print ''."\n"; print ''; if ($action != 'create') @@ -877,7 +882,7 @@ if ($action == 'editmeta' || $action == 'create') if (GETPOST('WEBSITE_DESCRIPTION')) $pagedescription=GETPOST('WEBSITE_DESCRIPTION'); if (GETPOST('WEBSITE_KEYWORDS')) $pagekeywords=GETPOST('WEBSITE_KEYWORDS'); - print '
'; + print '
'; print $langs->trans('WEBSITE_PAGENAME'); print ''; print ''; @@ -912,11 +917,13 @@ if ($action == 'editmeta' || $action == 'create') if ($action == 'editmedia') { + print ''."\n"; print '
'.$langs->trans("FeatureNotYetAvailable").''; } if ($action == 'editmenu') { + print ''."\n"; print '
'.$langs->trans("FeatureNotYetAvailable").''; }