Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+2 -2
View File
@@ -369,12 +369,12 @@ EOF;
if ( $this->set_id )
{
/* Is this for a specific theme set? */
$content = $header . "{{if \IPS\Theme::i()->id == {$this->set_id}}}\n" . $this->content . "\n{{endif}}";
$content = "{{if \IPS\Theme::i()->id == {$this->set_id}}}\n" . $header . $this->content . "\n{{endif}}";
}
elseif ( $this->app )
{
/* Is this for a specific app? */
$content = $header . "{{if \IPS\Application::appIsEnabled( '{$this->app}' )}}\n" . $this->content . "\n{{endif}}";
$content = "{{if \IPS\Application::appIsEnabled( '{$this->app}' )}}\n" . $header . $this->content . "\n{{endif}}";
}
else
{
+22 -1
View File
@@ -245,7 +245,7 @@ class Setting extends Model
}
elseif( $this->type == static::SETTING_NUMBER )
{
return isset( $this->_data['default'] ) ? (int) $this->_data['default'] : 0;
return ( isset( $this->_data['default'] ) and is_numeric( $this->_data['default'] ) ) ? $this->_data['default'] : 0;
}
return $this->_data['default'] ?? '';
@@ -404,6 +404,27 @@ class Setting extends Model
case static::SETTING_CHECKBOX:
$value = (int) $value;
break;
case static::SETTING_IMAGE:
/* Handle Resource URLs */
preg_match( '/\{([a-z]+?=([\'"]).+?\\2 ?+)}/', $value, $matches );
if( count( $matches ) )
{
preg_match_all( '/(.+?)="([^"]*)"\s?/', $matches[1], $submatches );
if( count( $submatches[0] ) and $submatches[1][0] == 'resource' )
{
$resourceName = array_shift( $submatches[2] );
array_shift( $submatches[1] );
$options = array();
foreach ( $submatches[1] as $k => $v )
{
$options[ $v ] = $submatches[2][ $k ];
}
$value = Theme::i()->resource( $resourceName, $options['app'] ?? 'core', $options['location'] ?? 'front' )->url;
}
}
break;
}
return $value;
+529 -352
View File
File diff suppressed because it is too large. Load diff