Commit fe83dcab authored by damiankloip's avatar damiankloip Committed by tim.plunkett
Browse files

Issue #1751282 by damiankloip: Create helper function to get list of core modules.

parent a25e8fed
......@@ -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');
......
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