From 484b406985803487f9db30d9464c81e396a681fa Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 10 Feb 2021 10:41:13 +0100 Subject: [PATCH] Add website url form --- htdocs/langs/en_US/website.lang | 5 +++-- htdocs/website/index.php | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 27501c072fd..f59c7d23697 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -137,6 +137,7 @@ PagesRegenerated=%s page(s)/container(s) regenerated RegenerateWebsiteContent=Regenerate web site cache files AllowedInFrames=Allowed in Frames DefineListOfAltLanguagesInWebsiteProperties=Define list of all available languages into web site properties. -GenerateSitemaps=Generate web site sitemap file +GenerateSitemaps=Generate website sitemap file BackToPreview= Back to preview -GeneratedSitemapsFiles = Generated sitemap files \ No newline at end of file +GeneratedSitemapsFiles = Generated sitemap files +EnterWebsiteUrl= Enter your website URL diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b29a1419e5c..d5459094737 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2471,7 +2471,10 @@ if (!GETPOST('hide_websitemenu')) print '   '; - print dolButtonToOpenUrlInDialogPopup('generate_sitemap', $langs->transnoentitiesnoconv("GenerateSitemaps"), '', '/website/index.php?action=generatesitemaps&website='.$website->ref, $disabled); + if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) + { + print dolButtonToOpenUrlInDialogPopup('generate_sitemap', $langs->transnoentitiesnoconv("GenerateSitemaps"), '', '/website/index.php?action=generatesitemapsdomainname&website='.$website->ref, $disabled); + } print '   '; @@ -3800,8 +3803,24 @@ if ($action == 'editmeta' || $action == 'createcontainer') // Edit properties of $domainname = '0.0.0.0:8080'; $tempdir = $conf->website->dir_temp.'/'.$websitekey.'/'; +if ($action == 'generatesitemapsdomainname'){ + print '
'; + print ''; + print ''; + print ''; + print '

'; + print '
'.$langs->trans('EnterWebsiteUrl').'

'; + print ''.$form->textwithpicto('', $langs->trans("Exemple").': www.exemple.com').'

'; + print ''; + print '
'; + print '
'; +} + // Generate web site sitemaps if ($action == 'generatesitemaps') { + if (!empty($_POST['domainname'])) { + $domainname = $_POST['domainname']; + } $container_array = array(); $sql = "SELECT wp.type_container , wp.pageurl, wp.lang, DATE(wp.tms) as tms"; $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp";