Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -324,10 +324,10 @@ class _Developer
|
||||
{
|
||||
if ( $this->app->directory == 'core' )
|
||||
{
|
||||
/* Make sure we've got a skin set ID 1 */
|
||||
/* Make sure we've got a skin set ID 1 (constant DEFAULT_THEME_ID) */
|
||||
try
|
||||
{
|
||||
$skinSetOne = \IPS\Db::i()->select( '*', 'core_themes', array( 'set_id=?', 1 ) )->first();
|
||||
$skinSetOne = \IPS\Db::i()->select( '*', 'core_themes', array( 'set_id=?', \IPS\DEFAULT_THEME_ID ) )->first();
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
@@ -337,7 +337,7 @@ class _Developer
|
||||
if ( ! isset( $skinSetOne['set_id'] ) )
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_themes', array(
|
||||
'set_id' => 1,
|
||||
'set_id' => \IPS\DEFAULT_THEME_ID,
|
||||
'set_name' => 'Default',
|
||||
'set_key' => 'master',
|
||||
'set_parent_id' => 0,
|
||||
@@ -353,23 +353,23 @@ class _Developer
|
||||
'set_long_version' => \IPS\Application::load( $this->app->directory )->long_version,
|
||||
) );
|
||||
|
||||
\IPS\Lang::saveCustom( 'core', "core_theme_set_title_1", "Default" );
|
||||
\IPS\Lang::saveCustom( 'core', "core_theme_set_title_" . \IPS\DEFAULT_THEME_ID, "Default" );
|
||||
}
|
||||
else if ( $skinSetOne['set_name'] != 'Default' )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_themes', array( 'set_name' => 'Default' ), array( 'set_id=?', 1 ) );
|
||||
\IPS\Lang::saveCustom( 'core', "core_theme_set_title_1", "Default" );
|
||||
\IPS\Db::i()->update( 'core_themes', array( 'set_name' => 'Default' ), array( 'set_id=?', \IPS\DEFAULT_THEME_ID ) );
|
||||
\IPS\Lang::saveCustom( 'core', "core_theme_set_title_" . \IPS\DEFAULT_THEME_ID, "Default" );
|
||||
}
|
||||
|
||||
unset( \IPS\Data\Store::i()->themes );
|
||||
}
|
||||
|
||||
$currentSettings = iterator_to_array( \IPS\Db::i()->select( '*', 'core_theme_settings_fields', array( 'sc_set_id=? AND sc_app=?', 1, $this->app->directory ) )->setKeyField('sc_key') );
|
||||
$currentSettings = iterator_to_array( \IPS\Db::i()->select( '*', 'core_theme_settings_fields', array( 'sc_set_id=? AND sc_app=?', \IPS\DEFAULT_THEME_ID, $this->app->directory ) )->setKeyField('sc_key') );
|
||||
|
||||
$json = ( file_exists( \IPS\ROOT_PATH . "/applications/{$this->app->directory}/data/themesettings.json" ) ) ?
|
||||
json_decode( file_get_contents( \IPS\ROOT_PATH . "/applications/{$this->app->directory}/data/themesettings.json" ), TRUE ) :
|
||||
array();
|
||||
$jsonKeys = array();
|
||||
$json = ( file_exists( \IPS\ROOT_PATH . "/applications/{$this->app->directory}/data/themesettings.json" ) ) ?
|
||||
json_decode( file_get_contents( \IPS\ROOT_PATH . "/applications/{$this->app->directory}/data/themesettings.json" ), TRUE ) :
|
||||
array();
|
||||
$jsonKeys = array();
|
||||
|
||||
/* Add */
|
||||
foreach( $json as $key => $data)
|
||||
@@ -379,7 +379,7 @@ class _Developer
|
||||
if ( ! isset( $currentSettings[ $data['sc_key'] ] ) )
|
||||
{
|
||||
$currentId = \IPS\Db::i()->insert( 'core_theme_settings_fields', array(
|
||||
'sc_set_id' => 1,
|
||||
'sc_set_id' => \IPS\DEFAULT_THEME_ID,
|
||||
'sc_key' => $data['sc_key'],
|
||||
'sc_tab_key' => $data['sc_tab_key'],
|
||||
'sc_type' => $data['sc_type'],
|
||||
@@ -407,13 +407,13 @@ class _Developer
|
||||
'sc_title' => $data['sc_title'],
|
||||
'sc_order' => $data['sc_order'],
|
||||
'sc_condition' => $data['sc_condition'],
|
||||
), array( 'sc_set_id=? AND sc_key=? AND sc_app=?', 1, $data['sc_key'], $this->app->directory ) );
|
||||
), array( 'sc_set_id=? AND sc_key=? AND sc_app=?', \IPS\DEFAULT_THEME_ID, $data['sc_key'], $this->app->directory ) );
|
||||
|
||||
$currentId = $currentSettings[ $data['sc_key'] ]['sc_id'];
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete('core_theme_settings_values', array('sv_id=?', $currentId ) );
|
||||
\IPS\Db::i()->insert('core_theme_settings_values', array( 'sv_id' => $currentId, 'sv_value' => (string)$data['sc_default'] ) );
|
||||
\IPS\Db::i()->insert('core_theme_settings_values', array( 'sv_id' => $currentId, 'sv_value' => (string) $data['sc_default'] ) );
|
||||
}
|
||||
|
||||
/* Remove items not in the JSON file */
|
||||
@@ -421,7 +421,7 @@ class _Developer
|
||||
{
|
||||
if ( ! in_array( $data['sc_key'], $jsonKeys ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_theme_settings_fields', array( 'sc_set_id=? AND sc_key=? AND sc_app=?', 1, $data['sc_key'], $this->app->directory ) );
|
||||
\IPS\Db::i()->delete( 'core_theme_settings_fields', array( 'sc_set_id=? AND sc_key=? AND sc_app=?', \IPS\DEFAULT_THEME_ID, $data['sc_key'], $this->app->directory ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ class _Developer
|
||||
/* Update record */
|
||||
if ( $updated === TRUE )
|
||||
{
|
||||
\IPS\Theme::load(1)->saveSet();
|
||||
\IPS\Theme::load( \IPS\DEFAULT_THEME_ID )->saveSet();
|
||||
|
||||
\IPS\Db::i()->update( 'core_dev', array(
|
||||
'working_version' => $latestVersion,
|
||||
|
||||
Reference in new issue
Block a user