* @return array Repository types
*/
public static function get_types($visible=null) {
- global $DB;
+ global $DB, $CFG;
$types = array();
$params = null;
}
if ($records = $DB->get_records('repository',$params,'sortorder')) {
foreach($records as $type) {
- $types[] = new repository_type($type->type, (array)get_config($type->type), $type->visible, $type->sortorder);
+ if (file_exists($CFG->dirroot . '/repository/'. $type->type .'/repository.class.php')) {
+ $types[] = new repository_type($type->type, (array)get_config($type->type), $type->visible, $type->sortorder);
+ }
}
}