* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4 - Add code to delete inline styles and add css to make it look better. - version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
@@ -10,13 +10,13 @@
|
||||
* @package PSI_Language
|
||||
* @author Michael Cramer <BigMichi1@users.sourceforge.net>
|
||||
* @copyright 2009 phpSysInfo
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
|
||||
* @version SVN: $Id: language.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
|
||||
// Set the correct content-type header.
|
||||
header("Content-Type: text/xml\n\n");
|
||||
header('Content-Type: text/xml');
|
||||
|
||||
/**
|
||||
* default language
|
||||
@@ -37,32 +37,33 @@ $plugin = '';
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('APP_ROOT', realpath(dirname((__FILE__)).'/../'));
|
||||
define('PSI_APP_ROOT', realpath(dirname((__FILE__)).'/../'));
|
||||
|
||||
include_once APP_ROOT.'/read_config.php';
|
||||
include_once PSI_APP_ROOT.'/read_config.php';
|
||||
|
||||
if (defined('PSI_DEFAULT_LANG')) {
|
||||
$lang = PSI_DEFAULT_LANG;
|
||||
}
|
||||
|
||||
if (isset($_GET['lang'])) {
|
||||
if (file_exists(APP_ROOT.'/language/'.trim(htmlspecialchars(basename($_GET['lang']))).'.xml')) {
|
||||
$lang = basename($_GET['lang']);
|
||||
}
|
||||
if (isset($_GET['lang']) && (trim($_GET['lang'])!=="")
|
||||
&& !preg_match('/[^A-Za-z\-]/', $_GET['lang'])
|
||||
&& file_exists(PSI_APP_ROOT.'/language/'.$_GET['lang'].'.xml')) {
|
||||
$lang = strtolower($_GET['lang']);
|
||||
}
|
||||
|
||||
$plugin = isset($_GET['plugin']) ? trim(htmlspecialchars(basename($_GET['plugin']))) : null;
|
||||
|
||||
if ($plugin == null) {
|
||||
if (file_exists(APP_ROOT.'/language/'.$lang.'.xml')) {
|
||||
echo file_get_contents(APP_ROOT.'/language/'.$lang.'.xml');
|
||||
} else {
|
||||
echo file_get_contents(APP_ROOT.'/language/en.xml');
|
||||
}
|
||||
if (isset($_GET['plugin'])) {
|
||||
if ((trim($_GET['plugin'])!=="") && !preg_match('/[^A-Za-z]/', $_GET['plugin'])) {
|
||||
$plugin = strtolower($_GET['plugin']);
|
||||
if (file_exists(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml')) {
|
||||
echo file_get_contents(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/'.$lang.'.xml');
|
||||
} elseif (file_exists(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/en.xml')) {
|
||||
echo file_get_contents(PSI_APP_ROOT.'/plugins/'.$plugin.'/lang/en.xml');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (file_exists(APP_ROOT.'/plugins/'.strtolower($plugin).'/lang/'.$lang.'.xml')) {
|
||||
echo file_get_contents(APP_ROOT.'/plugins/'.strtolower($plugin).'/lang/'.$lang.'.xml');
|
||||
if (file_exists(PSI_APP_ROOT.'/language/'.$lang.'.xml')) {
|
||||
echo file_get_contents(PSI_APP_ROOT.'/language/'.$lang.'.xml');
|
||||
} else {
|
||||
echo file_get_contents(APP_ROOT.'/plugins/'.strtolower($plugin).'/lang/en.xml');
|
||||
echo file_get_contents(PSI_APP_ROOT.'/language/en.xml');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user