bug #278 show only blocked contacts

This commit is contained in:
friendica 2012-02-11 03:07:15 -08:00
parent 1d5f1723e0
commit da946bb9b0
2 changed files with 16 additions and 6 deletions

View file

@ -356,20 +356,29 @@ function contacts_content(&$a) {
} }
$blocked = false;
$_SESSION['return_url'] = $a->query_string; $_SESSION['return_url'] = $a->query_string;
if(($a->argc == 2) && ($a->argv[1] === 'all')) if(($a->argc == 2) && ($a->argv[1] === 'all'))
$sql_extra = ''; $sql_extra = '';
else else {
$sql_extra = " AND `blocked` = 0 "; if(($a->argc == 2) && ($a->argv[1] === 'blocked')) {
$sql_extra = " AND `blocked` = 1 ";
$blocked = true;
}
else
$sql_extra = " AND `blocked` = 0 ";
}
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : ''); $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
$tpl = get_markup_template("contacts-top.tpl"); $tpl = get_markup_template("contacts-top.tpl");
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => t('Contacts'), '$header' => t('Contacts'),
'$hide_url' => ((strlen($sql_extra)) ? 'contacts/all' : 'contacts' ), '$hide_url' => (($blocked) ? 'contacts' : 'contacts/blocked'),
'$hide_text' => ((strlen($sql_extra)) ? t('Show Blocked Connections') : t('Hide Blocked Connections')), '$hide_text' => (($blocked) ? t('Show Unblocked Contacts') : t('Show Blocked Contacts')),
'$all_url' => 'contacts/all',
'$all_text' => t('Show All Contacts'),
'$search' => $search, '$search' => $search,
'$desc' => t('Search your contacts'), '$desc' => t('Search your contacts'),
'$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""), '$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),

View file

@ -14,5 +14,6 @@ $finding
<div id="contacts-main" > <div id="contacts-main" >
<a href="$hide_url" id="contacts-show-hide-link">$hide_text</a> <a href="$hide_url" id="contacts-show-hide-link">$hide_text</a><br />
<a href="$all_url" id="contacts-show-all-link">$all_text</a><br />
</div> </div>