diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 399c9fb9e91605f209e272b01477227f54190ce5..6d2dd8f2f2102f415d5965e2f46793376a3f7ba1 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2428,7 +2428,7 @@ function language_list($flags = Language::STATE_CONFIGURABLE) { // Fill in master language list based on current configuration. $default = language_default(); - if (language_multilingual() || \Drupal::moduleHandler()->moduleExists('language')) { + if (language_multilingual() || module_exists('language')) { // Use language module configuration if available. $language_entities = config_get_storage_names_with_prefix('language.entity'); diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 6abab20173e6ac5bf056ef91ff28d93e5d9b465d..7b586a5eefd5b845089f034005e64cb401a5853e 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -2819,7 +2819,7 @@ function menu_get_router() { * @todo This function should be removed/refactored. */ function _menu_navigation_links_rebuild($menu) { - if (!\Drupal::moduleHandler()->moduleExists('menu_link')) { + if (!module_exists('menu_link')) { // The Menu link module may not be available during install, so rebuild // when possible. return; diff --git a/core/includes/update.inc b/core/includes/update.inc index 186255db38d3de2486b56b1788a2ef49b3907895..cac6ecf1d8aa4a857140346237d3965a69abd161 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -1636,7 +1636,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) { // Fill in master language list based on current configuration. $default = language_default(); - if (language_multilingual() || \Drupal::moduleHandler()->moduleExists('language')) { + if (language_multilingual() || module_exists('language')) { // Use language module configuration if available. We can not use // entity_load_multiple() because this breaks during updates. $language_entities = config_get_storage_names_with_prefix('language.entity'); diff --git a/core/modules/block/block.module b/core/modules/block/block.module index ce1ecb7625b9208b202efdd91ff523fbe87bb153..04e94c0452f67c469a103a380b6cec00f122f024 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -45,7 +45,7 @@ function block_help($path, $arg) { $output .= '<dd>' . t('When working with blocks, remember that all themes do <em>not</em> implement the same regions, or display regions in the same way. Blocks are positioned on a per-theme basis. Users with the <em>Administer blocks</em> permission can disable blocks. Disabled blocks are listed on the <a href="@blocks">Blocks administration page</a>, but are not displayed in any region.', array('@block' => 'http://drupal.org/documentation/modules/block', '@blocks' => url('admin/structure/block'))) . '</dd>'; $output .= '<dt>' . t('Controlling visibility') . '</dt>'; $output .= '<dd>' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain <a href="@content-type">content types</a>. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array('@content-type' => url('admin/structure/types'), '@user' => url('user'))) . '</dd>'; - if (\Drupal::moduleHandler()->moduleExists('custom_block')) { + if (module_exists('custom_block')) { $output .= '<dt>' . t('Creating custom blocks') . '</dt>'; $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can add custom blocks, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'))) . '</dd>'; } diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index 39610683b272decd96bad8f164ae251e1c916360..8e8177859e9579b59a9a1e2f1d9a0c2a2a863a0d 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -172,7 +172,7 @@ function custom_block_load($id) { */ function custom_block_entity_info_alter(&$types) { // Add a translation handler for fields if the language module is enabled. - if (\Drupal::moduleHandler()->moduleExists('language')) { + if (module_exists('language')) { $types['custom_block']['translation']['custom_block'] = TRUE; } } diff --git a/core/modules/content_translation/content_translation.pages.inc b/core/modules/content_translation/content_translation.pages.inc index f64599f86413ffb3835b18a59dc6c44f3079a7f3..6bb8d98b6fdc3076df42be8682084c4a50781633 100644 --- a/core/modules/content_translation/content_translation.pages.inc +++ b/core/modules/content_translation/content_translation.pages.inc @@ -23,7 +23,7 @@ function content_translation_overview(EntityInterface $entity) { $languages = language_list(); $original = $entity->getUntranslated()->language()->id; $translations = $entity->getTranslationLanguages(); - $field_ui = \Drupal::moduleHandler()->moduleExists('field_ui') && user_access('administer ' . $entity->entityType() . ' fields'); + $field_ui = module_exists('field_ui') && user_access('administer ' . $entity->entityType() . ' fields'); $path = $controller->getViewPath($entity); $base_path = $controller->getBasePath($entity); @@ -270,7 +270,7 @@ function content_translation_delete_confirm_submit(array $form, array &$form_sta // Remove any existing path alias for the removed translation. // @todo This should be taken care of by the Path module. - if (\Drupal::moduleHandler()->moduleExists('path')) { + if (module_exists('path')) { $conditions = array('source' => $controller->getViewPath($entity), 'langcode' => $language->id); \Drupal::service('path.crud')->delete($conditions); } diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module index 0f269b07728b0ede1aac4276b7bfccdda5f1a365..d7a5dde1cd14a237540dc434c4ae2b5b0616a24a 100644 --- a/core/modules/dblog/dblog.module +++ b/core/modules/dblog/dblog.module @@ -61,7 +61,7 @@ function dblog_menu() { 'route_name' => 'dblog.event', ); - if (\Drupal::moduleHandler()->moduleExists('search')) { + if (module_exists('search')) { $items['admin/reports/search'] = array( 'title' => 'Top search phrases', 'description' => 'View most popular search phrases.', diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index 8b9bc121196b986a86032e1b0ec0806994e7cf39..16a913874beef911f76c6943539ef7f07d969eb1 100644 --- a/core/modules/field/field.api.php +++ b/core/modules/field/field.api.php @@ -43,7 +43,7 @@ */ function hook_field_extra_fields() { $extra = array(); - $module_language_enabled = \Drupal::moduleHandler()->moduleExists('language'); + $module_language_enabled = module_exists('language'); $description = t('Node module element'); foreach (node_type_get_types() as $bundle) { diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 76215953723182a77811e040eaa364d24196f4e8..60a66f0c94897b405de445a1ec209cfa167feff2 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -176,7 +176,7 @@ function field_system_info_alter(&$info, $file, $type) { } } if ($non_deleted) { - if (\Drupal::moduleHandler()->moduleExists('field_ui')) { + if (module_exists('field_ui')) { $explanation = t('Field type(s) in use - see <a href="@fields-page">Field list</a>', array('@fields-page' => url('admin/reports/fields'))); } else { diff --git a/core/modules/help/help.module b/core/modules/help/help.module index 902762168499cb29f195bd0b5ab414287e84b34f..1d127f354743e0e628b0b59f1d29db871473a226 100644 --- a/core/modules/help/help.module +++ b/core/modules/help/help.module @@ -37,7 +37,7 @@ function help_help($path, $arg) { $output .= '<li>' . t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '</li>'; $output .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/appearance'), '@download_themes' => 'http://drupal.org/project/themes')) . '</li>'; // Display a link to the create content page if Node module is enabled. - if (\Drupal::moduleHandler()->moduleExists('node')) { + if (module_exists('node')) { $output .= '<li>' . t('<strong>Start posting content</strong> Finally, you can <a href="@content">add new content</a> for your website.', array('@content' => url('node/add'))) . '</li>'; } $output .= '</ol>'; diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index e7403428e540779a539c28d897b8695b0c0c8e2b..f62b9335786b3eebca7d21d53fddbb328fc98e24 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -273,7 +273,7 @@ function language_negotiation_configure_form_submit($form, &$form_state) { // Clear block definitions cache since the available blocks and their names // may have been changed based on the configurable types. - if (\Drupal::moduleHandler()->moduleExists('block')) { + if (module_exists('block')) { // If there is an active language switcher for a language type that has been // made not configurable, deactivate it first. $non_configurable = array_keys(array_diff($customized, array_filter($customized))); diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index fe525706bc9361e1899715bec088550470d9d38b..b3d12d64d14cd79d143a81dca283bf8b8ccf30fc 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -45,7 +45,7 @@ function menu_help($path, $arg) { case 'admin/structure/menu/add': return '<p>' . t('You can enable the newly-created block for this menu on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>'; } - if ($path == 'admin/structure/menu' && \Drupal::moduleHandler()->moduleExists('block')) { + if ($path == 'admin/structure/menu' && module_exists('block')) { return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>'; } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index c1ccf4e96fd5695a0e341db2a6856a660ce965de..f163b51e71e72a254f8cc6b7dd7efdfa7b02a982 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -279,7 +279,7 @@ function node_mark($nid, $timestamp) { global $user; $cache = &drupal_static(__FUNCTION__, array()); - if ($user->isAnonymous() || !\Drupal::moduleHandler()->moduleExists('history')) { + if ($user->isAnonymous() || !module_exists('history')) { return MARK_READ; } if (!isset($cache[$nid])) { @@ -443,7 +443,7 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') { */ function node_field_extra_fields() { $extra = array(); - $module_language_enabled = \Drupal::moduleHandler()->moduleExists('language'); + $module_language_enabled = module_exists('language'); $description = t('Node module element'); foreach (node_type_get_types() as $bundle) { diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc index 6c826043945eb53a458c0f54ed9029bb0cc295ae..0f2fb92b39373be596ddce18ce41315e5dd3f8aa 100644 --- a/core/modules/node/node.views.inc +++ b/core/modules/node/node.views.inc @@ -648,7 +648,7 @@ function node_row_node_view_preprocess_node(&$variables) { */ function node_views_wizard() { // @todo: figure this piece out. - if (\Drupal::moduleHandler()->moduleExists('statistics')) { + if (module_exists('statistics')) { $plugins['node']['available_sorts']['node_counter-totalcount:DESC'] = t('Number of hits'); } diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 284442bdd8f445dfee2e0e0f6e5022d03c5adc09..912e29dc8a530cd44580d09b3109463a262f3447 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -501,7 +501,7 @@ function overlay_overlay_parent_initialize() { } drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); $path_prefixes = array(); - if (\Drupal::moduleHandler()->moduleExists('language')) { + if (module_exists('language')) { language_negotiation_include(); if (\Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) { // Skip the empty string indicating the default language. We always accept diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc index d387bff825fa46ef51098e223918886efad0fd8a..4c5b3f4a0fd90a216374a8aed702077498487b95 100644 --- a/core/modules/path/path.admin.inc +++ b/core/modules/path/path.admin.inc @@ -21,7 +21,7 @@ function path_admin_overview($keys = NULL) { // Enable language column if language.module is enabled or if we have any // alias with a language. $alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE langcode <> :langcode', 0, 1, array(':langcode' => Language::LANGCODE_NOT_SPECIFIED))->fetchField(); - $multilanguage = (\Drupal::moduleHandler()->moduleExists('language') || $alias_exists); + $multilanguage = (module_exists('language') || $alias_exists); $header = array(); $header[] = array('data' => t('Alias'), 'field' => 'alias', 'sort' => 'asc'); @@ -157,7 +157,7 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali ); // A hidden value unless language.module is enabled. - if (\Drupal::moduleHandler()->moduleExists('language')) { + if (module_exists('language')) { $languages = language_list(); foreach ($languages as $langcode => $language) { $language_options[$langcode] = $language->name; diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 0d2dbebb5f01cdf9e847a61aaab3660fe2436d40..f220198c6c1eb3e2e16f70b7681b920cc3ce5645 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -505,7 +505,7 @@ function system_requirements($phase) { if ($phase == 'runtime') { // Check for update status module. - if (!\Drupal::moduleHandler()->moduleExists('update')) { + if (!module_exists('update')) { $requirements['update status'] = array( 'value' => t('Not enabled'), 'severity' => REQUIREMENT_WARNING, diff --git a/core/modules/system/system.module b/core/modules/system/system.module index acdf63953f269dc5b302f980f4ca25ed9a40d8a2..9309d7502a244329a2ea40cb2c689daacb0275d0 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -103,7 +103,7 @@ function system_help($path, $arg) { return '<p>' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '</p>'; case 'admin/modules': $output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>'; - if (\Drupal::moduleHandler()->moduleExists('update')) { + if (module_exists('update')) { if (update_manager_access()) { $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>'; } @@ -886,7 +886,7 @@ function system_menu() { ); // Localize date formats. - if (\Drupal::moduleHandler()->moduleExists('language')) { + if (module_exists('language')) { $items['admin/config/regional/date-time/locale'] = array( 'title' => 'Localize', 'description' => 'Configure date formats for each locale', diff --git a/core/modules/system/tests/modules/entity_test/entity_test.views.inc b/core/modules/system/tests/modules/entity_test/entity_test.views.inc index 32da74d1cd15caada9cc190b500a6b3a2f9fcbb0..5e3975b28f457935967fa22c820802cb92c35b98 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.views.inc +++ b/core/modules/system/tests/modules/entity_test/entity_test.views.inc @@ -55,7 +55,7 @@ function entity_test_views_data() { ), ); - if (\Drupal::moduleHandler()->moduleExists('langcode')) { + if (module_exists('langcode')) { $data['entity_test']['langcode'] = array( 'title' => t('Language'), 'help' => t('The {language}.langcode of the original variant of this test entity.'), diff --git a/core/modules/tracker/tracker.pages.inc b/core/modules/tracker/tracker.pages.inc index eeef432cc4170e6890004596b8d3dbcb207e024d..16b391e5cab7c917db7e96693a2b889e410c504c 100644 --- a/core/modules/tracker/tracker.pages.inc +++ b/core/modules/tracker/tracker.pages.inc @@ -101,7 +101,7 @@ function tracker_page($account = NULL, $set_title = FALSE) { ); // Adds extra RDFa markup to the $row array if the RDF module is enabled. - if (\Drupal::moduleHandler()->moduleExists('rdf')) { + if (module_exists('rdf')) { $mapping = rdf_get_mapping('node', $node->getType()); // Adds RDFa markup to the title of the node. Because the RDFa markup is // added to the td tag which might contain HTML code, we specify an diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 0aa4d17bac4c5a3988e9eb0d94b1c29a632e4c6d..7620ee51cc817d61c9c2c5eaf83ed59795682fbb 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -608,7 +608,7 @@ function user_update_8011() { // User pictures can only be migrated to the new user picture image field // if Image module is installed. - if (!\Drupal::moduleHandler()->moduleExists('image')) { + if (!module_exists('image')) { $old_schema = \Drupal::moduleHandler()->install(array('image')); if ($old_schema['image'] == SCHEMA_UNINSTALLED) { // Install image.module with schema version 8002 as a previous version diff --git a/core/scripts/generate-d7-content.sh b/core/scripts/generate-d7-content.sh index bd24300f3b8d50b19b9b6b1f2aabfeb56e82e285..87ec22ac6c39dc91d0c67e347b9e0a08471e1244 100644 --- a/core/scripts/generate-d7-content.sh +++ b/core/scripts/generate-d7-content.sh @@ -171,7 +171,7 @@ else if ($i < 24) { $node->type = 'story'; } - else if (\Drupal::moduleHandler()->moduleExists('blog')) { + else if (module_exists('blog')) { $node->type = 'blog'; } $node->sticky = 0; diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 3754ebdf393cab9eba3ad3f8e532d45ba09ed57d..31ea371cac65d454dae6fac9da141b7c30d15d53 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -35,7 +35,7 @@ drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE); simpletest_classloader_register(); -if (!\Drupal::moduleHandler()->moduleExists('simpletest')) { +if (!module_exists('simpletest')) { simpletest_script_print_error("The simpletest module must be enabled before this script can run."); exit; } diff --git a/core/update.php b/core/update.php index ae74e2914e53b9a07586742db8792d0d8ded129c..db92c1aa680a14ea0b227c1692b38e47ee2aa5b2 100644 --- a/core/update.php +++ b/core/update.php @@ -203,7 +203,7 @@ function update_results_page() { update_task_list(); // Report end result. - if (\Drupal::moduleHandler()->moduleExists('dblog') && user_access('access site reports')) { + if (module_exists('dblog') && user_access('access site reports')) { $log_message = ' All errors have been <a href="' . base_path() . '?q=admin/reports/dblog">logged</a>.'; } else { @@ -217,7 +217,7 @@ function update_results_page() { $last = reset($_SESSION['updates_remaining']); list($module, $version) = array_pop($last); $output = '<p class="error">The update process was aborted prematurely while running <strong>update #' . $version . ' in ' . $module . '.module</strong>.' . $log_message; - if (\Drupal::moduleHandler()->moduleExists('dblog')) { + if (module_exists('dblog')) { $output .= ' You may need to check the <code>watchdog</code> database table manually.'; } $output .= '</p>';