File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,23 @@ function patternkit_pattern_libraries() {
98
98
function patternkit_patternkit_library() {
99
99
$libraries = array();
100
100
101
+ // Load patterns from this module for testing.
101
102
$module_path = drupal_get_path('module', 'patternkit');
102
103
$lib_path = $module_path . DIRECTORY_SEPARATOR . 'lib';
103
104
$libraries[] = new PatternkitDrupalTwigLib('Example', $lib_path);
104
105
106
+ // Load patterns from themes exposing namespaces.
107
+ foreach (list_themes() as $theme_name => $theme) {
108
+ if ($theme->engine !== 'twig' || !isset($theme->info['namespaces'])) {
109
+ continue;
110
+ }
111
+ foreach ($theme->info['namespaces'] as $namespace => $path) {
112
+ $theme_path = dirname($theme->filename);
113
+ $lib_path = $theme_path . DIRECTORY_SEPARATOR . $path;
114
+ $libraries[] = new PatternkitDrupalTwigLib($namespace, $lib_path);
115
+ }
116
+ }
117
+
105
118
return $libraries;
106
119
}
107
120
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
3
* @file
4
- * customer-portal-kbase-copy
5
- *
6
- * - Created by jassmith on 2/2/18
4
+ * Patternkit module - Twig wrapper.
7
5
*/
8
6
7
+ /**
8
+ * Class PatternkitTwigWrapper.
9
+ */
9
10
class PatternkitTwigWrapper {
10
11
11
12
protected $ metadata ;
You can’t perform that action at this time.
0 commit comments