Closed stonebuzz closed 1 year ago
To follow https://github.com/pluginsGLPI/formcreator/pull/3367
$_SESSION['glpilanguage'] need to be set too.
$_SESSION['glpilanguage']
Some plugin can check this key to load desired langage.
See genericobject for example
genericobject
function plugin_genericobject_includeCommonFields($force = false) { global $GO_FIELDS, $LANG; // Permit missing global declaration in user files $includes = [ sprintf('%s/fields/field.constant.php', GENERICOBJECT_DIR), // Default common fields constants ]; // User locales for common fields if ( isset($_SESSION['glpilanguage']) && file_exists($locale_file = sprintf('%s/fields.%s.php', GENERICOBJECT_LOCALES_PATH, $_SESSION['glpilanguage'])) ) { $includes[] = $locale_file; } elseif (file_exists($locale_file = sprintf('%s/fields.%s.php', GENERICOBJECT_LOCALES_PATH, 'en_GB'))) { $includes[] = $locale_file; } // User common fields constants if (file_exists($fields_file = sprintf('%s/field.constant.php', GENERICOBJECT_FIELDS_PATH))) { $includes[] = $fields_file; } foreach ($includes as $include) { if (!$force) { include_once($include); } else { include($include); } } }
Please check if your PR fulfills the following specifications:
Internal ref 29394
Closes #N/A
Changes description
To follow https://github.com/pluginsGLPI/formcreator/pull/3367
$_SESSION['glpilanguage']
need to be set too.Some plugin can check this key to load desired langage.
See
genericobject
for exampleChecklist
Please check if your PR fulfills the following specifications:
References
Internal ref 29394
Closes #N/A