diff --git a/core/modules/node/config/node.settings.yml b/core/modules/node/config/node.settings.yml new file mode 100644 index 0000000..586c194 --- /dev/null +++ b/core/modules/node/config/node.settings.yml @@ -0,0 +1,5 @@ +node_admin_theme: '0' +node_cron_last: '0' +node_recent_block_count: '10' +default_nodes_main: '10' +vote_node_enabled: '0' diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 7add837..9c24e85 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -297,7 +297,7 @@ function node_uri(Node $node) { * Implements hook_admin_paths(). */ function node_admin_paths() { - if (variable_get('node_admin_theme')) { + if (config('node.settings')->get('node_admin_theme')) { $paths = array( 'node/*/edit' => TRUE, 'node/*/delete' => TRUE, @@ -1639,7 +1639,7 @@ function node_ranking() { ); // Add relevance based on creation or changed date. - if ($node_cron_last = variable_get('node_cron_last', 0)) { + if ($node_cron_last = config('node.settings')->get('node_cron_last', 0)) { $ranking['recent'] = array( 'title' => t('Recently posted'), // Exponential decay with half-life of 6 months, starting at last indexed node @@ -2116,7 +2116,7 @@ function node_block_view($delta = '') { case 'recent': if (user_access('access content')) { $block['subject'] = t('Recent content'); - if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { + if ($nodes = node_get_recent(config('node.settings')->get('node_recent_block_count'))) { $block['content'] = array( '#theme' => 'node_recent_block', '#nodes' => $nodes, @@ -2139,7 +2139,7 @@ function node_block_configure($delta = '') { $form['node_recent_block_count'] = array( '#type' => 'select', '#title' => t('Number of recent content items to display'), - '#default_value' => variable_get('node_recent_block_count', 10), + '#default_value' => config('node.settings')->get('node_recent_block_count'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)), ); } @@ -2542,7 +2542,7 @@ function node_page_default() { ->orderBy('n.sticky', 'DESC') ->orderBy('n.created', 'DESC') ->extend('Drupal\Core\Database\Query\PagerSelectExtender') - ->limit(variable_get('default_nodes_main', 10)) + ->limit(config('node.settings')->get('default_nodes_main')) ->addTag('node_access'); $nids = $select->execute()->fetchCol(); @@ -2794,7 +2794,7 @@ function node_form_system_site_information_settings_form_alter(&$form, &$form_st $form['front_page']['default_nodes_main'] = array( '#type' => 'select', '#title' => t('Number of posts on front page'), - '#default_value' => variable_get('default_nodes_main', 10), + '#default_value' => config('node.settings')->get('default_nodes_main'), '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)), '#access' => (config('system.site')->get('page.front') == 'node'), '#description' => t('The maximum number of posts displayed on overview pages such as the front page.'), @@ -2822,7 +2822,7 @@ function node_form_system_themes_admin_form_alter(&$form, &$form_state, $form_id $form['admin_theme']['node_admin_theme'] = array( '#type' => 'checkbox', '#title' => t('Use the administration theme when editing or creating content'), - '#default_value' => variable_get('node_admin_theme', '0'), + '#default_value' => config('node.settings')->get('node_admin_theme'), ); $form['#submit'][] = 'node_form_system_themes_admin_form_submit'; }