function patterns_paths in Patterns 6.2
Same name and namespace in other branches
- 6 patterns.module \patterns_paths()
return a list of paths that will be scanned for patterns
3 calls to patterns_paths()
- drush_patterns_patterns_paths in ./
patterns.drush.inc - patterns list command callback.
- patterns_get_patterns in ./
patterns.module - patterns_help in ./
patterns.module - Implementation of hook_help().
File
- ./
patterns.module, line 1016 - Enables extremely simple adding/removing features to your site with minimal to no configuration
Code
function patterns_paths() {
global $profile;
if (!isset($profile)) {
$profile = variable_get('install_profile', 'default');
}
// array of all the paths where we should look for patterns
$patterns_paths = array(
conf_path() . '/patterns',
'profiles/' . $profile . '/patterns',
'sites/all/patterns',
);
// allow any module to include patterns too
foreach (module_invoke_all('patterns_directory') as $path) {
if (is_dir($path)) {
$patterns_paths[] = $path . '/patterns';
}
}
// also prepend files folder if it's valid
$path = file_create_path(variable_get('patterns_save_xml', 'patterns'));
if (file_check_directory($path)) {
array_unshift($patterns_paths, $path);
}
return $patterns_paths;
}