]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-21103, check if repository plugin existed"
authorDongsheng Cai <unoter@gmail.com>
Tue, 15 Dec 2009 08:09:00 +0000 (08:09 +0000)
committerDongsheng Cai <unoter@gmail.com>
Tue, 15 Dec 2009 08:09:00 +0000 (08:09 +0000)
repository/lib.php

index 3a726c4258e2c9577ac1b55cb8e8c4e089fd9f99..7d8d303b8ddb9ebe728eaddf4b6b3184b0df8b82 100644 (file)
@@ -659,6 +659,9 @@ abstract class repository {
         $repositories = array();
         $ft = new file_type_to_ext();
         foreach ($records as $record) {
+            if (!file_exists($CFG->dirroot . '/repository/'. $record->repositorytype.'/repository.class.php')) {
+                continue;
+            }
             require_once($CFG->dirroot . '/repository/'. $record->repositorytype.'/repository.class.php');
             $options['visible'] = $record->visible;
             $options['name']    = $record->name;
@@ -1774,12 +1777,12 @@ function repository_head_setup() {
     $PAGE->requires->yui_lib('button')->in_head();
     $PAGE->requires->yui_lib('selector')->in_head();
 
-    //TODO: remove the ->in_head() once we refactor the inline script tags in repo code
-    $PAGE->requires->js('repository/repository.src.js')->in_head();
-
     //TODO: remove following after we moe the content of file
     //      proper place (==themes)
     $PAGE->requires->css('repository/repository.css');
+
+    //TODO: remove the ->in_head() once we refactor the inline script tags in repo code
+    $PAGE->requires->js('repository/repository.src.js')->in_head();
 }
 
 /**