@@ -69,6 +69,7 @@ public static function environmentbar_exists() {
69
69
* @return array
70
70
*/
71
71
public static function search ($ search , $ configitems = []) {
72
+ global $ DB ;
72
73
$ result = [];
73
74
74
75
$ adminroot = admin_get_root ();
@@ -117,6 +118,36 @@ public static function search($search, $configitems = []) {
117
118
118
119
}
119
120
121
+ $ likeplugin = $ DB ->sql_like ('plugin ' , ':likeplugin ' );
122
+ $ likename = $ DB ->sql_like ('name ' , ':likename ' );
123
+ $ notlikename = $ DB ->sql_like ('name ' , ':notlikename ' , true , true , true );
124
+ $ likevalue = $ DB ->sql_like ('value ' , ':likevalue ' );
125
+ $ nontreefindings = $ DB ->get_records_sql (
126
+ "SELECT *
127
+ FROM {config_plugins}
128
+ WHERE ( {$ likeplugin }
129
+ OR {$ likename }
130
+ OR {$ likevalue })
131
+ AND $ notlikename " ,
132
+ [
133
+ 'likeplugin ' => $ search ,
134
+ 'likename ' => $ search ,
135
+ 'likevalue ' => $ search ,
136
+ 'notlikename ' => 'version ' ,
137
+ ]
138
+ );
139
+
140
+ foreach ($ nontreefindings as $ setting ) {
141
+ $ record = new stdClass ();
142
+ $ record ->plugin = (empty ($ setting ->plugin ) ? 'core ' : $ setting ->plugin );
143
+ $ record ->value = get_config ($ record ->plugin , $ setting ->name );
144
+ $ record ->name = $ setting ->name ;
145
+ $ record ->textarea = false ;
146
+ $ record ->display = true ;
147
+
148
+ $ result [$ record ->plugin ][$ record ->name ] = $ record ;
149
+ }
150
+
120
151
return $ result ;
121
152
}
122
153
0 commit comments