Add website url form

This commit is contained in:
lmarcouiller 2021-02-10 10:41:13 +01:00
parent 0250baa0fe
commit 484b406985
2 changed files with 23 additions and 3 deletions

View File

@ -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
GeneratedSitemapsFiles = Generated sitemap files
EnterWebsiteUrl= Enter your website URL

View File

@ -2471,7 +2471,10 @@ if (!GETPOST('hide_websitemenu'))
print '   ';
print dolButtonToOpenUrlInDialogPopup('generate_sitemap', $langs->transnoentitiesnoconv("GenerateSitemaps"), '<span class="fa fa-sitemap"><span>', '/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"), '<span class="fa fa-sitemap"><span>', '/website/index.php?action=generatesitemapsdomainname&website='.$website->ref, $disabled);
}
print ' &nbsp; ';
@ -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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="text/plain">';
print '<input type="hidden" name="token" value="'.$token.'">';
print '<input type="hidden" name="action" value="generatesitemaps">';
print '<input type="hidden" name="website" value="'.$website->ref.'">';
print '<div class="fiche center"><br>';
print '<div class="titre inline-block">'.$langs->trans('EnterWebsiteUrl').'</div><br>';
print '<input id ="domainname" type="text" name="domainname" value="">'.$form->textwithpicto('', $langs->trans("Exemple").': www.exemple.com').'<br><br>';
print '<input type="submit" class="button" name="buttonreplacesitesearch" value="'.dol_escape_htmltag($langs->trans("Next")).'">';
print '</div>';
print '</form>';
}
// 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";