Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -27,6 +27,11 @@ class _Theme extends \IPS\Theme
|
||||
* @brief Template Classes
|
||||
*/
|
||||
protected $templates;
|
||||
|
||||
/**
|
||||
* @brief Stored plugins
|
||||
*/
|
||||
protected static $plugins = array();
|
||||
|
||||
/**
|
||||
* Get raw templates. Raw means HTML logic and variables are still in {{format}}
|
||||
@@ -518,6 +523,11 @@ class _Theme extends \IPS\Theme
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( mb_substr( $file->getFilename(), -4 ) !== '.css' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get the content */
|
||||
$css = file_get_contents( $root . $path . $file->getFilename() );
|
||||
|
||||
@@ -638,6 +648,14 @@ class _Theme extends \IPS\Theme
|
||||
{
|
||||
\IPS\Theme::deleteCompiledResources( $dir->getFilename(), null, null, null, ( $id === 0 ? 1 : $id ) );
|
||||
|
||||
if ( $id )
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_theme_resources', array( 'resource_set_id=? and resource_plugin IS NOT NULL', $id ) ) as $resource )
|
||||
{
|
||||
static::$plugins[ $resource['resource_name'] ] = $resource['resource_plugin'];
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_theme_resources', array( 'resource_app=? AND resource_set_id=?', $dir->getFilename(), $id ) );
|
||||
|
||||
$path = static::_getResourcePath( $dir->getFilename() );
|
||||
@@ -672,11 +690,12 @@ class _Theme extends \IPS\Theme
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function _importDevResources( $app, $id, $location, $path='/' )
|
||||
public static function _importDevResources( $app, $id, $location, $path='/' )
|
||||
{
|
||||
$root = static::_getResourcePath($app, $location);
|
||||
$master = array();
|
||||
|
||||
$plugins = array();
|
||||
|
||||
if ( $id )
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_theme_resources', array( 'resource_set_id=0 and resource_app=? and resource_location=? and resource_path=?', $app, $location, $path ) ) as $resource )
|
||||
@@ -684,7 +703,7 @@ class _Theme extends \IPS\Theme
|
||||
$master[ $resource['resource_name'] ] = md5( $resource['resource_data'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach( new \DirectoryIterator( $root . $path ) as $file )
|
||||
{
|
||||
if ( $file->isDot() || mb_substr( $file->getFilename(), 0, 1 ) === '.' || $file == 'index.html' )
|
||||
@@ -721,7 +740,7 @@ class _Theme extends \IPS\Theme
|
||||
{
|
||||
$custom = 1;
|
||||
}
|
||||
|
||||
|
||||
\IPS\Db::i()->insert( 'core_theme_resources', array(
|
||||
'resource_set_id' => ( $id == 0 ? 1 : $id ),
|
||||
'resource_app' => $app,
|
||||
@@ -731,6 +750,7 @@ class _Theme extends \IPS\Theme
|
||||
'resource_added' => time(),
|
||||
'resource_data' => $content,
|
||||
'resource_filename' => $fileName,
|
||||
'resource_plugin' => ( ( $app == 'core' and $location == 'global' and $path == '/plugins/' ) and isset( static::$plugins[ $file->getFilename() ] ) ) ? static::$plugins[ $file->getFilename() ] : NULL,
|
||||
'resource_user_edited' => $custom
|
||||
) );
|
||||
|
||||
|
||||
Reference in new issue
Block a user