From 43281909e652d651e8d5b721b440ea5c6eaf8798 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Jun 2016 14:24:00 +0200 Subject: [exams] Indent location by tree depth; fix ordering of locations in vis.js --- modules-available/locations/inc/location.inc.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules-available/locations/inc') diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index b1474279..69ddb4ee 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -78,6 +78,7 @@ class Location } $del = false; unset($row); + $index = 0; foreach ($rows as $key => &$row) { if ($del === false && $row['locationid'] == $excludeId) { $del = $row['depth']; @@ -91,6 +92,7 @@ class Location if ((is_array($selected) && in_array($row['locationid'], $selected)) || (int)$row['locationid'] === $selected) { $row['selected'] = true; } + $row['sortIndex'] = $index++; } if ($addNoParent) { array_unshift($rows, array( -- cgit v1.2.3-55-g7522