Commit f127f134 authored by Lisa Seeto's avatar Lisa Seeto Committed by Robert Lyon

Bug 1821859: Remove "Add to friends" text on new page header button

updated the pieform to conditionally display the button label
added title to the forms button element

behatnotneeded

Change-Id: I8ccbb92b64680b0d33a33ea27671bd2a21855a77
Signed-off-by: 's avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent 721662cd
......@@ -2361,7 +2361,8 @@ function acceptfriend_submit(Pieform $form, $values) {
}
// Form to add someone who has friendscontrol set to 'auto'
function addfriend_form($friendid) {
function addfriend_form($friendid, $displaymode='') {
$value = $displaymode == 'pageactions' ? '<span class="icon icon-user-plus icon-lg left" role="presentation"></span>' : '<span class="icon icon-user-plus icon-lg left" role="presentation"></span>' . get_string('addtofriendslist', 'group');
return pieform(array(
'name' => 'addfriend' . (int) $friendid,
'validatecallback' => 'addfriend_validate',
......@@ -2371,10 +2372,11 @@ function addfriend_form($friendid) {
'class' => 'form-as-button float-right',
'elements' => array(
'addfriend_submit' => array(
'elementtitle' => get_string('addtofriendslist', 'group'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn-secondary last',
'value' => '<span class="icon icon-user-plus icon-lg left" role="presentation"></span>' . get_string('addtofriendslist', 'group'),
'class' => 'btn-secondary last' . ($displaymode == 'pageactions' ? ' addaction' : ''),
'value' => $value,
),
'id' => array(
'type' => 'hidden',
......
......@@ -508,6 +508,10 @@ td.action-list-copy {
&.dropdown-toggle {
border-bottom-right-radius: 0;
}
&.addaction {
border-top-left-radius: 0;
margin-top: -1px;
}
}
}
......
......@@ -276,7 +276,7 @@ if (!empty($loggedinid) && $loggedinid != $userid) {
$relationship = 'none';
$friendscontrol = get_account_preference($userid, 'friendscontrol');
if ($friendscontrol == 'auto') {
$remoteusernewfriendform = addfriend_form($userid);
$remoteusernewfriendform = true;
}
$remoteuserfriendscontrol = $friendscontrol;
}
......@@ -328,7 +328,7 @@ if ($remoteuseracceptform) {
$smarty->assign('acceptform', acceptfriend_form($userid, 'modal'));
}
if ($remoteusernewfriendform) {
$smarty->assign('newfriendform', addfriend_form($userid));
$smarty->assign('newfriendform', addfriend_form($userid, 'pageactions'));
}
if ($remoteuserfriendscontrol) {
$smarty->assign('friendscontrol', $friendscontrol);
......
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