FIX A page of a site replaced with another when switching in edit mode

Conflicts:
	htdocs/website/index.php
This commit is contained in:
Laurent Destailleur 2019-04-05 11:34:06 +02:00
parent fa95f5575c
commit 163665e4b5

View File

@ -213,7 +213,21 @@ $htmlheadercontentdefault.='-->'."\n";
* Actions
*/
$backtopage=$_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir','alpha')?'&section_dir='.urlencode(GETPOST('section_dir','alpha')):''); // used after a confirm_deletefile into actions_linkedfiles.inc.php
// Protections
if ($action == 'updatesource' && (GETPOST('refreshsite_x') || GETPOST('refreshsite.x') || GETPOST('refreshpage_x') || GETPOST('refreshpage.x')))
{
$action = 'preview'; // To avoid to update another page or another site when we click on button to select another site or page.
}
if (GETPOST('refreshsite', 'alpha')) // If we change the site, we reset the pageid and cancel addsite action.
{
$pageid=0;
if ($action == 'addsite') $action = 'preview';
if ($action == 'updatesource') $action = 'preview';
}
if (GETPOST('refreshpage', 'alpha') && ! in_array($action, array('updatecss'))) $action='preview';
$backtopage=$_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir', 'alpha')?'&section_dir='.urlencode(GETPOST('section_dir', 'alpha')):''); // used after a confirm_deletefile into actions_linkedfiles.inc.php
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
if ($action == 'renamefile') $action='file_manager'; // After actions_linkedfiles, if action were renamefile, we set it to 'file_manager'
@ -270,15 +284,6 @@ if ($action == 'adddir' && $permtouploadfile)
}
*/
if (GETPOST('refreshsite','alpha')) // If we change the site, we reset the pageid and cancel addsite action.
{
$pageid=0;
if ($action == 'addsite') $action = 'preview';
}
if (GETPOST('refreshpage','alpha') && ! in_array($action, array('updatecss'))) $action='preview';
// Add site
if ($action == 'addsite')
{
@ -1755,7 +1760,7 @@ if (! GETPOST('hide_websitemenu'))
$out.=ajax_combobox('website');
print $out;
//print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">';
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshpage" value="'.$langs->trans("Load").'">';
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
if ($websitekey)