Commit d8ff10a5 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Making the links in the stats page be more accessible (Bug #1323859)



Getting the links to be more descriptive to screen readers

Have also pluralised the strings based on the user with the most as
that is an integer. The average is a float number and also we can't
do pluralisation on stings where there are more than one number in the
string.

Change-Id: I89340a31c234185450f7e4e665398c9633674e9c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 393e1608
......@@ -266,14 +266,23 @@ $string['runningnormally'] = 'Running normally';
$string['cronnotrunning1'] = '<span class="error">Cron is not running.</span><br>See the <a href="http://wiki.mahara.org/System_Administrator\'s_Guide/Installing_Mahara">installation guide</a> for instructions on how to set it up. If you have already set up cron, one or more of its activities have failed to run recently.';
$string['Loggedin'] = 'Logged in';
$string['youraverageuser'] = 'Your average user...';
$string['statsmaxfriends'] = 'Has %s friends (most is <a href="%s">%s</a> with %d)';
$string['statsmaxfriends1'] = array(
0 => 'Has %2$s friends<br>(<a href="%3$s">%4$s has the most, with %1$d friend</a>)',
1 => 'Has %2$s friends<br>(<a href="%3$s">%4$s has the most, with %1$d friends</a>)',
);
$string['statsnofriends'] = 'Has 0 friends';
$string['statsmaxviews'] = 'Has made %s pages (most is <a href="%s">%s</a> with %d)';
$string['statsmaxviews1'] = array(
0 => 'Has made %2$s pages<br>(<a href="%3$s">%4$s has the most, with %1$d page</a>)',
1 => 'Has made %2$s pages<br>(<a href="%3$s">%4$s has the most, with %1$d pages</a>)',
);
$string['statsnoviews'] = 'Has made 0 pages';
$string['statsmaxgroups'] = 'Is in %s groups (most is <a href="%s">%s</a> with %d)';
$string['statsmaxgroups1'] = array(
0 => 'Is in %2$s groups<br>(<a href="%3$s">%4$s is in the most, with membership to %1$d group</a>)',
1 => 'Is in %2$s groups<br>(<a href="%3$s">%4$s is in the most, with membership to %1$d groups</a>)',
);
$string['statsnogroups'] = 'Is in 0 groups';
$string['statsnoquota'] = 'Is using no storage';
$string['statsmaxquotaused'] = 'Has used about %s of disk quota (most is <a href="%s">%s</a> with %s)';
$string['statsmaxquotaused1'] = 'Has used about %s of disk quota<br>(<a href="%s">%s has used the most, with %s of disk quota</a>)';
$string['groupcountsbytype'] = 'Number of groups by group type';
$string['groupcountsbyjointype'] = 'Number of groups by access type';
$string['blockcountsbytype'] = 'Most frequently used blocks in portfolio pages';
......@@ -283,6 +292,9 @@ $string['viewsbytype'] = 'Pages by type';
$string['userstatstabletitle'] = 'Daily user statistics';
$string['groupstatstabletitle'] = 'Biggest groups';
$string['viewstatstabletitle'] = 'Most popular pages';
$string['visitedtimesrank'] = 'visited %s times, ranked number %s';
$string['pageownedby'] = 'Owned by';
$string['contentstats'] = 'modified %s times for the current week and %s times in total';
$string['exportstatsascsv'] = 'Export statistics in CSV format';
$string['downloadstatsascsv'] = 'statistics in CSV format';
$string['nostats'] = 'No statistics available';
......
......@@ -513,12 +513,12 @@ function user_statistics($limit, $offset, &$sitedata) {
$meanfriends = 2 * count_records('usr_friend') / $sitedata['users'];
if ($maxfriends) {
$data['strmaxfriends'] = get_string(
'statsmaxfriends',
'statsmaxfriends1',
'admin',
$maxfriends->friends,
round($meanfriends, 1),
profile_url($maxfriends),
hsc(display_name($maxfriends, null, true)),
$maxfriends->friends
hsc(display_name($maxfriends, null, true))
);
}
else {
......@@ -534,12 +534,12 @@ function user_statistics($limit, $offset, &$sitedata) {
$maxviews = $maxviews[0];
if ($maxviews) {
$data['strmaxviews'] = get_string(
'statsmaxviews',
'statsmaxviews1',
'admin',
$maxviews->views,
$sitedata['viewsperuser'],
profile_url($maxviews),
hsc(display_name($maxviews, null, true)),
$maxviews->views
hsc(display_name($maxviews, null, true))
);
}
else {
......@@ -555,12 +555,12 @@ function user_statistics($limit, $offset, &$sitedata) {
$maxgroups = $maxgroups[0];
if ($maxgroups) {
$data['strmaxgroups'] = get_string(
'statsmaxgroups',
'statsmaxgroups1',
'admin',
$maxgroups->groups,
$sitedata['groupmemberaverage'],
profile_url($maxgroups),
hsc(display_name($maxgroups, null, true)),
$maxgroups->groups
hsc(display_name($maxgroups, null, true))
);
}
else {
......@@ -574,7 +574,7 @@ function user_statistics($limit, $offset, &$sitedata) {
LIMIT 1", array());
$maxquotaused = $maxquotaused[0];
$data['strmaxquotaused'] = get_string(
'statsmaxquotaused',
'statsmaxquotaused1',
'admin',
display_size(get_field('usr', 'AVG(quotaused)', 'deleted', 0)),
profile_url($maxquotaused),
......@@ -736,7 +736,7 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
) tmp', array_merge($institutiondata['members'], $institutiondata['members'])) / $institutiondata['users'];
if ($maxfriends) {
$data['strmaxfriends'] = get_string(
'statsmaxfriends',
'statsmaxfriends1',
'admin',
round($meanfriends, 1),
profile_url($maxfriends),
......@@ -757,7 +757,7 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
$maxviews = $maxviews[0];
if ($maxviews) {
$data['strmaxviews'] = get_string(
'statsmaxviews',
'statsmaxviews1',
'admin',
$institutiondata['viewsperuser'],
profile_url($maxviews),
......@@ -778,7 +778,7 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
$maxgroups = $maxgroups[0];
if ($maxgroups) {
$data['strmaxgroups'] = get_string(
'statsmaxgroups',
'statsmaxgroups1',
'admin',
$institutiondata['groupmemberaverage'],
profile_url($maxgroups),
......@@ -802,7 +802,7 @@ function institution_user_statistics($limit, $offset, &$institutiondata) {
WHERE id IN (" . join(',', array_fill(0, $institutiondata['users'], '?')) . ")
", $institutiondata['members']);
$data['strmaxquotaused'] = get_string(
'statsmaxquotaused',
'statsmaxquotaused1',
'admin',
display_size($avgquota),
profile_url($maxquotaused),
......
{foreach from=$data item=item key=key}
<tr class="{cycle values='r0,r1'}">
<td>{$offset + $dwoo.foreach.default.iteration}</td>
<td><a href="statistics.php?{if $institution}institution={$institution}&{/if}type=historical&field={$item->field}">{str tag=$item->field section=statistics}</a></td>
<td><a href="statistics.php?{if $institution}institution={$institution}&{/if}type=historical&field={$item->field}">{str tag=$item->field section=statistics} <span class="accessible-hidden">{str tag=contentstats section=admin arg1=$item->modified arg2=$item->value}</span></a></td>
<td>{$item->modified}</td>
<td class="center">{$item->value}</td>
</tr>
......
{foreach from=$data item=item key=key}
<tr class="{cycle values='r0,r1'}">
<td>{$offset + $dwoo.foreach.default.iteration}</td>
<td><a href="{$item->fullurl}">{$item->title}</a></td>
<td>{if $item->ownerurl}<a href="{$item->ownerurl}">{/if}{$item->ownername}{if $item->ownerurl}</a>{/if}</td>
<td><a href="{$item->fullurl}">{$item->title} <span class="accessible-hidden">{str tag=visitedtimesrank section=admin arg1=$item->visits arg2=$offset + $dwoo.foreach.default.iteration}</span></a></td>
<td>{if $item->ownerurl}<a href="{$item->ownerurl}"><span class="accessible-hidden">{str tag=pageownedby section=admin} </span>{/if}{$item->ownername}{if $item->ownerurl}</a>{/if}</td>
<td class="right">{$item->visits}</td>
<td class="center">{$item->comments}</td>
</tr>
......
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