Merge pull request #10758 from altatof/lf

NEW : add constant MAIN_DEFAULT_LANGUAGE_FILTER
This commit is contained in:
Laurent Destailleur 2019-03-07 14:18:26 +01:00 committed by GitHub
commit 8d0a8d8263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,9 @@ class FormAdmin
public function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0)
{
// phpcs:enable
global $langs;
global $conf, $langs;
if (!empty($conf->global->MAIN_DEFAULT_LANGUAGE_FILTER)) $filter[$conf->global->MAIN_DEFAULT_LANGUAGE_FILTER] = 1;
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT, 12);

View File

@ -61,7 +61,7 @@ if (defined('THEME_ONLY_CONSTANT')) return;
session_cache_limiter('public');
require_once __DIR__.'/../../main.inc.php'; // __DIR__ allow this script to be included in custom themes
require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined)