Commit 10401ccc authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean profile and group urls in the artefactchooser



Bug #1006634, part 3

This is used when configuring a textbox block, and the user has access
to 'note' artefacts with a different owner.  For example, when adding
a group or institution note into a personal view.

Change-Id: I80259c769d71982f75c620b0954aa4227042cb62
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent a8225b72
......@@ -1642,8 +1642,8 @@ function artefact_get_owner_info($ids) {
$data = get_records_sql_assoc('
SELECT
a.id AS aid, a.owner, a.group, a.institution,
u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email,
g.name AS groupname,
u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.urlid,
g.name AS groupname, g.urlid as groupurlid,
i.displayname
FROM
{artefact} a
......@@ -1658,21 +1658,21 @@ function artefact_get_owner_info($ids) {
foreach ($data as &$d) {
if ($d->institution == 'mahara') {
$name = get_config('sitename');
$url = '';
$url = $wwwroot;
}
else if ($d->institution) {
$name = $d->displayname;;
$url = 'institution/index.php?institution=' . $d->institution;
$url = $wwwroot . 'institution/index.php?institution=' . $d->institution;
}
else if ($d->group) {
$name = $d->groupname;;
$url = 'group/view.php?id=' . $d->group;
$url = group_homepage_url((object) array('id' => $d->group, 'urlid' => $d->groupurlid));
}
else {
$name = display_name($d);
$url = 'user/view.php?id=' . $d->id;
$url = profile_url($d);
}
$d = (object) array('name' => $name, 'url' => $wwwroot . $url);
$d = (object) array('name' => $name, 'url' => $url);
}
return $data;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment