diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc
index cc4bd71..64440bf 100644
--- a/core/modules/block/block.admin.inc
+++ b/core/modules/block/block.admin.inc
@@ -309,7 +309,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
);
$theme_default = variable_get('theme_default', 'stark');
- $admin_theme = variable_get('admin_theme');
+ $admin_theme = config('system.site')->get('admin_theme');
foreach (list_themes() as $key => $theme) {
// Only display enabled themes
if ($theme->status) {
diff --git a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
index c133f17..b8a2ef2 100644
--- a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php
@@ -40,7 +40,7 @@ class NewDefaultThemeBlocksTest extends WebTestBase {
// Ensure no other theme's blocks are in the block table yet.
$themes = array();
$themes['default'] = variable_get('theme_default', 'stark');
- if ($admin_theme = variable_get('admin_theme')) {
+ if ($admin_theme = config('system.site')->get('admin_theme')) {
$themes['admin'] = $admin_theme;
}
$count = db_query_range('SELECT 1 FROM {block} WHERE theme NOT IN (:themes)', 0, 1, array(':themes' => $themes))->fetchField();
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
index 0c86de2..8b3b205 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
@@ -129,7 +129,7 @@ class NodeBlockFunctionalTest extends NodeTestBase {
$custom_block['types[article]'] = TRUE;
$custom_block['body[value]'] = $this->randomName(32);
$custom_block['regions[' . variable_get('theme_default', 'stark') . ']'] = 'content';
- if ($admin_theme = variable_get('admin_theme')) {
+ if ($admin_theme = config('system.site')->get('admin_theme')) {
$custom_block['regions[' . $admin_theme . ']'] = 'content';
}
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
index 9ee094b..54d0fcc 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php
@@ -64,7 +64,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
*/
function testShortcutQuickLink() {
theme_enable(array('seven'));
- variable_set('admin_theme', 'seven');
+ config('system.site')->set('admin_theme', 'seven')->save();
variable_set('node_admin_theme', TRUE);
$this->drupalGet($this->set->links[0]['link_path']);
$this->assertRaw(t('Remove from %title shortcuts', array('%title' => $this->set->title)), '"Add to shortcuts" link properly switched to "Remove from shortcuts".');
diff --git a/core/modules/system/config/system.site.yml b/core/modules/system/config/system.site.yml
index 010dedf..5bb87c6 100644
--- a/core/modules/system/config/system.site.yml
+++ b/core/modules/system/config/system.site.yml
@@ -1,3 +1,4 @@
+admin_theme: ''
name: Drupal
mail: ''
slogan: ''
diff --git a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
index 69dee9c..4008b84 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php
@@ -37,7 +37,7 @@ class PageTest extends WebTestBase {
// is using a different theme than would normally be used by the batch API.
variable_set('theme_default', 'bartik');
theme_enable(array('seven'));
- variable_set('admin_theme', 'seven');
+ config('system.site')->set('admin_theme', 'seven')->save();
// Log in as an administrator who can see the administrative theme.
$admin_user = $this->drupalCreateUser(array('view the administration theme'));
$this->drupalLogin($admin_user);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php
index 42e81b1..87d31a5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php
@@ -38,7 +38,7 @@ class RouterTest extends WebTestBase {
// and administrative theme that they expect.
theme_enable(array('bartik'));
variable_set('theme_default', 'bartik');
- variable_set('admin_theme', 'seven');
+ config('system.site')->set('admin_theme', 'seven')->save();
theme_disable(array('stark'));
// Enable navigation menu block.
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 429e990..8061eca 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -119,7 +119,7 @@ function system_themes_page() {
$theme_default = variable_get('theme_default', 'stark');
$theme_groups = array();
- $admin_theme = variable_get('admin_theme', 0);
+ $admin_theme = config('system.site')->get('admin_theme') ?: 0;
foreach ($themes as &$theme) {
if (!empty($theme->info['hidden'])) {
@@ -256,7 +256,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) {
'#options' => array(0 => t('Default theme')) + $theme_options,
'#title' => t('Administration theme'),
'#description' => t('Choose "Default theme" to always use the same theme as the rest of the site.'),
- '#default_value' => variable_get('admin_theme', 0),
+ '#default_value' => config('system.site')->get('admin_theme') ?: 0,
);
$form['admin_theme']['actions'] = array('#type' => 'actions');
$form['admin_theme']['actions']['submit'] = array(
@@ -271,7 +271,7 @@ function system_themes_admin_form($form, &$form_state, $theme_options) {
*/
function system_themes_admin_form_submit($form, &$form_state) {
drupal_set_message(t('The configuration options have been saved.'));
- variable_set('admin_theme', $form_state['values']['admin_theme']);
+ config('system.site')->set('admin_theme', $form_state['values']['admin_theme'])->save();
}
/**
@@ -307,8 +307,9 @@ function system_theme_disable() {
// Check if the specified theme is one recognized by the system.
if (!empty($themes[$theme])) {
+ $default_theme = config('system.site')->get('admin_theme') ?: 0;
// Do not disable the default or admin theme.
- if ($theme == variable_get('theme_default', 'stark') || $theme == variable_get('admin_theme', 0)) {
+ if ($theme == variable_get('theme_default', 'stark') || $theme == $default_theme) {
drupal_set_message(t('%theme is the default theme and cannot be disabled.', array('%theme' => $themes[$theme]->info['name'])), 'error');
}
else {
@@ -352,8 +353,8 @@ function system_theme_default() {
// The status message depends on whether an admin theme is currently in use:
// a value of 0 means the admin theme is set to be the default theme.
- $admin_theme = variable_get('admin_theme', 0);
- if ($admin_theme != 0 && $admin_theme != $theme) {
+ $admin_theme = config('system.site')->get('admin_theme') ?: 0;
+ if ($admin_theme && $admin_theme != $theme) {
drupal_set_message(t('Please note that the administration theme is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array(
'%admin_theme' => $themes[$admin_theme]->info['name'],
'%selected_theme' => $themes[$theme]->info['name'],
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index bfa91db..af3b503 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -225,7 +225,7 @@ function system_permission() {
),
'view the administration theme' => array(
'title' => t('View the administration theme'),
- 'description' => variable_get('admin_theme') ? '' : t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))),
+ 'description' => config('system.site')->get('admin_theme') ?: t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))),
),
'access site reports' => array(
'title' => t('View site reports'),
@@ -2365,7 +2365,7 @@ function system_custom_theme() {
$request = drupal_container()->get('request');
$path = $request->attributes->get('system_path');
if (user_access('view the administration theme') && path_is_admin($path)) {
- return variable_get('admin_theme');
+ return config('system.site')->get('admin_theme');
}
}
}
diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module
index 8f24a4f..e418bd3 100644
--- a/core/modules/system/tests/modules/menu_test/menu_test.module
+++ b/core/modules/system/tests/modules/menu_test/menu_test.module
@@ -462,7 +462,7 @@ function menu_test_theme_page_callback($inherited = FALSE) {
function menu_test_theme_callback($argument) {
// Test using the variable administrative theme.
if ($argument == 'use-admin-theme') {
- return variable_get('admin_theme');
+ return config('system.site')->get('admin_theme');
}
// Test using a theme that exists, but may or may not be enabled.
elseif ($argument == 'use-stark-theme') {
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
index b226970..e555bb6 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php
@@ -27,7 +27,7 @@ class ThemeTest extends TaxonomyTestBase {
// the duration of these tests.
variable_set('theme_default', 'bartik');
theme_enable(array('seven'));
- variable_set('admin_theme', 'seven');
+ config('system.site')->set('admin_theme', 'seven')->save();
// Create and log in as a user who has permission to add and edit taxonomy
// terms and view the administrative theme.
diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install
index 5b74b51..d7db540 100644
--- a/core/profiles/standard/standard.install
+++ b/core/profiles/standard/standard.install
@@ -420,6 +420,6 @@ function standard_install() {
// Enable the admin theme.
theme_enable(array('seven'));
- variable_set('admin_theme', 'seven');
+ config('system.site')->set('admin_theme', 'seven')->save();
variable_set('node_admin_theme', '1');
}