Skip to content
Snippets Groups Projects
Commit dcec9ff0 authored by Matt Petro's avatar Matt Petro
Browse files

Fixed closure for compatibility with php 5.3

parent 913b5378
No related branches found
No related tags found
No related merge requests found
......@@ -103,9 +103,10 @@ class block_course_overview_uwmoodle extends block_base {
}
// Sort terms, descending
// TERM_OTHER courses get ordered right after current term
$sortfcn = function($a,$b) use ($currentterm) {
if ($a == self::TERM_OTHER) { $a = $currentterm - 0.5; }
if ($b == self::TERM_OTHER) { $b = $currentterm - 0.5; }
$term_other = self::TERM_OTHER; // closures in php < 5.4 don't include class information
$sortfcn = function($a,$b) use ($currentterm, $term_other) {
if ($a == $term_other) { $a = $currentterm - 0.5; }
if ($b == $term_other) { $b = $currentterm - 0.5; }
if ($a == $b) {return 0;}
return ($a > $b)? -1 : 1;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment