Commit 01d1384c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Display role names correctly in access section of my views

parent 032f08c9
......@@ -1394,6 +1394,7 @@ class View {
$data[$index[$access->view]]['accessgroups'][] = array(
'accesstype' => $access->accesstype, // friends, group, loggedin, public, tutorsgroup, user
'role' => $access->role,
'roledisplay' => $access->role ? get_string($access->role, 'grouptype.' . $access->grouptype) : null,
'id' => $access->id,
'name' => $access->name,
'startdate' => $access->startdate,
......@@ -1402,7 +1403,7 @@ class View {
}
}
}
log_debug($data);
return (object) array(
'data' => $data,
'count' => $count,
......
......@@ -60,8 +60,7 @@
{str tag="publiclower" section="view"}{elseif $accessgroup.accesstype == 'friends'}
<a href="{$WWWROOT}user/myfriends.php" id="link-myfriends">{str tag="friendslower" section="view"}</a>{elseif $accessgroup.accesstype == 'group'}
<a href="{$WWWROOT}group/view.php?id={$accessgroup.id}">{$accessgroup.name|escape}</a>{if !empty($accessgroup.role)}
{assign var="role" value=$accessgroup.role}{assign var="grouptype" value=$accessgroup.grouptype}
({str tag="$role" section="$grouptype"}){/if}{elseif $accessgroup.accesstype == 'user'}
({$accessgroup.roledisplay}){/if}{elseif $accessgroup.accesstype == 'user'}
<a href="{$WWWROOT}user/view.php?id={$accessgroup.id}">{$accessgroup.id|display_name|escape}</a>{/if}{if !$smarty.foreach.artefacts.last},{/if}
{/foreach}
{else}
......
Markdown is supported
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