Skip to content

Commit

Permalink
FIX A page of a site replaced with another when switching in edit mode
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/website/index.php
  • Loading branch information
eldy committed Apr 5, 2019
1 parent fa95f55 commit 163665e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions htdocs/website/index.php
Expand Up @@ -213,7 +213,21 @@
* 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'
Expand Down Expand Up @@ -270,15 +284,6 @@
}
*/


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')
{
Expand Down Expand Up @@ -1755,7 +1760,7 @@
$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)
Expand Down

0 comments on commit 163665e

Please sign in to comment.