Issue #1751282 by damiankloip: Create helper function to get list of core modules.
parent
a25e8fedfb
commit
fe83dcab18
28
views.module
28
views.module
|
@ -22,16 +22,40 @@ function views_api_version() {
|
||||||
return '3.0';
|
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().
|
* Implements hook_init().
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function views_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');
|
$path = drupal_get_path('module', 'views');
|
||||||
$loader = drupal_classloader();
|
$loader = drupal_classloader();
|
||||||
foreach ($core_modules as $module) {
|
foreach (views_core_modules() as $module) {
|
||||||
$function = $module . '_views_api';
|
$function = $module . '_views_api';
|
||||||
if (function_exists($function)) {
|
if (function_exists($function)) {
|
||||||
$loader->registerNamespace('Views\\' . $module, DRUPAL_ROOT . '/' . $path . '/lib');
|
$loader->registerNamespace('Views\\' . $module, DRUPAL_ROOT . '/' . $path . '/lib');
|
||||||
|
|
Loading…
Reference in New Issue