mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 21:45:37 +02:00
"MDL-15349, create a new function to get all repository plugins"
This commit is contained in:
parent
a72529c73f
commit
97f7393dcc
@ -249,5 +249,23 @@ function repository_get_option($id, $position){
|
||||
$ret = (array)unserialize($entry->$option);
|
||||
return $ret;
|
||||
}
|
||||
function repository_get_plugins(){
|
||||
global $CFG;
|
||||
$repo = $CFG->dirroot.'/repository/';
|
||||
$ret = array();
|
||||
if($dir = opendir($repo)){
|
||||
while (false !== ($file = readdir($dir))) {
|
||||
if(is_dir($file) && $file != '.' && $file != '..'
|
||||
&& file_exists($repo.$file.'/repository.class.php')){
|
||||
require_once($repo.$file.'/version.php');
|
||||
$ret[] = array('name'=>$plugin->name,
|
||||
'version'=>$plugin->version,
|
||||
'path'=>$repo.$file,
|
||||
'settings'=>file_exists($repo.$file.'/settings.php'));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user