Skip to content

Commit

Permalink
"MDL-15349, create a new function to get all repository plugins"
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed Jul 7, 2008
1 parent a72529c commit 97f7393
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions repository/lib.php
Expand Up @@ -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;
}

?>

0 comments on commit 97f7393

Please sign in to comment.