Skip to content
Snippets Groups Projects
Verified Commit 57259caa authored by Aleksi Peebles's avatar Aleksi Peebles Committed by Rob Loach
Browse files

Issue #2837836 by aleksip: Allow modules to define component libraries

parent 27178a9c
No related branches found
No related tags found
No related merge requests found
......@@ -56,10 +56,18 @@ class ComponentLibraryLoader extends \Twig_Loader_Filesystem {
foreach ($extension_type['handler']->{$extension_type['method']}() as $name => $extension) {
$existing_namespaces[] = $name;
// If type is 'module' we need to get the info.
if ($type == 'module') {
$info = system_get_info($type, $name);
}
else {
$info = $extension->info;
}
// For each library listed in the .info file's component-libraries
// section, determine the namespace and the path.
if (isset($extension->info['component-libraries'])) {
foreach ($extension->info['component-libraries'] as $namespace => $library) {
if (isset($info['component-libraries'])) {
foreach ($info['component-libraries'] as $namespace => $library) {
$paths = isset($library['paths']) ? $library['paths'] : array();
// Allow paths to be an array or a string.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment