/** * @see system_list() * * @return array[] */ public function loadSystemLists() { $lists = array('module_enabled' => array(), 'theme' => array(), 'filepaths' => array()); // The module name (rather than the filename) is used as the fallback // weighting in order to guarantee consistent behavior across different // Drupal installations, which might have modules installed in different // locations in the file system. The ordering here must also be // consistent with the one used in module_implements(). foreach ($this->systemTable->systemTableSortedObjects() as $record) { // Build a list of all enabled modules. if ($record->type == 'module') { if (1 != $record->status) { continue; } $lists['module_enabled'][$record->name] = $record; } elseif ($record->type == 'theme') { $lists['theme'][$record->name] = $record; } else { continue; } // Build a list of filenames so drupal_get_filename can use it. if ($record->status) { $lists['filepaths'][] = array('type' => $record->type, 'name' => $record->name, 'filepath' => $record->filename); } } $this->themesAddHierarchy($lists['theme']); return $lists; }