Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
+34
-8
@@ -541,7 +541,7 @@ class _Theme extends \IPS\Node\Model
|
||||
*/
|
||||
public function css( $file, $app=NULL, $location=NULL )
|
||||
{
|
||||
$app = $app ?: \IPS\Request::i()->app;
|
||||
$app = $app ?: \IPS\Dispatcher::i()->application->directory;
|
||||
$location = $location ?: \IPS\Dispatcher::i()->controllerLocation;
|
||||
$paths = explode( '/', $file );
|
||||
$name = array_pop( $paths );
|
||||
@@ -620,7 +620,7 @@ class _Theme extends \IPS\Node\Model
|
||||
*/
|
||||
public function resource( $path, $app=NULL, $location=NULL, $noProtocol=FALSE )
|
||||
{
|
||||
$app = $app ?: \IPS\Request::i()->app;
|
||||
$app = $app ?: \IPS\Dispatcher::i()->application->directory;
|
||||
$location = $location ?: \IPS\Dispatcher::i()->controllerLocation;
|
||||
$paths = explode( '/', $path );
|
||||
$name = array_pop( $paths );
|
||||
@@ -672,7 +672,7 @@ class _Theme extends \IPS\Node\Model
|
||||
|
||||
$resource = \IPS\Db::i()->select( '*', 'core_theme_resources', array( 'resource_set_id=? AND resource_app=? AND resource_location=? AND resource_path=? AND resource_name=?', $this->id, $app, $location, $path, $name ) )->first();
|
||||
|
||||
$resourceMap[ $key ] = (string) \IPS\File::create( 'core_Theme', $key, $resource['resource_data'], 'set_resources_' . $this->id, FALSE, NULL, FALSE );
|
||||
$resourceMap[ $key ] = (string) \IPS\File::create( 'core_Theme', $key, $resource['resource_data'], 'set_resources_' . $this->id, TRUE, NULL, FALSE );
|
||||
|
||||
\IPS\Db::i()->update( 'core_theme_resources', array( 'resource_added' => time(), 'resource_filename' => $resourceMap[ $key ] ), array( 'resource_id=?', $resource['resource_id'] ) );
|
||||
|
||||
@@ -775,7 +775,7 @@ class _Theme extends \IPS\Node\Model
|
||||
if ( $attempts === 5 )
|
||||
{
|
||||
/* Rebuild in progress */
|
||||
\IPS\Log::log( "Template store key: {$key} rebuilding and requested again ({$app}, {$location}, {$group})", "template_store_building" );
|
||||
\IPS\Log::debug( "Template store key: {$key} rebuilding and requested again ({$app}, {$location}, {$group})", "template_store_building" );
|
||||
|
||||
/* Since we can't do anything else, this ends up just being an uncaught exception - show the error page right away to avoid the unnecessary logging */
|
||||
\IPS\IPS::genericExceptionPage();
|
||||
@@ -1287,6 +1287,14 @@ class _Theme extends \IPS\Node\Model
|
||||
) );
|
||||
}
|
||||
|
||||
/* Copy any language keys */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_sys_lang_words', array( 'word_theme=?', $originalId ) ) AS $word )
|
||||
{
|
||||
$word['word_theme'] = $this->id;
|
||||
unset( $word['word_id'] );
|
||||
\IPS\Db::i()->insert( 'core_sys_lang_words', $word );
|
||||
}
|
||||
|
||||
/* Copy across resources */
|
||||
$this->copyResourcesFromSet( $originalId );
|
||||
|
||||
@@ -4879,11 +4887,15 @@ PHP;
|
||||
* @param string|null $group Group
|
||||
* @param int|null $plugin Plugin ID
|
||||
* @param bool $doAll Delete all - by default only the master set is cleared
|
||||
* @param string|null $template Template name if you just want to do one template. If specified, deleteCompiledTemplate is NOT called and must be done manually
|
||||
* @return void
|
||||
*/
|
||||
public static function removeTemplates( $app, $location=NULL, $group=NULL, $plugin=NULL, $doAll=FALSE )
|
||||
public static function removeTemplates( $app, $location=NULL, $group=NULL, $plugin=NULL, $doAll=FALSE, $template=NULL )
|
||||
{
|
||||
static::deleteCompiledTemplate( $app, $location, $group );
|
||||
if ( !$template )
|
||||
{
|
||||
static::deleteCompiledTemplate( $app, $location, $group );
|
||||
}
|
||||
|
||||
$where = array( array( 'template_app=?', $app ) );
|
||||
|
||||
@@ -4897,6 +4909,11 @@ PHP;
|
||||
$where[] = array( 'template_group=?', $group );
|
||||
}
|
||||
|
||||
if ( $template !== NULL )
|
||||
{
|
||||
$where[] = array( 'template_name=?', $template );
|
||||
}
|
||||
|
||||
if ( $plugin !== NULL )
|
||||
{
|
||||
$where[] = array( 'template_plugin=?', $plugin );
|
||||
@@ -4931,11 +4948,15 @@ PHP;
|
||||
* @param string|null $path Group
|
||||
* @param int|null $plugin Plugin ID
|
||||
* @param bool $doAll Delete all - by default only the master set is cleared
|
||||
* @param string|null $name CSS file name if you just want to do one file. If specified, deleteCompiledCss is NOT called and must be done manually
|
||||
* @return void
|
||||
*/
|
||||
public static function removeCss( $app, $location=NULL, $path=NULL, $plugin=NULL, $doAll=FALSE )
|
||||
public static function removeCss( $app, $location=NULL, $path=NULL, $plugin=NULL, $doAll=FALSE, $name=NULL )
|
||||
{
|
||||
static::deleteCompiledCss( $app, $location, $path );
|
||||
if ( !$name )
|
||||
{
|
||||
static::deleteCompiledCss( $app, $location, $path );
|
||||
}
|
||||
|
||||
$where = array( array( 'css_app=?', $app ) );
|
||||
|
||||
@@ -4949,6 +4970,11 @@ PHP;
|
||||
$where[] = array( 'css_path=?', $path );
|
||||
}
|
||||
|
||||
if ( $name !== NULL )
|
||||
{
|
||||
$where[] = array( 'css_name=?', $name );
|
||||
}
|
||||
|
||||
if ( $plugin !== NULL )
|
||||
{
|
||||
$where[] = array( 'css_plugin=?', $plugin );
|
||||
|
||||
Reference in new issue
Block a user