From fe83dcab18562f377231232bca4ab8ef2da6e6c8 Mon Sep 17 00:00:00 2001
From: damiankloip <damiankloip@1037976.no-reply.drupal.org>
Date: Sat, 25 Aug 2012 13:40:18 +0200
Subject: [PATCH] Issue #1751282 by damiankloip: Create helper function to get
 list of core modules.

---
 views.module | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/views.module b/views.module
index f9422e0e5287..765c13d75ebe 100644
--- a/views.module
+++ b/views.module
@@ -22,16 +22,40 @@ function views_api_version() {
   return '3.0';
 }
 
+/**
+ * Returns a list of Drupal core modules.
+ *
+ * @return array
+ */
+function views_core_modules() {
+  return array(
+    'aggregator',
+    'book',
+    'comment',
+    'contact',
+    'field',
+    'filter',
+    'file',
+    'locale',
+    'node',
+    'search',
+    'statistics',
+    'system',
+    'taxonomy',
+    'translation',
+    'user'
+  );
+}
+
 /**
  * Implements hook_init().
  *
  *
  */
 function views_init() {
-  $core_modules = array('aggregator', 'book', 'comment', 'contact', 'field', 'filter', 'file', 'locale', 'node', 'search', 'statistics', 'system', 'taxonomy', 'translation', 'user');
   $path = drupal_get_path('module', 'views');
   $loader = drupal_classloader();
-  foreach ($core_modules as $module) {
+  foreach (views_core_modules() as $module) {
     $function = $module . '_views_api';
     if (function_exists($function)) {
       $loader->registerNamespace('Views\\' . $module, DRUPAL_ROOT . '/' . $path . '/lib');
-- 
GitLab