This commit is contained in:
Laurent Destailleur 2019-05-28 16:10:11 +02:00
parent 1c3f519b1a
commit cd32734c58

View File

@ -56,6 +56,7 @@ $type_container=GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha');
$section_dir = GETPOST('section_dir', 'alpha');
$file_manager = GETPOST('file_manager', 'alpha');
$replacesite = GETPOST('replacesite', 'alpha');
if (GETPOST('deletesite', 'alpha')) { $action='deletesite'; }
if (GETPOST('delete', 'alpha')) { $action='delete'; }
@ -73,6 +74,7 @@ if (GETPOST('importsite', 'alpha')) { $action='importsite'; }
if (GETPOST('createfromclone', 'alpha')) { $action='createfromclone'; }
if (GETPOST('createpagefromclone', 'alpha')) { $action='createpagefromclone'; }
if (empty($action) && $file_manager) $action='file_manager';
if (empty($action) && $replacesite) $action='replacesite';
// Load variable for pagination
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
@ -1745,6 +1747,10 @@ if ($action == 'file_manager')
{
print '<input type="hidden" name="action" value="file_manager">';
}
if ($action == 'replacesite')
{
print '<input type="hidden" name="action" value="replacesite">';
}
print '<div>';
@ -1817,9 +1823,7 @@ if (! GETPOST('hide_websitemenu'))
print ' &nbsp; ';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ExportSite")).'" name="exportsite">';
if (! $atleastonepage)
{
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ImportSite")).'" name="importsite">';
@ -1829,11 +1833,16 @@ if (! GETPOST('hide_websitemenu'))
print '<input type="submit" class="button nobordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("ImportSite")).'" name="importsite">';
}
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("ExportSite")).'" name="exportsite">';
print '<input type="submit" class="buttonDelete" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage?' disabled="disabled"':'').'>';
print ' &nbsp; ';
print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=file_manager&website='.$website->ref.'" class="button nobordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("MediaFiles")).'"><span class="fa fa-image"><span></a>';
//print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
/*print '<a class="button button_file_manager"'.$disabled.'>'.dol_escape_htmltag($langs->trans("MediaFiles")).'</a>';
print '<script language="javascript">
jQuery(document).ready(function () {
@ -1851,6 +1860,9 @@ if (! GETPOST('hide_websitemenu'))
});
</script>';
*/
//print '<input type="submit" class="button nobordertransp"'.$disabled.' value="<span class="fa fa-globe"><span>'.dol_escape_htmltag($langs->trans("Replace")).'" name="replacesite">';
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button nobordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebSiteContent")).'"><span class="fa fa-file-code"><span></a>';
}
print '</div>';
@ -1900,10 +1912,10 @@ if (! GETPOST('hide_websitemenu'))
print '</div>';
}
if (in_array($action, array('editcss','editmenu','file_manager')))
if (in_array($action, array('editcss','editmenu','file_manager','replacesite')))
{
if (preg_match('/^create/', $action) && $action != 'file_manager') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if (preg_match('/^edit/', $action) && $action != 'file_manager') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite') print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">';
}
@ -2155,7 +2167,7 @@ if (! GETPOST('hide_websitemenu'))
// TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext
}
if (! in_array($action, array('editcss','editmenu','file_manager','createsite','createcontainer','createpagefromclone')))
if (! in_array($action, array('editcss','editmenu','file_manager','replacesite','createsite','createcontainer','createpagefromclone')))
{
if (preg_match('/^create/', $action)) print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
if (preg_match('/^edit/', $action)) print '<input type="submit" id="savefile" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
@ -2815,7 +2827,7 @@ if ($action == 'editmeta' || $action == 'createcontainer')
if ($action == 'editfile' || $action == 'file_manager')
{
print '<!-- Edit Media -->'."\n";
print '<div class="fiche"><br><br>';
print '<div class="fiche"><br>';
//print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';
$module = 'medias';
@ -2825,6 +2837,18 @@ if ($action == 'editfile' || $action == 'file_manager')
print '</div>';
}
if ($action == 'replacesite')
{
print '<!-- Edit Media -->'."\n";
print '<div class="fiche"><br>';
print load_fiche_titre($langs->trans("ReplaceWebSiteContent"));
print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';
print '</div>';
}
if ($action == 'editmenu')
{
print '<!-- Edit Menu -->'."\n";