summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.module60
1 files changed, 4 insertions, 56 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index bb9161718..b2a8761d1 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -869,11 +869,13 @@ function system_get_files_database(&$files, $type) {
* Collect data about all currently available themes
*/
function system_theme_data() {
+ include_once './includes/install.inc';
+
// Find themes
- $themes = system_listing('\.theme$', 'themes');
+ $themes = drupal_system_listing('\.theme$', 'themes');
// Find theme engines
- $engines = system_listing('\.engine$', 'themes/engines');
+ $engines = drupal_system_listing('\.engine$', 'themes/engines');
// can't iterate over array itself as it uses a copy of the array items
foreach (array_keys($themes) as $key) {
@@ -997,60 +999,6 @@ function system_default_region($theme) {
}
/**
- * Returns an array of files objects of the given type from the site-wide
- * directory (i.e. modules/), the all-sites directory (i.e.
- * sites/all/modules/), the profiles directory, and site-specific directory
- * (i.e. sites/somesite/modules/). The returned array will be keyed using the
- * key specified (name, basename, filename). Using name or basename will cause
- * site-specific files to be prioritized over similar files in the default
- * directories. That is, if a file with the same name appears in both the
- * site-wide directory and site-specific directory, only the site-specific
- * version will be included.
- *
- * @param $mask
- * The regular expression of the files to find.
- * @param $directory
- * The subdirectory name in which the files are found. For example,
- * 'modules' will search in both modules/ and
- * sites/somesite/modules/.
- * @param $key
- * The key to be passed to file_scan_directory().
- * @param $min_depth
- * Minimum depth of directories to return files from.
- *
- * @return
- * An array of file objects of the specified type.
- */
-function system_listing($mask, $directory, $key = 'name', $min_depth = 1) {
- $config = conf_path();
- $profile = variable_get('install_profile', 'default');
- $searchdir = array($directory);
- $files = array();
-
- // Always search sites/all/* as well as the global directories
- $searchdir[] = 'sites/all';
-
- // The 'profiles' directory contains pristine collections of modules and
- // themes as organized by a distribution. It is pristine in the same way
- // that /modules is pristine for core; users should avoid changing anything
- // there in favor of sites/all or sites/<domain> directories.
- if (file_exists("profiles/$profile/$directory")) {
- $searchdir[] = "profiles/$profile/$directory";
- }
-
- if (file_exists("$config/$directory")) {
- $searchdir[] = "$config/$directory";
- }
-
- // Get current list of items
- foreach ($searchdir as $dir) {
- $files = array_merge($files, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, $key, $min_depth));
- }
-
- return $files;
-}
-
-/**
* Assign an initial, default set of blocks for a theme.
*
* This function is called the first time a new theme is enabled. The new theme