Fix edit lang

This commit is contained in:
Laurent Destailleur 2020-02-27 22:58:36 +01:00
parent 2205667ca0
commit 83957f93e6

View File

@ -396,11 +396,16 @@ if ($action == 'addsite')
if (!$error) if (!$error)
{ {
$arrayotherlang=explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml'));
foreach($arrayotherlang as $key => $val) {
$arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only
}
$tmpobject = new Website($db); $tmpobject = new Website($db);
$tmpobject->ref = GETPOST('WEBSITE_REF', 'alpha'); $tmpobject->ref = GETPOST('WEBSITE_REF', 'alpha');
$tmpobject->description = GETPOST('WEBSITE_DESCRIPTION', 'alphanohtml'); $tmpobject->description = GETPOST('WEBSITE_DESCRIPTION', 'alphanohtml');
$tmpobject->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $tmpobject->lang = GETPOST('WEBSITE_LANG', 'aZ09');
$tmpobject->otherlang = GETPOST('WEBSITE_OTHERLANG', 'aZ09comma'); $tmpobject->otherlang = join(',', $arrayotherlang);
$tmpobject->virtualhost = GETPOST('virtualhost', 'alpha'); $tmpobject->virtualhost = GETPOST('virtualhost', 'alpha');
$result = $tmpobject->create($user); $result = $tmpobject->create($user);
@ -1038,7 +1043,7 @@ if ($action == 'delete')
} }
} }
// Update css // Update css Update site properties
if ($action == 'updatecss') if ($action == 'updatecss')
{ {
// If we tried to reload another site/page, we stay on editcss mode. // If we tried to reload another site/page, we stay on editcss mode.
@ -1062,9 +1067,14 @@ if ($action == 'updatecss')
if (!$error) if (!$error)
{ {
$arrayotherlang=explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml'));
foreach($arrayotherlang as $key => $val) {
$arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only
}
$object->virtualhost = GETPOST('virtualhost', 'alpha'); $object->virtualhost = GETPOST('virtualhost', 'alpha');
$object->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $object->lang = GETPOST('WEBSITE_LANG', 'aZ09');
$object->otherlang = GETPOST('WEBSITE_OTHERLANG', 'aZ09comma'); $object->otherlang = join(',', $arrayotherlang);
$object->use_manifest = GETPOST('use_manifest', 'alpha'); $object->use_manifest = GETPOST('use_manifest', 'alpha');
$result = $object->update($user); $result = $object->update($user);