]> git.mjollnir.org Git - moodle.git/commitdiff
prefix is no longer needed for the array containing event dataI(e.g. $mod_assignment_...
authortoyomoyo <toyomoyo>
Thu, 10 May 2007 03:46:10 +0000 (03:46 +0000)
committertoyomoyo <toyomoyo>
Thu, 10 May 2007 03:46:10 +0000 (03:46 +0000)
lib/eventslib.php

index 6fee7a8b6280e6e9a1900799a8a45b8bacaa4994..bfa1bcbcb54ec0d37d60b7a50e18255e6a60ed30 100755 (executable)
@@ -29,25 +29,23 @@ function events_load_def($component) {
             // 'block'. So we need to jump through hoops.
             $defpath = $CFG->dirroot.'/'.$compparts[0].
                                 's/'.$compparts[1].'/db/events.php';
-            $varprefix = $compparts[0].'_'.$compparts[1];
         } else if ($compparts[0] == 'format') {
             // Similar to the above, course formats are 'format' while they 
             // are stored in 'course/format'.
             $defpath = $CFG->dirroot.'/course/'.$component.'/db/events.php';
-            $varprefix = $compparts[0].'_'.$compparts[1];
         } else {
             $defpath = $CFG->dirroot.'/'.$component.'/db/events.php';
-            $varprefix = str_replace('/', '_', $component);
         }
     }
     $events = array();
 
     if (file_exists($defpath)) {
         require($defpath);
-        $events = ${$varprefix.'_events'};
+        $compevents = $events;
+    }
+    if ($compevents) {
+        return $compevents;
     }
-    
-    return $events;
 }
 
 /**