generate_lang_file CLI command: fix PHP warning

This commit is contained in:
Benjamin Renard 2020-09-10 12:07:04 +02:00
parent be04b6becf
commit d344c56f45
2 changed files with 6 additions and 2 deletions

View file

@ -42,12 +42,16 @@ class LSattr_html_sambaAcctFlags extends LSattr_html_select_box {
* la valeur des balises option et en valeur ce qui sera affiché.
*/
public static function _getPossibleValues($options=false, $name=false, &$ldapObject=false) {
$translate_labels = LSconfig :: get('translate_labels', true, 'bool', $options);
$retInfos = array();
if (!LSsession :: loadLSclass('LSattr_ldap_sambaAcctFlags', null, true))
return $retInfos;
foreach(LSattr_ldap_sambaAcctFlags :: get_available_flags() as $group_label => $flags) {
if ($translate_labels)
foreach ($flags as $flag => $label)
$flags[$flag] = _($label);
$retInfos[] = array(
'label' => $group_label,
'label' => ($translate_labels?_($group_label):$group_label),
'possible_values' => $flags,
);
}

View file

@ -407,7 +407,7 @@ function cli_generate_lang_file($command_args) {
fwrite(STDERR, " - q: quit interactive mode and ignore all following untranslated messages\n");
fwrite(STDERR, " - ?: Show this message\n");
fwrite(STDERR, "Or leave empty to $empty_action.\n");
continue;
break;
case "": // Empty
// On copy orignal value mode, return $msg
if ($copyoriginalvalue)