Commit 1374de60 authored by Dries's avatar Dries

- Patch #1181776 by sun, Psikik, mallezie, scor: change theme_default() variable to Stark.

parent 528a78d0
......@@ -420,7 +420,7 @@ function ajax_base_page_theme() {
// to see the default theme, token validation isn't required for that, and
// bypassing it allows most use-cases to work even when accessed from the
// page cache.
if ($theme === variable_get('theme_default', 'bartik') || drupal_valid_token($token, $theme)) {
if ($theme === variable_get('theme_default', 'stark') || drupal_valid_token($token, $theme)) {
return $theme;
}
}
......
......@@ -80,7 +80,7 @@ function drupal_theme_initialize() {
// Only select the user selected theme if it is available in the
// list of themes that can be accessed.
$theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : variable_get('theme_default', 'bartik');
$theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : variable_get('theme_default', 'stark');
// Allow modules to override the theme. Validation has already been performed
// inside menu_get_custom_theme(), so we do not need to check it again here.
......@@ -1432,7 +1432,7 @@ function theme_enable($theme_list) {
*/
function theme_disable($theme_list) {
// Don't disable the default theme.
if ($pos = array_search(variable_get('theme_default', 'bartik'), $theme_list) !== FALSE) {
if ($pos = array_search(variable_get('theme_default', 'stark'), $theme_list) !== FALSE) {
unset($theme_list[$pos]);
if (empty($theme_list)) {
return;
......
......@@ -44,6 +44,12 @@ function _drupal_maintenance_theme() {
// We use the default theme as the maintenance theme. If a default theme
// isn't specified in the database or in settings.php, we use Bartik.
// @todo Should use the actual default theme configured, but that depends on
// configuration being available while possibly not having a working
// database connection (yet). And only if that fails, should fall back to
// Stark otherwise. Since there is no low-level access to configuration
// currently, we only consult settings.php and fall back to Bartik
// otherwise, as it looks generic enough and way more user-friendly.
$custom_theme = variable_get('maintenance_theme', variable_get('theme_default', 'bartik'));
}
......
......@@ -305,7 +305,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
'#tree' => TRUE,
);
$theme_default = variable_get('theme_default', 'bartik');
$theme_default = variable_get('theme_default', 'stark');
$admin_theme = variable_get('admin_theme');
foreach (list_themes() as $key => $theme) {
// Only display enabled themes
......
......@@ -63,7 +63,7 @@ function block_help($path, $arg) {
return '<p>' . t('Use this page to create a new custom block.') . '</p>';
}
if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
$demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'bartik');
$demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'stark');
$themes = list_themes();
$output = '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page. Click the <em>configure</em> link next to each block to configure its specific title and visibility settings.') . '</p>';
$output .= '<p>' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>';
......@@ -103,7 +103,7 @@ function block_permission() {
* Implements hook_menu().
*/
function block_menu() {
$default_theme = variable_get('theme_default', 'bartik');
$default_theme = variable_get('theme_default', 'stark');
$items['admin/structure/block'] = array(
'title' => 'Blocks',
'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
......@@ -308,7 +308,7 @@ function block_page_build(&$page) {
$page['page_top']['backlink'] = array(
'#type' => 'link',
'#title' => t('Exit block region demonstration'),
'#href' => 'admin/structure/block' . (variable_get('theme_default', 'bartik') == $theme ? '' : '/list/' . $theme),
'#href' => 'admin/structure/block' . (variable_get('theme_default', 'stark') == $theme ? '' : '/list/' . $theme),
// Add the "overlay-restore" class to indicate this link should restore
// the context in which the region demonstration page was opened.
'#options' => array('attributes' => array('class' => array('block-demo-backlink', 'overlay-restore'))),
......@@ -664,7 +664,7 @@ function block_theme_initialize($theme) {
// Initialize theme's blocks if none already registered.
$has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', 0, 1, array(':theme' => $theme))->fetchField();
if (!$has_blocks) {
$default_theme = variable_get('theme_default', 'bartik');
$default_theme = variable_get('theme_default', 'stark');
// Apply only to new theme's visible regions.
$regions = system_region_list($theme, REGIONS_VISIBLE);
$result = db_query("SELECT * FROM {block} WHERE theme = :theme", array(':theme' => $default_theme), array('fetch' => PDO::FETCH_ASSOC));
......
......@@ -425,7 +425,7 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase {
// Ensure no other theme's blocks are in the block table yet.
$themes = array();
$themes['default'] = variable_get('theme_default', 'bartik');
$themes['default'] = variable_get('theme_default', 'stark');
if ($admin_theme = variable_get('admin_theme')) {
$themes['admin'] = $admin_theme;
}
......
......@@ -96,7 +96,7 @@ function dashboard_permission() {
*/
function dashboard_block_info_alter(&$blocks, $theme, $code_blocks) {
$admin_theme = variable_get('admin_theme');
if (($admin_theme && $theme == $admin_theme) || (!$admin_theme && $theme == variable_get('theme_default', 'bartik'))) {
if (($admin_theme && $theme == $admin_theme) || (!$admin_theme && $theme == variable_get('theme_default', 'stark'))) {
foreach ($blocks as $module => &$module_blocks) {
foreach ($module_blocks as $delta => &$block) {
// Make administrative blocks that are not already in use elsewhere
......
......@@ -1881,7 +1881,7 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
$custom_block['title'] = $this->randomName();
$custom_block['types[article]'] = TRUE;
$custom_block['body[value]'] = $this->randomName(32);
$custom_block['regions[' . variable_get('theme_default', 'bartik') . ']'] = 'content';
$custom_block['regions[' . variable_get('theme_default', 'stark') . ']'] = 'content';
if ($admin_theme = variable_get('admin_theme')) {
$custom_block['regions[' . $admin_theme . ']'] = 'content';
}
......
......@@ -210,7 +210,7 @@ class StatisticsReportsTestCase extends StatisticsTestCase {
// Configure and save the block.
$block = block_load('statistics', 'popular');
$block->theme = variable_get('theme_default', 'bartik');
$block->theme = variable_get('theme_default', 'stark');
$block->status = 1;
$block->pages = '';
$block->region = 'sidebar_first';
......
......@@ -130,7 +130,7 @@ function system_themes_page() {
$themes = system_rebuild_theme_data();
uasort($themes, 'system_sort_modules_by_info_name');
$theme_default = variable_get('theme_default', 'bartik');
$theme_default = variable_get('theme_default', 'stark');
$theme_groups = array();
foreach ($themes as &$theme) {
......@@ -315,7 +315,7 @@ function system_theme_disable() {
// Check if the specified theme is one recognized by the system.
if (!empty($themes[$theme])) {
if ($theme == variable_get('theme_default', 'bartik')) {
if ($theme == variable_get('theme_default', 'stark')) {
// Don't disable the default theme.
drupal_set_message(t('%theme is the default theme and cannot be disabled.', array('%theme' => $themes[$theme]->info['name'])), 'error');
}
......
......@@ -499,11 +499,11 @@ function system_install() {
system_rebuild_theme_data();
// Enable the default theme.
variable_set('theme_default', 'bartik');
variable_set('theme_default', 'stark');
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'bartik')
->condition('name', 'stark')
->execute();
// Populate the cron key variable.
......@@ -1641,6 +1641,25 @@ function system_update_8001() {
}
}
/**
* Set Bartik as default theme if it implicitly was the default before.
*
* The default theme for Drupal core was changed from Bartik to Stark.
* Installation profiles (including Standard and Minimal) were changed to
* explicitly configure Bartik as default theme. Since Bartik was the default
* theme by default and may not have been explicitly configured as such
* previously, this update ensures that the implicit Bartik default is still the
* default.
*
* @see http://drupal.org/node/1181776
*/
function system_update_8002() {
$theme = variable_get('theme_default');
if (!isset($theme)) {
variable_set('theme_default', 'bartik');
}
}
/**
* @} End of "defgroup updates-7.x-to-8.x"
* The next series of updates should start at 9000.
......
......@@ -6,8 +6,14 @@
* Perform actions to set up the site for this profile.
*/
function minimal_install() {
// Enable Bartik theme and set it as default theme instead of Stark.
// @see system_install()
$default_theme = 'bartik';
variable_set('theme_default', $default_theme);
theme_enable(array($default_theme));
theme_disable(array('stark'));
// Enable some standard blocks.
$default_theme = variable_get('theme_default', 'bartik');
$values = array(
array(
'module' => 'system',
......
......@@ -62,8 +62,14 @@ function standard_install() {
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);
// Enable Bartik theme and set it as default theme instead of Stark.
// @see system_install()
$default_theme = 'bartik';
variable_set('theme_default', $default_theme);
theme_enable(array($default_theme));
theme_disable(array('stark'));
// Enable some standard blocks.
$default_theme = variable_get('theme_default', 'bartik');
$admin_theme = 'seven';
$values = array(
array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment