Passed
Push — 1.11.x ( 52d67a...d950c2 )
by Julito
10:42 queued 11s
created

get_group_user_data()   C

Complexity

Conditions 10
Paths 26

Size

Total Lines 95
Code Lines 63

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 10
eloc 63
nc 26
nop 4
dl 0
loc 95
rs 6.9406
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
/**
6
 * This script shows the group space for one specific group, possibly displaying
7
 * a list of users in the group, subscribe or unsubscribe option, tutors...
8
 *
9
 * @todo    Display error message if no group ID specified
10
 */
11
require_once __DIR__.'/../inc/global.inc.php';
12
$current_course_tool = TOOL_GROUP;
13
14
// Notice for unauthorized people.
15
api_protect_course_script(true, false, 'group');
16
17
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
18
19
$group_id = api_get_group_id();
20
$user_id = api_get_user_id();
21
$current_group = GroupManager::get_group_properties($group_id);
22
$group_id = $current_group['iid'];
23
if (empty($current_group)) {
24
    api_not_allowed(true);
25
}
26
27
$this_section = SECTION_COURSES;
28
$nameTools = get_lang('GroupSpace');
29
$interbreadcrumb[] = [
30
    'url' => 'group.php?'.api_get_cidreq(),
31
    'name' => get_lang('Groups'),
32
];
33
34
/*	Ensure all private groups // Juan Carlos Raña Trabado */
35
$forums_of_groups = get_forums_of_group($current_group);
36
if (!GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_session_id())) {
37
    api_not_allowed(true);
38
}
39
40
/*
41
 * User wants to register in this group
42
 */
43
if (!empty($_GET['selfReg']) &&
44
    GroupManager::is_self_registration_allowed($user_id, $current_group)
45
) {
46
    GroupManager::subscribe_users($user_id, $current_group);
47
    Display::addFlash(Display::return_message(get_lang('GroupNowMember')));
48
}
49
50
/*
51
 * User wants to unregister from this group
52
 */
53
if (!empty($_GET['selfUnReg']) &&
54
    GroupManager::is_self_unregistration_allowed($user_id, $current_group)
55
) {
56
    GroupManager::unsubscribe_users($user_id, $current_group);
57
    Display::addFlash(
58
        Display::return_message(get_lang('StudentDeletesHimself'), 'normal')
59
    );
60
}
61
62
Display::display_header(
63
    $nameTools.' '.Security::remove_XSS($current_group['name']),
64
    'Group'
65
);
66
67
Display::display_introduction_section(TOOL_GROUP);
68
69
echo '<div class="actions">';
70
echo '<a href="'.api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq().'">'.
71
    Display::return_icon(
72
        'back.png',
73
        get_lang('BackToGroupList'),
74
        '',
75
        ICON_SIZE_MEDIUM
76
    ).
77
    '</a>';
78
79
/*
80
 * Register to group
81
 */
82
$subscribe_group = '';
83
if (GroupManager::is_self_registration_allowed($user_id, $current_group)) {
84
    $subscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfReg=1&group_id='.$current_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;">'.
85
        get_lang('RegIntoGroup').'</a>';
86
}
87
88
/*
89
 * Unregister from group
90
 */
91
$unsubscribe_group = '';
92
if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group)) {
93
    $unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;">'.
94
        get_lang('StudentUnsubscribe').'</a>';
95
}
96
echo '&nbsp;</div>';
97
98
/*	Main Display Area */
99
100
$edit_url = '';
101
if (api_is_allowed_to_edit(false, true) ||
102
    GroupManager::is_tutor_of_group($user_id, $current_group)
103
) {
104
    $edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'">'.
105
        Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
106
}
107
108
echo Display::page_header(
109
    Security::remove_XSS($current_group['name']).' '.$edit_url.' '.$subscribe_group.' '.$unsubscribe_group
110
);
111
112
if (!empty($current_group['description'])) {
113
    echo '<p>'.Security::remove_XSS($current_group['description']).'</p>';
114
}
115
116
// If the user is subscribed to the group or the user is a tutor of the group then
117
if (api_is_allowed_to_edit(false, true) ||
118
    GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_session_id())
119
) {
120
    $actions_array = [];
121
    if (is_array($forums_of_groups)) {
122
        if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['forum_state']) {
123
            foreach ($forums_of_groups as $key => $value) {
124
                if ('public' === $value['forum_group_public_private'] ||
125
                    ('private' === $value['forum_group_public_private']) ||
126
                    !empty($user_is_tutor) ||
127
                    api_is_allowed_to_edit(false, true)
128
                ) {
129
                    $actions_array[] = [
130
                        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.$value['forum_id'].'&'.api_get_cidreq().'&origin=group',
131
                        'content' => Display::return_icon(
132
                            'forum.png',
133
                            get_lang('Forum').': '.$value['forum_title'],
134
                            [],
135
                            32
136
                        ),
137
                    ];
138
                }
139
            }
140
        }
141
    }
142
143
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['doc_state']) {
144
        // Link to the documents area of this group
145
        $actions_array[] = [
146
            'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(),
147
            'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], 32),
148
        ];
149
    }
150
151
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['calendar_state']) {
152
        $groupFilter = '';
153
        if (!empty($group_id)) {
154
            $groupFilter = "&type=course&user_id=GROUP:$group_id";
155
        }
156
        // Link to a group-specific part of agenda
157
        $actions_array[] = [
158
            'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
159
            'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32),
160
        ];
161
    }
162
163
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['work_state']) {
164
        // Link to the works area of this group
165
        $actions_array[] = [
166
            'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
167
            'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], 32),
168
        ];
169
    }
170
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['announcements_state']) {
171
        // Link to a group-specific part of announcements
172
        $actions_array[] = [
173
            'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
174
            'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], 32),
175
        ];
176
    }
177
178
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['wiki_state']) {
179
        // Link to the wiki area of this group
180
        $actions_array[] = [
181
            'url' => api_get_path(WEB_CODE_PATH).'wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'],
182
            'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32),
183
        ];
184
    }
185
186
    if (GroupManager::TOOL_NOT_AVAILABLE != $current_group['chat_state']) {
187
        // Link to the chat area of this group
188
        if (api_get_course_setting('allow_open_chat_window')) {
189
            $actions_array[] = [
190
                'url' => 'javascript: void(0);',
191
                'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
192
                'url_attributes' => [
193
                    'onclick' => " window.open('../chat/chat.php?".api_get_cidreq().'&toolgroup='.$current_group['id']."','window_chat_group_".api_get_course_id().'_'.api_get_group_id()."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')",
194
                ],
195
            ];
196
        } else {
197
            $actions_array[] = [
198
                'url' => api_get_path(WEB_CODE_PATH).'chat/chat.php?'.api_get_cidreq().'&toolgroup='.$current_group['id'],
199
                'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
200
            ];
201
        }
202
    }
203
204
    $enabled = api_get_plugin_setting('bbb', 'tool_enable');
205
    if ('true' === $enabled) {
206
        $bbb = new bbb();
207
        if ($bbb->hasGroupSupport()) {
208
            $actions_array[] = [
209
                'url' => api_get_path(WEB_PLUGIN_PATH).'bbb/start.php?'.api_get_cidreq(),
210
                'content' => Display::return_icon('bbb.png', get_lang('VideoConference'), [], 32),
211
            ];
212
        }
213
    }
214
215
    $enabled = api_get_plugin_setting('zoom', 'tool_enable');
216
    if ('true' === $enabled) {
217
        $actions_array[] = [
218
            'url' => api_get_path(WEB_PLUGIN_PATH).'zoom/start.php?'.api_get_cidreq(),
219
            'content' => Display::return_icon('bbb.png', get_lang('VideoConference'), [], 32),
220
        ];
221
    }
222
223
    if (!empty($actions_array)) {
224
        echo Display::actions($actions_array);
225
    }
226
} else {
227
    $actions_array = [];
228
    if (is_array($forums_of_groups)) {
229
        if (GroupManager::TOOL_PUBLIC == $current_group['forum_state']) {
230
            foreach ($forums_of_groups as $key => $value) {
231
                if ('public' === $value['forum_group_public_private']) {
232
                    $actions_array[] = [
233
                        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group',
234
                        'content' => Display::return_icon(
235
                            'forum.png',
236
                            get_lang('GroupForum'),
237
                            [],
238
                            ICON_SIZE_MEDIUM
239
                        ),
240
                    ];
241
                }
242
            }
243
        }
244
    }
245
246
    if (GroupManager::TOOL_PUBLIC == $current_group['doc_state']) {
247
        // Link to the documents area of this group
248
        $actions_array[] = [
249
            'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(),
250
            'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], ICON_SIZE_MEDIUM),
251
        ];
252
    }
253
254
    if (GroupManager::TOOL_PUBLIC == $current_group['calendar_state']) {
255
        $groupFilter = '';
256
        if (!empty($group_id)) {
257
            $groupFilter = "&type=course&user_id=GROUP:$group_id";
258
        }
259
        // Link to a group-specific part of agenda
260
        $actions_array[] = [
261
            'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
262
            'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32),
263
        ];
264
    }
265
266
    if (GroupManager::TOOL_PUBLIC == $current_group['work_state']) {
267
        // Link to the works area of this group
268
        $actions_array[] = [
269
            'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(),
270
            'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], ICON_SIZE_MEDIUM),
271
        ];
272
    }
273
274
    if (GroupManager::TOOL_PUBLIC == $current_group['announcements_state']) {
275
        // Link to a group-specific part of announcements
276
        $actions_array[] = [
277
            'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
278
            'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], ICON_SIZE_MEDIUM),
279
        ];
280
    }
281
282
    if (GroupManager::TOOL_PUBLIC == $current_group['wiki_state']) {
283
        // Link to the wiki area of this group
284
        $actions_array[] = [
285
            'url' => api_get_path(WEB_CODE_PATH).'wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'],
286
            'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32),
287
        ];
288
    }
289
290
    if (GroupManager::TOOL_PUBLIC == $current_group['chat_state']) {
291
        // Link to the chat area of this group
292
        if (api_get_course_setting('allow_open_chat_window')) {
293
            $actions_array[] = [
294
                'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq().'&toolgroup='.$current_group['id']."','window_chat_group_".api_get_course_id().'_'.api_get_group_id()."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
295
                'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
296
            ];
297
        } else {
298
            $actions_array[] = [
299
                'url' => api_get_path(WEB_CODE_PATH).'chat/chat.php?'.api_get_cidreq().'&toolgroup='.$current_group['id'],
300
                'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32),
301
            ];
302
        }
303
    }
304
305
    if (!empty($actions_array)) {
306
        echo Display::actions($actions_array);
307
    }
308
}
309
310
/*
311
 * List all the tutors of the current group
312
 */
313
$tutors = GroupManager::get_subscribed_tutors($current_group);
314
$tutor_info = '';
315
if (0 == count($tutors)) {
316
    $tutor_info = get_lang('GroupNoneMasc');
317
} else {
318
    $tutor_info .= '<ul class="thumbnails">';
319
    foreach ($tutors as $index => $tutor) {
320
        $userInfo = api_get_user_info($tutor['user_id']);
321
        $username = api_htmlentities(sprintf(get_lang('LoginX'), $userInfo['username']), ENT_QUOTES);
322
        $completeName = $userInfo['complete_name'];
323
        $photo = '<img src="'.$userInfo['avatar'].'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />';
324
        $tutor_info .= '<li>';
325
        $tutor_info .= $userInfo['complete_name_with_message_link'];
326
        $tutor_info .= '</li>';
327
    }
328
    $tutor_info .= '</ul>';
329
}
330
331
echo Display::page_subheader(get_lang('GroupTutors'));
332
if (!empty($tutor_info)) {
333
    echo $tutor_info;
334
}
335
echo '<br />';
336
337
/*
338
 * List all the members of the current group
339
 */
340
echo Display::page_subheader(get_lang('GroupMembers'));
341
342
$table = new SortableTable(
343
    'group_users',
344
    'get_number_of_group_users',
345
    'get_group_user_data',
346
    (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1
347
);
348
$origin = api_get_origin();
349
$my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
350
$my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
351
$parameters = ['cidReq' => $my_cidreq, 'origin' => $origin, 'gidReq' => $my_gidreq];
352
$table->set_additional_parameters($parameters);
353
$table->set_header(0, '');
354
355
if (api_is_western_name_order()) {
356
    $table->set_header(1, get_lang('FirstName'));
357
    $table->set_header(2, get_lang('LastName'));
358
} else {
359
    $table->set_header(1, get_lang('LastName'));
360
    $table->set_header(2, get_lang('FirstName'));
361
}
362
363
if ('true' == api_get_setting('show_email_addresses') || 'true' == api_is_allowed_to_edit()) {
364
    $table->set_header(3, get_lang('Email'));
365
    $table->set_column_filter(3, 'email_filter');
366
    $table->set_header(4, get_lang('Active'));
367
    $table->set_column_filter(4, 'activeFilter');
368
} else {
369
    $table->set_header(3, get_lang('Active'));
370
    $table->set_column_filter(3, 'activeFilter');
371
}
372
//the order of these calls is important
373
//$table->set_column_filter(1, 'user_name_filter');
374
//$table->set_column_filter(2, 'user_name_filter');
375
$table->set_column_filter(0, 'user_icon_filter');
376
$table->display();
377
378
/**
379
 * Get the number of subscribed users to the group.
380
 *
381
 * @return int
382
 *
383
 * @author Patrick Cool <[email protected]>, Ghent University, Belgium
384
 *
385
 * @version April 2008
386
 */
387
function get_number_of_group_users()
388
{
389
    $groupInfo = GroupManager::get_group_properties(api_get_group_id());
390
    $course_id = api_get_course_int_id();
391
392
    if (empty($groupInfo) || empty($course_id)) {
393
        return 0;
394
    }
395
396
    // Database table definition
397
    $table = Database::get_course_table(TABLE_GROUP_USER);
398
399
    // Query
400
    $sql = "SELECT count(iid) AS number_of_users
401
            FROM $table
402
            WHERE
403
                c_id = $course_id AND
404
                group_id = '".intval($groupInfo['iid'])."'";
405
    $result = Database::query($sql);
406
    $return = Database::fetch_array($result, 'ASSOC');
407
408
    return $return['number_of_users'];
409
}
410
411
/**
412
 * Get the details of the users in a group.
413
 *
414
 * @param int $from            starting row
415
 * @param int $number_of_items number of items to be displayed
416
 * @param int $column          sorting colum
417
 * @param int $direction       sorting direction
418
 *
419
 * @return array
420
 *
421
 * @author Patrick Cool <[email protected]>, Ghent University, Belgium
422
 *
423
 * @version April 2008
424
 */
425
function get_group_user_data($from, $number_of_items, $column, $direction)
426
{
427
    $direction = !in_array(strtolower(trim($direction)), ['asc', 'desc']) ? 'asc' : $direction;
428
    $groupInfo = GroupManager::get_group_properties(api_get_group_id());
429
    $course_id = api_get_course_int_id();
430
    $column = (int) $column;
431
432
    if (empty($groupInfo) || empty($course_id)) {
433
        return 0;
434
    }
435
436
    // Database table definition
437
    $table_group_user = Database::get_course_table(TABLE_GROUP_USER);
438
    $table_user = Database::get_main_table(TABLE_MAIN_USER);
439
    $tableGroup = Database::get_course_table(TABLE_GROUP);
440
441
    // Query
442
    if ('true' === api_get_setting('show_email_addresses')) {
443
        $sql = 'SELECT user.id 	AS col0,
444
				'.(
445
            api_is_western_name_order() ?
446
                'user.firstname 	AS col1,
447
				user.lastname 	AS col2,'
448
                :
449
                'user.lastname 	AS col1,
450
				user.firstname 	AS col2,'
451
            )."
452
				user.email		AS col3
453
				, user.active AS col4
454
				FROM $table_user user
455
				INNER JOIN $table_group_user group_rel_user
456
				ON (group_rel_user.user_id = user.id)
457
				INNER JOIN $tableGroup g
458
				ON (group_rel_user.group_id = g.iid)
459
				WHERE
460
				    group_rel_user.c_id = $course_id AND
461
				    g.iid = '".$groupInfo['iid']."'
462
                ORDER BY col$column $direction
463
                LIMIT $from, $number_of_items";
464
    } else {
465
        if (api_is_allowed_to_edit()) {
466
            $sql = 'SELECT DISTINCT
467
                        u.id AS col0,
468
                        '.(api_is_western_name_order() ?
469
                        'u.firstname 	AS col1,
470
                            u.lastname 	AS col2,'
471
                        :
472
                        'u.lastname 	AS col1,
473
                        u.firstname 	AS col2,')."
474
                        u.email		AS col3
475
                        , u.active AS col4
476
                    FROM $table_user u
477
                    INNER JOIN $table_group_user gu
478
                    ON (gu.user_id = u.id)
479
                    INNER JOIN $tableGroup g
480
				    ON (gu.group_id = g.iid)
481
                    WHERE
482
                        g.iid = '".$groupInfo['iid']."' AND
483
                        gu.c_id = $course_id
484
                    ORDER BY col$column $direction
485
                    LIMIT $from, $number_of_items";
486
        } else {
487
            $sql = 'SELECT DISTINCT
488
						user.id 	AS col0,
489
						'.(
490
                api_is_western_name_order() ?
491
                    'user.firstname 	AS col1,
492
						user.lastname 	AS col2 '
493
                    :
494
                    'user.lastname 	AS col1,
495
						user.firstname 	AS col2 '
496
                    )."
497
                    , user.active AS col3
498
                    FROM $table_user user
499
                    INNER JOIN $table_group_user group_rel_user
500
                    ON (group_rel_user.user_id = user.id)
501
                    INNER JOIN $tableGroup g
502
                    ON (group_rel_user.group_id = g.iid)
503
                    WHERE
504
                        g.iid = '".$groupInfo['iid']."' AND
505
                        group_rel_user.c_id = $course_id AND
506
                        group_rel_user.user_id = user.id AND
507
                        g.iid = '".$groupInfo['iid']."'
508
                    ORDER BY col$column $direction
509
                    LIMIT $from, $number_of_items";
510
        }
511
    }
512
513
    $return = [];
514
    $result = Database::query($sql);
515
    while ($row = Database::fetch_row($result)) {
516
        $return[] = $row;
517
    }
518
519
    return $return;
520
}
521
522
/**
523
 * Returns a mailto-link.
524
 *
525
 * @param string $email An email-address
526
 *
527
 * @return string HTML-code with a mailto-link
528
 */
529
function email_filter($email)
530
{
531
    return Display::encrypted_mailto_link($email, $email);
532
}
533
534
function activeFilter($isActive)
535
{
536
    if ($isActive) {
537
        return Display::return_icon('accept.png', get_lang('Active'), [], ICON_SIZE_TINY);
538
    }
539
540
    return Display::return_icon('error.png', get_lang('Inactive'), [], ICON_SIZE_TINY);
541
}
542
543
/**
544
 * Display a user icon that links to the user page.
545
 *
546
 * @param int $user_id the id of the user
547
 *
548
 * @return string code
549
 *
550
 * @author Patrick Cool <[email protected]>, Ghent University, Belgium
551
 *
552
 * @version April 2008
553
 */
554
function user_icon_filter($user_id)
555
{
556
    $userInfo = api_get_user_info($user_id);
557
    $photo = '<img src="'.$userInfo['avatar'].'" alt="'.$userInfo['complete_name'].'" width="22" height="22" title="'.$userInfo['complete_name'].'" />';
558
559
    return Display::url($photo, $userInfo['profile_url']);
560
}
561
562
/**
563
 * Return user profile link around the given user name.
564
 *
565
 * The parameters use a trick of the sorteable table, where the first param is
566
 * the original value of the column
567
 *
568
 * @param   string  User name (value of the column at the time of calling)
569
 * @param   string  URL parameters
570
 * @param   array   Row of the "sortable table" as it is at the time of function call - we extract the user ID from there
571
 *
572
 * @return string HTML link
573
 */
574
function user_name_filter($name, $url_params, $row)
575
{
576
    $userInfo = api_get_user_info($row[0]);
577
578
    return UserManager::getUserProfileLink($userInfo);
579
}
580
581
if ('learnpath' !== $origin) {
582
    Display::display_footer();
583
}
584