mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Support {$lang_type} and {$device_type} variables in plugin.load
This commit is contained in:
parent
5d84c7fe5b
commit
dca06a778d
1 changed files with 14 additions and 5 deletions
|
|
@ -2286,19 +2286,19 @@ class Context
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns javascript plugin file info
|
* Returns javascript plugin file info
|
||||||
* @param string $pluginName
|
* @param string $plugin_name
|
||||||
* @return stdClass
|
* @return stdClass
|
||||||
*/
|
*/
|
||||||
public static function getJavascriptPluginInfo($pluginName)
|
public static function getJavascriptPluginInfo($plugin_name)
|
||||||
{
|
{
|
||||||
if($plugin_name == 'ui.datepicker')
|
if($plugin_name == 'ui.datepicker')
|
||||||
{
|
{
|
||||||
$plugin_name = 'ui';
|
$plugin_name = 'ui';
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugin_path = './common/js/plugins/' . $pluginName . '/';
|
$plugin_path = './common/js/plugins/' . $plugin_name . '/';
|
||||||
$info_file = $plugin_path . 'plugin.load';
|
$info_file = $plugin_path . 'plugin.load';
|
||||||
if(!is_readable($info_file))
|
if(!file_exists($info_file) || !is_readable($info_file))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2320,6 +2320,10 @@ class Context
|
||||||
{
|
{
|
||||||
$filename = substr($filename, 2);
|
$filename = substr($filename, 2);
|
||||||
}
|
}
|
||||||
|
$filename = strtr($filename, [
|
||||||
|
'{$device_type}' => self::get('m') ? 'mobile' : 'pc',
|
||||||
|
'{$lang_type}' => self::getLangType(),
|
||||||
|
]);
|
||||||
|
|
||||||
if(substr_compare($filename, '.js', -3) === 0)
|
if(substr_compare($filename, '.js', -3) === 0)
|
||||||
{
|
{
|
||||||
|
|
@ -2361,7 +2365,7 @@ class Context
|
||||||
|
|
||||||
$plugin_path = './common/js/plugins/' . $plugin_name . '/';
|
$plugin_path = './common/js/plugins/' . $plugin_name . '/';
|
||||||
$info_file = $plugin_path . 'plugin.load';
|
$info_file = $plugin_path . 'plugin.load';
|
||||||
if(!is_readable($info_file))
|
if(!file_exists($info_file) || !is_readable($info_file))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2379,6 +2383,11 @@ class Context
|
||||||
{
|
{
|
||||||
$filename = substr($filename, 2);
|
$filename = substr($filename, 2);
|
||||||
}
|
}
|
||||||
|
$filename = strtr($filename, [
|
||||||
|
'{$device_type}' => self::get('m') ? 'mobile' : 'pc',
|
||||||
|
'{$lang_type}' => self::getLangType(),
|
||||||
|
]);
|
||||||
|
|
||||||
if(substr_compare($filename, '.js', -3) === 0)
|
if(substr_compare($filename, '.js', -3) === 0)
|
||||||
{
|
{
|
||||||
self::loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
|
self::loadFile(array($plugin_path . $filename, 'body', '', 0), TRUE);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue