MDL-38109 use always get_plugin_list() to get list of plugins

get_list_of_plugins() is NOT intended for real plugins, only plugin like directories.
This commit is contained in:
Petr Škoda
2013-06-11 10:22:45 +02:00
parent b3be471f52
commit a9cda870ba
4 changed files with 9 additions and 10 deletions
+2 -2
View File
@@ -513,8 +513,8 @@ function filter_get_all_installed() {
global $CFG;
$filternames = array();
foreach (get_list_of_plugins('filter') as $filter) {
if (is_readable("$CFG->dirroot/filter/$filter/filter.php")) {
foreach (get_plugin_list('filter') as $filter => $fulldir) {
if (is_readable("$fulldir/filter.php")) {
$filternames[$filter] = filter_get_name($filter);
}
}
+2 -2
View File
@@ -3820,8 +3820,8 @@ function assignment_get_types() {
}
/// Drop-in extra assignment types
$assignmenttypes = get_list_of_plugins('mod/assignment/type');
foreach ($assignmenttypes as $assignmenttype) {
$assignmenttypes = get_plugin_list('assignment');
foreach ($assignmenttypes as $assignmenttype=>$fulldir) {
if (!empty($CFG->{'assignment_hide_'.$assignmenttype})) { // Not wanted
continue;
}
+3 -3
View File
@@ -240,11 +240,11 @@ switch ($mode) {
/// Print the browsing interface
///get the list of possible fields (plugins)
$directories = get_list_of_plugins('mod/data/field/');
$plugins = get_plugin_list('datafield');
$menufield = array();
foreach ($directories as $directory){
$menufield[$directory] = get_string($directory,'data'); //get from language files
foreach ($plugins as $plugin=>$fulldir){
$menufield[$plugin] = get_string('pluginname', 'datafield_'.$plugin); //get from language files
}
asort($menufield); //sort in alphabetical order
$PAGE->set_title(get_string('course') . ': ' . $course->fullname);
+2 -3
View File
@@ -1877,9 +1877,8 @@ function data_get_available_presets($context) {
$presets = array();
// First load the ratings sub plugins that exist within the modules preset dir
if ($dirs = get_list_of_plugins('mod/data/preset')) {
foreach ($dirs as $dir) {
$fulldir = $CFG->dirroot.'/mod/data/preset/'.$dir;
if ($dirs = get_plugin_list('datapreset')) {
foreach ($dirs as $dir=>$fulldir) {
if (is_directory_a_preset($fulldir)) {
$preset = new stdClass();
$preset->path = $fulldir;