@@ -53,32 +53,35 @@ class snippets {
53
53
* @param mixed $domain
54
54
* @return string|null
55
55
*/
56
- public static function get_snippet_file ($ key , $ source , $ domain = '' ) {
56
+ public static function get_snippet_file ($ key , $ source , $ domain ) {
57
57
global $ CFG ;
58
58
if ('theme_boost_union ' === $ source ) {
59
59
$ file = $ CFG ->dirroot . sprintf ('/theme/boost_union/snippets/builtin/%s.scss ' , $ key );
60
60
} else {
61
+ // TODO: other sources.
61
62
return null ;
62
63
}
64
+
63
65
return is_readable ($ file ) ? $ file : null ;
64
66
}
65
67
66
68
/**
67
- * TODO
69
+ * Loads the Snippets SCSS content.
70
+ *
68
71
* @param mixed $key
69
72
* @param mixed $source
70
73
* @param mixed $domain
71
- * @return bool |string
74
+ * @return boolean |string
72
75
*/
73
- public static function get_snippet_css ($ key , $ source , $ domain = '' ) {
74
- // Get the snippets file, based on the source and domain.s
75
- $ file = self ::get_snippet_file ($ key , $ source );
76
+ public static function get_snippet_scss ($ key , $ source , $ domain = '' ) {
77
+ // Get the snippets file, based on the source and domain.
78
+ $ file = self ::get_snippet_file ($ key , $ source, $ domain );
76
79
77
80
if (is_null ($ file )) {
78
- return ;
81
+ return null ;
79
82
}
80
- $ scss = file_get_contents ( $ file , false , null , 0 );
81
83
84
+ $ scss = file_get_contents ( $ file , false , null , 0 );
82
85
return $ scss ;
83
86
}
84
87
@@ -88,11 +91,11 @@ public static function get_snippet_css($key, $source, $domain = '') {
88
91
* @param string $domain
89
92
* @return mixed
90
93
*/
91
- public static function get_snippet_meta ($ key , $ source ) {
94
+ public static function get_snippet_meta ($ key , $ source, $ domain = '' ) {
92
95
global $ CFG ;
93
96
94
97
// Get the snippets file, based on the source and domain.
95
- $ file = self ::get_snippet_file ($ key , $ source );
98
+ $ file = self ::get_snippet_file ($ key , $ source, $ domain );
96
99
97
100
if (is_null ($ file )) {
98
101
return ;
0 commit comments