From 18bb81596d5c596b88fe0c4ff6897412438c25e3 Mon Sep 17 00:00:00 2001 From: aspilicious Date: Sat, 11 Aug 2012 22:02:21 +0200 Subject: [PATCH] Issue #1705650 by damiankloip, aspilicious: Fixed Convert core variables to the config system. --- includes/ajax.inc | 2 +- lib/Drupal/views/View.php | 2 +- modules/comment/views_plugin_row_comment_rss.inc | 2 +- modules/node/views_plugin_row_node_rss.inc | 2 +- modules/search/views_handler_filter_search.inc | 2 +- theme/theme.inc | 8 +++++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/includes/ajax.inc b/includes/ajax.inc index 1fe3dbbc38bd..a23f2b3180af 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -202,7 +202,7 @@ function views_ajax_command_replace_title($title) { $command = array( 'command' => 'viewsReplaceTitle', 'title' => $title, - 'siteName' => variable_get('site_name', 'Drupal'), + 'siteName' => config('system.site')->get('name'), ); return $command; } diff --git a/lib/Drupal/views/View.php b/lib/Drupal/views/View.php index 7456a663b243..20de4b341176 100644 --- a/lib/Drupal/views/View.php +++ b/lib/Drupal/views/View.php @@ -1685,7 +1685,7 @@ class View extends ViewsDbObject { foreach ($this->build_info['breadcrumb'] as $path => $title) { // Check to see if the frontpage is in the breadcrumb trail; if it // is, we'll remove that from the actual breadcrumb later. - if ($path == variable_get('site_frontpage', 'user')) { + if ($path == config('system.site')->get('page.front')) { $base = FALSE; $title = t('Home'); } diff --git a/modules/comment/views_plugin_row_comment_rss.inc b/modules/comment/views_plugin_row_comment_rss.inc index 87518284a08c..69c4cb450e43 100644 --- a/modules/comment/views_plugin_row_comment_rss.inc +++ b/modules/comment/views_plugin_row_comment_rss.inc @@ -86,7 +86,7 @@ class views_plugin_row_comment_rss extends views_plugin_row { $item_length = $this->options['item_length']; if ($item_length == 'default') { - $item_length = variable_get('feed_item_length', 'teaser'); + $item_length = config('system.rss')->get('items.view_mode'); } // Load the specified comment and its associated node: diff --git a/modules/node/views_plugin_row_node_rss.inc b/modules/node/views_plugin_row_node_rss.inc index 63c951bcd99e..b0161c5c8341 100644 --- a/modules/node/views_plugin_row_node_rss.inc +++ b/modules/node/views_plugin_row_node_rss.inc @@ -96,7 +96,7 @@ class views_plugin_row_node_rss extends views_plugin_row { $display_mode = $this->options['item_length']; if ($display_mode == 'default') { - $display_mode = variable_get('feed_item_length', 'teaser'); + $display_mode = config('system.rss')->get('items.view_mode'); } // Load the specified node: diff --git a/modules/search/views_handler_filter_search.inc b/modules/search/views_handler_filter_search.inc index 6f0f87cc9b69..d9292eba42b4 100644 --- a/modules/search/views_handler_filter_search.inc +++ b/modules/search/views_handler_filter_search.inc @@ -76,7 +76,7 @@ class views_handler_filter_search extends views_handler_filter { if (!empty($form_state['values'][$key])) { $this->query_parse_search_expression($form_state['values'][$key]); if (count($this->search_query->words()) == 0) { - form_set_error($key, format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); + form_set_error($key, format_plural(config('search.settings')->get('index.minimum_word_size'), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.')); } } } diff --git a/theme/theme.inc b/theme/theme.inc index a77cd2b80a62..8c9a62f12358 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -846,14 +846,16 @@ function template_preprocess_views_view_rss(&$vars) { $style = &$view->style_plugin; + $config = config('system.site'); + // The RSS 2.0 "spec" doesn't indicate HTML can be used in the description. // We strip all HTML tags, but need to prevent double encoding from properly // escaped source data (such as & becoming &). $vars['description'] = check_plain(decode_entities(strip_tags($style->get_description()))); if ($view->display_handler->get_option('sitename_title')) { - $title = variable_get('site_name', 'Drupal'); - if ($slogan = variable_get('site_slogan', '')) { + $title = $config->get('name'); + if ($slogan = $config->get('slogan')) { $title .= ' - ' . $slogan; } } @@ -877,7 +879,7 @@ function template_preprocess_views_view_rss(&$vars) { } // Compare the link to the default home page; if it's the default home page, just use $base_url. - if ($path == variable_get('site_frontpage', 'user')) { + if ($path == $config->get('page.front')) { $path = ''; }