-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattributes.php
More file actions
53 lines (39 loc) · 1.21 KB
/
attributes.php
File metadata and controls
53 lines (39 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include('misc.php');
include('r25.php');
#Get all custom attributes in all generally-assignable classrooms
$query = array(
'category_id' => implode(',', array(
'186', # Type - 110 - General Classroom (Central Assignment)
'384', # Campus - Seattle -- Upper Campus
)),
'scope' => 'extended',
'include' => 'attributes',
);
$spaces = r25_get('spaces', $query, 86400);
#dprint_r($spaces, true);
$attributes = array();
foreach ($spaces as $space) {
foreach ($space->custom_attribute as $attributeObj) {
$id = (int)$attributeObj->attribute_id;
if (isset($attributes[$id]))
continue;
$attributes[$id] = (array)$attributeObj;
}
}
#array_multisort(array_column($attributes, 'category'), SORT_ASC, SORT_NATURAL,
# array_column($attributes, 'display_name'), SORT_ASC, SORT_NATURAL,
# $attributes);
dprint_r($attributes, true);
echo json_encode($attributes);
if (! isset($_GET['debug']))
exit();
?>
<br clear="all" />
<hr />
<pre style="text-align: left; color: black; background-color: white">
<?= $debug_output ?>
</pre>
<form method="POST">
<input type="submit" name="update_cache" value="Reload Cached Entries" />
</form>