* 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:
@@ -8,7 +8,7 @@
|
||||
* @package PSI_JS
|
||||
* @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: js.php 661 2012-08-27 11:26:39Z namiltd $
|
||||
* @link http://phpsysinfo.sourceforge.net
|
||||
*/
|
||||
@@ -17,11 +17,11 @@
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
define('APP_ROOT', dirname(__FILE__));
|
||||
define('PSI_APP_ROOT', dirname(__FILE__));
|
||||
|
||||
require_once APP_ROOT.'/includes/autoloader.inc.php';
|
||||
require_once PSI_APP_ROOT.'/includes/autoloader.inc.php';
|
||||
|
||||
require_once APP_ROOT.'/read_config.php';
|
||||
require_once PSI_APP_ROOT.'/read_config.php';
|
||||
|
||||
$file = isset($_GET['name']) ? basename(htmlspecialchars($_GET['name'])) : null;
|
||||
$plugin = isset($_GET['plugin']) ? basename(htmlspecialchars($_GET['plugin'])) : null;
|
||||
@@ -29,16 +29,16 @@ $script = null;
|
||||
|
||||
if ($file != null && $plugin == null) {
|
||||
if (strtolower(substr($file, 0, 6)) == 'jquery') {
|
||||
$script = APP_ROOT.'/js/jQuery/'.$file;
|
||||
$script = PSI_APP_ROOT.'/js/jQuery/'.$file;
|
||||
} elseif (strtolower(substr($file, 0, 10)) == 'phpsysinfo') {
|
||||
$script = APP_ROOT.'/js/phpSysInfo/'.$file;
|
||||
$script = PSI_APP_ROOT.'/js/phpSysInfo/'.$file;
|
||||
} else {
|
||||
$script = APP_ROOT.'/js/vendor/'.$file;
|
||||
$script = PSI_APP_ROOT.'/js/vendor/'.$file;
|
||||
}
|
||||
} elseif ($file == null && $plugin != null) {
|
||||
$script = APP_ROOT.'/plugins/'.strtolower($plugin).'/js/'.strtolower($plugin);
|
||||
$script = PSI_APP_ROOT.'/plugins/'.strtolower($plugin).'/js/'.strtolower($plugin);
|
||||
} elseif ($file != null && $plugin != null) {
|
||||
$script = APP_ROOT.'/plugins/'.strtolower($plugin).'/js/'.strtolower($file);
|
||||
$script = PSI_APP_ROOT.'/plugins/'.strtolower($plugin).'/js/'.strtolower($file);
|
||||
}
|
||||
|
||||
if ($script != null) {
|
||||
@@ -46,40 +46,33 @@ if ($script != null) {
|
||||
$scriptmin = $script.'.min.js';
|
||||
$compression = false;
|
||||
|
||||
header("content-type: application/x-javascript");
|
||||
header('content-type: application/x-javascript');
|
||||
|
||||
if ((!defined("PSI_DEBUG") || (PSI_DEBUG !== true)) && defined("PSI_JS_COMPRESSION")) {
|
||||
$compression = strtolower(PSI_JS_COMPRESSION);
|
||||
}
|
||||
switch ($compression) {
|
||||
case "normal":
|
||||
if (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
$filecontent = file_get_contents($scriptmin);
|
||||
echo $filecontent;
|
||||
} elseif (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
$filecontent = file_get_contents($scriptjs);
|
||||
$packer = new JavaScriptPacker($filecontent);
|
||||
echo $packer->pack();
|
||||
}
|
||||
break;
|
||||
case "none":
|
||||
if (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
$filecontent = file_get_contents($scriptjs);
|
||||
$packer = new JavaScriptPacker($filecontent, 0);
|
||||
echo $packer->pack();
|
||||
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
$filecontent = file_get_contents($scriptmin);
|
||||
echo $filecontent;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
$filecontent = file_get_contents($scriptjs);
|
||||
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
$filecontent = file_get_contents($scriptmin);
|
||||
} else break;
|
||||
|
||||
echo $filecontent;
|
||||
break;
|
||||
case "normal":
|
||||
if (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
echo file_get_contents($scriptmin);
|
||||
} elseif (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
$packer = new JavaScriptPacker(file_get_contents($scriptjs));
|
||||
echo $packer->pack();
|
||||
}
|
||||
break;
|
||||
case "none":
|
||||
if (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
$packer = new JavaScriptPacker(file_get_contents($scriptjs), 0);
|
||||
echo $packer->pack();
|
||||
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
echo file_get_contents($scriptmin);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (file_exists($scriptjs) && is_readable($scriptjs)) {
|
||||
echo file_get_contents($scriptjs);
|
||||
} elseif (file_exists($scriptmin) && is_readable($scriptmin)) {
|
||||
echo file_get_contents($scriptmin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user