$value_info) {
$result_array[$key_value] = SubLanguageManager::write_data_in_file($path_folder, $value_info, $key_value);
}
$variables_with_problems = '';
if (!empty($result_array)) {
foreach ($result_array as $key => $result) {
if ($result == false) {
$variables_with_problems .= $key.'
';
}
}
}
if (isset($_REQUEST['redirect'], $_REQUEST['extra_field_type'])) {
Display::addFlash(
Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success')
);
$redirectUrl = api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type=';
switch ($_REQUEST['extra_field_type']) {
case ExtraField::USER_FIELD_TYPE:
$redirectUrl .= 'user';
break;
case ExtraField::COURSE_FIELD_TYPE:
$redirectUrl .= 'course';
break;
case ExtraField::SESSION_FIELD_TYPE:
$redirectUrl .= 'session';
break;
}
header("Location: $redirectUrl");
exit;
}
if (!empty($variables_with_problems)) {
echo $path_folder.' '.get_lang('IsNotWritable').'
'.api_ucwords(get_lang('ErrorsFound')).':
'.$variables_with_problems;
} else {
echo 1;
}
}