diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 105b332dd63..72fd6d0b70e 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -1505,17 +1505,25 @@ if ($action == 'updatemeta')
if ($result)
{
setEventMessages($langs->trans("Saved"), null, 'mesgs');
- //header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
- //exit;
+
+ 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);
+ //exit;
+ $action = 'preview';
+ }
+ else
+ {
+ $action = 'editmeta';
+ }
}
else
{
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
//exit;
+ $action = 'preview';
}
-
- $action = 'preview';
}
}
@@ -1742,8 +1750,22 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
if ($result)
{
setEventMessages($langs->trans("Saved"), null, 'mesgs');
- header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
- exit;
+
+ 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);
+ exit;
+ }
+ }
+ else
+ {
+ if ($action == 'updatesource') $action = 'editsource';
+ if ($action == 'updatecontent') $action = 'editcontent';
+ }
}
else
{
@@ -2154,7 +2176,7 @@ if (!GETPOST('hide_websitemenu'))
if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm')))
{
- if ($action == 'editcss' && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '';
+ if ($action == 'editcss') print '';
if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '';
if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print '';
if ($action != 'preview') print '';
@@ -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 ($action == 'editsource' || $action == 'editmeta') print '';
if (preg_match('/^create/', $action)) print '';
if (preg_match('/^edit/', $action)) print '';
if ($action != 'preview') print '';
@@ -3371,7 +3394,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
$disabled = ' disabled';
$urltoedithtmlsource = '';
}
- print ''.$langs->trans("EditHTMLSource").'';
+ print ''.img_picto($langs->trans("EditHTMLSource"), 'edit').'';
print '';
print '';
}