-
Notifications
You must be signed in to change notification settings - Fork 0
/
teacher.inc
80 lines (74 loc) · 2.4 KB
/
teacher.inc
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
// This file is part of Music Match.
// Copyright (C) 2022 David P. Anderson
//
// Music Match is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// Music Match is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Music Match. If not, see <http://www.gnu.org/licenses/>.
// --------------------------------------------------------------------
// Functions for teacher profiles
// show a profile as a list of name/value rows
//
function teacher_profile_summary_table($user, $profile) {
row2('Topics',
lists_to_string(
TOPIC_LIST,
$profile->topic, $profile->topic_custom
)
);
row2('Styles',
lists_to_string(
STYLE_LIST, $profile->style, $profile->style_custom
)
);
row2('Levels',
lists_to_string(LEVEL_LIST, $profile->level)
);
row2('Where',
lists_to_string(WHERE_LIST, $profile->where)
);
if ($profile->description) {
row2('Introduction', "<small>$profile->description</small>");
}
if ($profile->link) {
row2('Links',
links_to_string($profile->link)
);
}
}
// show profile as an N-column table row
//
function teacher_profile_summary_row($profile) {
$user = $profile->user;
row_array([
user_name_link($user, $profile),
lists_to_string(
TOPIC_LIST,
$profile->topic, $profile->topic_custom, "<br>"
),
lists_to_string(
STYLE_LIST, $profile->style, $profile->style_custom, "<br>"
),
lists_to_string(LEVEL_LIST, $profile->level, null, "<br>"),
lists_to_string(WHERE_LIST, $profile->where, null, "<br>"),
links_to_string($profile->link, "<br>"),
country_distance($user, $profile->dist, "<br>")
]);
}
// table header for the above
//
function teacher_profile_summary_header() {
row_heading_array(
["Name", "Instruments", "Styles", "Level", "Location", "Links", "Where"]
);
}
?>