| Server IP : 195.134.90.114 / Your IP : 216.73.216.86 Web Server : Apache/2.4.58 System : Linux nepub 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/public_html/plugins/generic/customLocale/controllers/grid/ |
Upload File : |
<?php
/**
* @file controllers/grid/CustomLocaleAction.inc.php
*
* Copyright (c) 2016-2023 Language Science Press
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class CustomLocaleAction
*/
class CustomLocaleAction {
/**
* Get a list of locale files.
* @param $locale
* @return array
*/
static function getLocaleFiles($locale) {
if (!AppLocale::isLocaleValid($locale)) return null;
$localeFiles = AppLocale::makeComponentMap($locale);
$plugins = PluginRegistry::loadAllPlugins();
foreach (array_keys($plugins) as $key) {
$plugin =& $plugins[$key];
$localeFile = $plugin->getLocaleFilename($locale);
$localeFilePath = $localeFile[0];
if (file_exists($localeFilePath)) {
if (!empty($localeFile)) {
if (is_scalar($localeFile)) {
$localeFiles[] = $localeFile;
}
if (is_array($localeFile)) {
$localeFiles = array_merge($localeFiles, $localeFile);
}
}
}
unset($plugin);
}
return $localeFiles;
}
/**
* Determine whether a specified file is a locale file.
* @param $locale string
* @param $filename string
* @return boolean
*/
static function isLocaleFile($locale, $filename) {
if (in_array($filename, self::getLocaleFiles($locale))) return true;
return false;
}
}