Commit af2f2b58 authored by Penny Leach's avatar Penny Leach
Browse files

fixing [#438] - columns should change on friends page when switching

between pending and normal
parent 5de7b75f
......@@ -40,6 +40,8 @@ $remove = get_string('removefromfriendslist');
$accept = get_string('accept');
$reject = get_string('reject');
$allviews = get_string('allviews');
$removeheader = get_string('remove');
$reasonheader = get_string('reason');
$friendcontrolfailed = get_string('friendlistfailure');
$enc_confirm_remove = json_encode(get_string('confirmremovefriend'));
......@@ -160,10 +162,23 @@ function expandViews(views, id) {
return false;
}
function pendingChange() {
$('messagediv').innerHTML='';
var pending = $('pendingopts').options[$('pendingopts').selectedIndex].value;
friendslist.doupdate({'pending': pending});
if (pending == 1) {
hideElement('viewsheader');
$('removeorreason').innerHTML = '{$reasonheader}';
}
else {
showElement('viewsheader');
$('removeorreason').innerHTML = '{$removeheader}';
}
}
EOF;
$smarty = smarty(array('tablerenderer'));
$smarty->assign('pendingchange', '$(\'messagediv\').innerHTML=\'\';friendslist.doupdate({\'pending\':this.options[this.selectedIndex].value});');
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->display('contacts/index.tpl');
......
......@@ -6,7 +6,7 @@
{include file="columnleftstart.tpl"}
<h2>{str tag="myfriends"}</h2>
<form>
<select name="pending" onChange="{$pendingchange}">
<select id="pendingopts" name="pending" onChange="pendingChange();">
<option value="0">{str tag='currentfriends'}</option>
<option value="1">{str tag='pendingfriends'}</option>
</select>
......@@ -17,8 +17,8 @@
<tr>
<th>{str tag="profileicon"}</th>
<th>{str tag="friend"}</th>
<th>{str tag="views"}</th>
<th>{str tag="remove"}</th>
<th id="viewsheader">{str tag="views"}</th>
<th id="removeorreason">{str tag="remove"}</th>
<tr>
</thead>
<tbody>
......
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