Commit fb012377 authored by Jono Mingard's avatar Jono Mingard Committed by Jono Mingard
Browse files

Added consistent alt text to profile pictures (Bug #1259378)



All places where the profile picture is used should now have the new
profileimagetext string as the alt attribute, except where the
profile picture links to the "Edit profile picture" section

Change-Id: Ic0105ffb6612077954ee7bfe78aedd071b9c8a66
Signed-off-by: default avatarJono Mingard <reason.koan@gmail.com>
Signed-off-by: default avatarJono Mingard <jonom@catalyst.net.nz>
parent ed81b8ac
......@@ -6,7 +6,7 @@
<div class="{cycle name=rows values='r0,r1'}{if $item->highlight} highlight{/if}{if $item->makepublicform} private{/if}">
<div class="commentleft">
<a href="{$item->author->profileurl}">
<img src="{profile_icon_url user=$item->author maxheight=40 maxwidth=40}" valign="middle" alt="{$item->author|display_name}">
<img src="{profile_icon_url user=$item->author maxheight=40 maxwidth=40}" valign="middle" alt="{str tag=profileimagetext arg1=$item->author|display_default_name}">
</a>
</div>
<div class="commentrightwrap">
......
......@@ -84,10 +84,10 @@ var table = new TableRenderer(
[
function(rowdata) {
if (rowdata.id) {
return TD({'class': 'profileiconcell'}, null, IMG({'src': '{$wwwroot}thumb.php?type=profileiconbyid&maxsize=100&id=' + rowdata.id, 'alt': rowdata.note}));
return TD({'class': 'profileiconcell'}, null, IMG({'src': '{$wwwroot}thumb.php?type=profileiconbyid&maxsize=100&id=' + rowdata.id, 'alt': rowdata.title ? rowdata.title : rowdata.note}));
}
else {
return TD({'class': 'profileiconcell'}, null, IMG({'src': '{$ravatar}', 'alt': rowdata.note}));
return TD({'class': 'profileiconcell'}, null, IMG({'src': '{$ravatar}', 'alt': rowdata.title ? rowdata.title : rowdata.note}));
}
},
function(rowdata) {
......
......@@ -37,9 +37,10 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
$configdata['artefactids'][] = $configdata['email'];
}
$viewowner = get_field('view', 'owner', 'id', $instance->get('view'));
// Get data about the profile fields in this blockinstance
if (!empty($configdata['artefactids'])) {
$viewowner = get_field('view', 'owner', 'id', $instance->get('view'));
foreach ($configdata['artefactids'] as $id) {
try {
$artefact = artefact_instance_from_id($id);
......@@ -62,6 +63,7 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
$downloadpath = get_config('wwwroot') . 'thumb.php?type=profileiconbyid&id=' . $configdata['profileicon'];
$downloadpath .= '&maxwidth=80';
$smarty->assign('profileiconpath', $downloadpath);
$smarty->assign('profileiconalt', get_string('profileimagetext', 'mahara', display_default_name(get_user($viewowner))));
}
// Override the introduction text if the user has any for this
......
{if $profileiconpath}<div class="fr"><img src="{$profileiconpath}" alt=""></div>{/if}
{if $profileiconpath}<div class="fr"><img src="{$profileiconpath}" alt="{$profileiconalt}"></div>{/if}
<p>{$profileinfo.introduction|clean_html|safe}</p>
{if $profileinfo && (count($profileinfo) != 1 || !$profileinfo.introduction)}<ul>
{foreach from=$profileinfo key=key item=item}
......
......@@ -188,7 +188,8 @@ function get_desired_fields(&$allfields, $desiredfields, $section) {
global $USER;
if ($section == 'about') {
$r = get_record_select('view', 'type = ? AND owner = ?', array('profile', $USER->id), 'id');
$label = '<div id="profileicon"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php"><img src="' . profile_icon_url($USER, 100, 100) . '" alt=""></a></div>';
$label = '<div id="profileicon"><a href="' . get_config('wwwroot') . 'artefact/file/profileicons.php"><img src="'
. profile_icon_url($USER, 100, 100) . '" alt="' . get_string("editprofileicon", "artefact.file") . '"></a></div>';
$descr = get_string('aboutprofilelinkdescription', 'artefact.internal', get_config('wwwroot') . 'view/blocks.php?id=' . $r->id);
$descr .= get_string('aboutdescription', 'artefact.internal');
}
......
{foreach from=$groupmembers item=groupmember}
<div class="{cycle values='d0,d1'} friendcell center">
<a href="{profile_url($groupmember)}">
<img src="{profile_icon_url user=$groupmember maxwidth=60 maxheight=60}" alt="" title="{$groupmember|display_default_name|escape}">
<img src="{profile_icon_url user=$groupmember maxwidth=60 maxheight=60}" alt="{str tag=profileimagetext arg1=$groupmember|display_default_name}" title="{$groupmember|display_default_name|escape}">
</a>
<div class="membername"><a href="{profile_url($groupmember)}">{$groupmember|display_default_name|escape}</a></div>
</div>
......
......@@ -2,7 +2,7 @@
{foreach from=$row item=friend}
<div class="{cycle values='d0,d1'} center friendcell">
<a href="{profile_url($friend)}">
<img src="{profile_icon_url user=$friend maxwidth=60 maxheight=60}" alt="">
<img src="{profile_icon_url user=$friend maxwidth=60 maxheight=60}" alt="{str tag=profileimagetext arg1=$friend|display_default_name}">
</a>
<div class="membername"><a href="{profile_url($friend)}">{$friend|display_default_name|escape}</a></div>
</div>
......
......@@ -5,7 +5,7 @@
<tr class="{cycle values='r0,r1'}">
<td><h3 class="title"><a href="{$WWWROOT}interaction/forum/topic.php?id={$postinfo->topic}&post={$postinfo->id}">{$postinfo->topicname}</a></h3>
<div class="detail">{$postinfo->body|str_shorten_html:100:true|safe}</div></td>
<td class="poster valign right"><a href="{profile_url($postinfo->author)}"><img src="{profile_icon_url user=$postinfo->author maxheight=20 maxwidth=20}" alt=""><br />{$postinfo->author|display_name}</a></td>
<td class="poster valign right"><a href="{profile_url($postinfo->author)}"><img src="{profile_icon_url user=$postinfo->author maxheight=20 maxwidth=20}" alt="{str tag=profileimagetext arg1=$postinfo->author|display_default_name}"><br />{$postinfo->author|display_name}</a></td>
</tr>
{/foreach}
</table>
......
......@@ -8,7 +8,7 @@
{if $wallpost->deletable}
<div class="wallpostdeletebutton"><a href="{$WWWROOT}blocktype/wall/deletepost.php?postid={$wallpost->postid}&return={if $wholewall}wall{else}profile{/if}" class="btn-big-del">{str tag='delete' section='blocktype.wall'}</a></div>
{/if}
<div class="userinfo"><img src="{profile_icon_url user=$wallpost maxheight=25 maxwidth=25}" alt="Profile Picture"><a href="{$wallpost->profileurl}">{$wallpost->displayname}</a> - <span class="postedon">{$wallpost->postdate|format_date}</span></div>
<div class="userinfo"><img src="{profile_icon_url user=$wallpost maxheight=25 maxwidth=25}" alt="{str tag=profileimagetext arg1=$wallpost|display_default_name}"><a href="{$wallpost->profileurl}">{$wallpost->displayname}</a> - <span class="postedon">{$wallpost->postdate|format_date}</span></div>
<div class="detail">{$wallpost->text|parse_bbcode|safe}</div>
<div class="controls">
{* {if $ownwall}
......
......@@ -46,7 +46,7 @@
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
{foreach from=$groupadmins item=groupadmin}
<span class="inlinelist">
<a href="{profile_url($groupadmin)}" class="groupadmin"><img src="{profile_icon_url user=$groupadmin maxheight=20 maxwidth=20}" alt=""> {$groupadmin|display_name}</a>
<a href="{profile_url($groupadmin)}" class="groupadmin"><img src="{profile_icon_url user=$groupadmin maxheight=20 maxwidth=20}" alt="{str tag=profileimagetext arg1=$groupadmin|display_default_name}"> {$groupadmin|display_name}</a>
</span>
{/foreach}
</div>
......
......@@ -5,7 +5,7 @@
<tr>
<td class="forumpostleft">
<div class="author">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=40&amp;id={$post->poster}" alt="" class="center">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=40&amp;id={$post->poster}" alt="{str tag=profileimagetext arg1=$post->poster|display_default_name}" class="center">
<div class="poster"><a href="{profile_url($post->poster)}"{if in_array($post->poster, $groupadmins)} class="groupadmin"{elseif $post->moderator} class="moderator"{/if}>{$post->poster|display_name}</a></div>
{if $post->postcount}<div class="postcount">{$post->postcount}</div>{/if}
</div>
......
......@@ -70,7 +70,7 @@
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
{foreach from=$groupadmins item=groupadmin}
<span class="s inlinelist">
<a href="{profile_url($groupadmin)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt=""></a>
<a href="{profile_url($groupadmin)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt="{str tag=profileimagetext arg1=$groupadmin|display_default_name}"></a>
<a href="{profile_url($groupadmin)}" class="groupadmin">{$groupadmin|display_name}</a>
</span>
{/foreach}
......
......@@ -8,7 +8,7 @@
</div>
{else}
<div class="peoplelistinfo">
<div class="leftdiv profile" id="{$type}_{$user->id}"><img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt=""></div>
<div class="leftdiv profile" id="{$type}_{$user->id}"><img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="{str tag=profileimagetext arg1=$user|display_default_name}"></div>
<div class="rightdiv">
<h3 class="title"><a href="{profile_url($user)}">{$user->display_name}</a></h3>
{if $user->introduction}
......
......@@ -34,7 +34,7 @@
</div>
<div id="useraccountsettingsleft">
<div id="profilepict">
<a href="{profile_url($user)}"><img src="{profile_icon_url user=$user maxheight=100 maxwidth=100}" alt=""></a>
<a href="{profile_url($user)}"><img src="{profile_icon_url user=$user maxheight=100 maxwidth=100}" alt="{str tag=profileimagetext arg1=$user|display_default_name}"></a>
<div id="profilename"><a href="{profile_url($user)}">{$user|display_name}</a></div>
{if $loginas}
<div id="loginas"><a class="btn" href="{$WWWROOT}admin/users/changeuser.php?id={$user->id}">{str tag=loginas section=admin}</a></div>
......
......@@ -14,7 +14,7 @@
<tbody>
{foreach from=$users item='user' key='userid'}
<tr class="{cycle values="r0,r1"}">
<td class='center'><img src="{profile_icon_url user=$user.user maxheight=40 maxwidth=40}" alt="profile picture"/></td>
<td class='center'><img src="{profile_icon_url user=$user.user maxheight=40 maxwidth=40}" alt="{str tag=profileimagetext arg1=$user.user|display_default_name}"/></td>
<td>{$user.user|display_name}</td>
<td>
{foreach from=$user.user->institutions item=i}
......
<ul>
<li>{$group->settingsdescription}</li>
<li><label class="groupinfolabel">{str tag=groupadmins section=group}:</label> {foreach name=admins from=$group->admins item=user}
<img src="{profile_icon_url user=$user maxwidth=20 maxheight=20}" alt="">
<img src="{profile_icon_url user=$user maxwidth=20 maxheight=20}" alt="{str tag=profileimagetext arg1=$user|display_default_name}">
<a href="{profile_url($user)}">{$user|display_name}</a>{if !$.foreach.admins.last}, {/if}
{/foreach}</li>
{if $group->categorytitle}<li><label>{str tag=groupcategory section=group}:</label> {$group->categorytitle}</li>{/if}
......
......@@ -2,7 +2,7 @@
{foreach from=$results.cdata item=row}
{foreach from=$row item=r}
<div class="{cycle values='r0,r1'} listrow">
<div class="fl membericon"><img src="{profile_icon_url user=$r maxwidth=40 maxheight=40}" alt=""></div>
<div class="fl membericon"><img src="{profile_icon_url user=$r maxwidth=40 maxheight=40}" alt="{str tag=profileimagetext arg1=$r|display_default_name}"></div>
<div class="memberdetail">
<h3 class="title"><a href="{profile_url($r)}">{$r.name}</a>{if $r.role}<span class="grouprole"> - {$results.roles[$r.role]->display}
{if $caneditroles && $r.canchangerole} (<a href="{$WWWROOT}group/changerole.php?group={$group}&amp;user={$r.id}">{str tag=changerole section=group}</a>){/if}</span>{/if}</h3>
......
......@@ -12,7 +12,7 @@
{/if}
<div class="peoplelistinfo">
<div class="leftdiv" id="staffinfo_{$user->id}">
<img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="">
<img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="{str tag=profileimagetext arg1=$user|display_default_name}">
</div>
<div class="rightdiv">
<h3 class="title">
......
<div class="sidebar-header">
<div id="user-profileicon">
<a href="{$sbdata.profileiconurl}" title="{str tag="editprofileicon" section="artefact.file"}"><img src="{profile_icon_url user=$sbdata.id maxheight=50 maxwidth=50}" alt=""></a>
<a href="{$sbdata.profileiconurl}" title="{str tag="editprofileicon" section="artefact.file"}"><img src="{profile_icon_url user=$sbdata.id maxheight=50 maxwidth=50}" alt="{str tag="editprofileicon" section="artefact.file"}"></a>
</div>
<h3><a href="{$sbdata.url}">{$sbdata.myname}</a></h3>
</div>
......
......@@ -3,7 +3,7 @@
<div class="{cycle values='r0,r1'} listrow">
<div class="peoplelistinfo">
<div class="leftdiv" id="onlineinfo_{$user->id}">
<img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="">
<img src="{profile_icon_url user=$user maxwidth=40 maxheight=40}" alt="{str tag=profileimagetext arg1=$user|display_default_name}">
</div>
<div class="rightdiv">
......
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