Fix navigation backtopage and "save and stay"
This commit is contained in:
parent
dbbe40ca3d
commit
a6ca56a7e1
@ -1505,18 +1505,26 @@ if ($action == 'updatemeta')
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
||||||
|
|
||||||
|
if (!GETPOSTISSET('updateandstay')) // If we click on "Save And Stay", we do not make the redirect
|
||||||
|
{
|
||||||
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
//exit;
|
//exit;
|
||||||
|
$action = 'preview';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'editmeta';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
||||||
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
//exit;
|
//exit;
|
||||||
}
|
|
||||||
|
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update page
|
// Update page
|
||||||
@ -1742,9 +1750,23 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
||||||
|
|
||||||
|
if (!GETPOSTISSET('updateandstay')) // If we click on "Save And Stay", we do not make the redirect
|
||||||
|
{
|
||||||
|
if ($backtopage) {
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($action == 'updatesource') $action = 'editsource';
|
||||||
|
if ($action == 'updatecontent') $action = 'editcontent';
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
||||||
@ -2154,7 +2176,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
|
|
||||||
if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm')))
|
if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm')))
|
||||||
{
|
{
|
||||||
if ($action == 'editcss' && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
if ($action == 'editcss') print '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||||
if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') 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' && $action != 'replacesiteconfirm') 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' && $action != 'replacesiteconfirm') 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' && $action != 'replacesiteconfirm') 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="cancel">';
|
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
|
||||||
@ -2443,6 +2465,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
}
|
}
|
||||||
if (!in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite')))
|
if (!in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite')))
|
||||||
{
|
{
|
||||||
|
if ($action == 'editsource' || $action == 'editmeta') print '<input type="submit" id="savefilean stay" class="button buttonforacesave" value="'.dol_escape_htmltag($langs->trans("SaveAndStay")).'" name="updateandstay">';
|
||||||
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('/^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">';
|
if (preg_match('/^edit/', $action)) 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="cancel">';
|
if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
|
||||||
@ -3371,7 +3394,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
|
|||||||
$disabled = ' disabled';
|
$disabled = ' disabled';
|
||||||
$urltoedithtmlsource = '';
|
$urltoedithtmlsource = '';
|
||||||
}
|
}
|
||||||
print '<a class="button'.$disabled.'" href="'.$urltoedithtmlsource.'">'.$langs->trans("EditHTMLSource").'</a>';
|
print '<a class="'.$disabled.'" href="'.$urltoedithtmlsource.'" title="'.$langs->trans("EditHTMLSource").'">'.img_picto($langs->trans("EditHTMLSource"), 'edit').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user