Skip to content

Commit

Permalink
MDL-38109 use always get_plugin_list() to get list of plugins
Browse files Browse the repository at this point in the history
get_list_of_plugins() is NOT intended for real plugins, only plugin like directories.
  • Loading branch information
skodak committed Jun 11, 2013
1 parent 1430866 commit e4fcb52
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/filterlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions mod/assignment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions mod/data/field.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@
/// 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);
Expand Down
5 changes: 2 additions & 3 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e4fcb52

Please sign in to comment.