Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -374,7 +374,8 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
if( $xml->name == 'file' )
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_javascript', array(
|
||||
/* We have a unique key on app, location, path, name so we use replace into to prevent duplicates */
|
||||
\IPS\Db::i()->replace( 'core_javascript', array(
|
||||
'javascript_app' => $xml->getAttribute('javascript_app'),
|
||||
'javascript_key' => '',
|
||||
'javascript_plugin' => '',
|
||||
@@ -868,7 +869,6 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
}
|
||||
|
||||
\IPS\Data\Store::i()->javascript_map = $map;
|
||||
\IPS\Theme::unlock( $flagKey );
|
||||
|
||||
/* As the filename has changed, rebuild the JS map */
|
||||
if ( ( $app !== 'global' and ( $location === NULL or in_array( $location, array( 'admin', 'front', 'global' ) ) ) ) )
|
||||
@@ -876,6 +876,8 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
\IPS\Output\Javascript::compile( 'global', 'root', 'map.js' );
|
||||
}
|
||||
|
||||
\IPS\Theme::unlock( $flagKey );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -969,7 +971,7 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
if ( \IPS\IN_DEV )
|
||||
{
|
||||
foreach ( \IPS\Application::applications() as $app )
|
||||
foreach ( \IPS\Application::enabledApplications() as $app )
|
||||
{
|
||||
if ( file_exists( \IPS\ROOT_PATH . "/applications/{$app->directory}/dev/jslang.php" ) )
|
||||
{
|
||||
@@ -977,7 +979,7 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
$_lang = array_merge( $_lang, $lang );
|
||||
}
|
||||
}
|
||||
foreach ( \IPS\Plugin::plugins() as $plugin )
|
||||
foreach ( \IPS\Plugin::enabledPlugins() as $plugin )
|
||||
{
|
||||
if ( file_exists( \IPS\ROOT_PATH . "/plugins/{$plugin->location}/dev/jslang.php" ) )
|
||||
{
|
||||
@@ -1059,8 +1061,17 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
foreach ( new \GlobIterator( \IPS\ROOT_PATH . '/plugins/*/dev/js/*' ) as $file )
|
||||
{
|
||||
$url = str_replace( \IPS\ROOT_PATH, rtrim( \IPS\Settings::i()->base_url, '/' ), $file );
|
||||
$return[] = str_replace( '\\', '/', $url );
|
||||
try
|
||||
{
|
||||
$plugin = \IPS\Plugin::getPluginFromPath( $file );
|
||||
|
||||
if( $plugin->enabled )
|
||||
{
|
||||
$url = str_replace( \IPS\ROOT_PATH, rtrim( \IPS\Settings::i()->base_url, '/' ), $file );
|
||||
$return[] = str_replace( '\\', '/', $url );
|
||||
}
|
||||
}
|
||||
catch( \OutOfRangeException $e ){}
|
||||
}
|
||||
|
||||
return $return;
|
||||
@@ -1146,7 +1157,7 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
{
|
||||
$files = array();
|
||||
|
||||
foreach( \IPS\Application::applications() as $app => $data )
|
||||
foreach( \IPS\Application::enabledApplications() as $app => $data )
|
||||
{
|
||||
$root = \IPS\ROOT_PATH . "/applications/{$app}/dev/js/";
|
||||
|
||||
@@ -1213,11 +1224,17 @@ class _Javascript extends \IPS\Patterns\ActiveRecord
|
||||
*
|
||||
* @param string $app Application
|
||||
* @param string $location Location (front, global, etc)
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
protected static function _appJs( $app, $location )
|
||||
{
|
||||
$models = array();
|
||||
|
||||
/* Only include if the app is enabled */
|
||||
if( !in_array( $app, array_keys( \IPS\Application::enabledApplications() ) ) )
|
||||
{
|
||||
return $models;
|
||||
}
|
||||
|
||||
if ( \is_dir( \IPS\ROOT_PATH . "/applications/" . $app ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user