contactedit-actions-button: remove contact tabs which aren't needed anymore

This commit is contained in:
rabuzarus 2016-02-08 23:51:51 +01:00
parent 2e04a00d30
commit c1c21ada0a
2 changed files with 15 additions and 36 deletions

View file

@ -37,10 +37,6 @@ General
* o: Profile * o: Profile
* t: Contacts * t: Contacts
* d: Common friends * d: Common friends
* b: Toggle Blocked status
* i: Toggle Ignored status
* v: Toggle Archive status
* r: Repair
/message /message
-------- --------

View file

@ -824,7 +824,17 @@ function contacts_content(&$a) {
} }
} }
if(! function_exists('contacts_tab')) { /**
* @brief List of pages for the Contact TabBar
*
* Available Pages are 'Status', 'Profile', 'Contacts' and 'Common Friends'
*
* @param app $a
* @param int $contact_id The ID of the contact
* @param int $active_tab 1 if tab should be marked as active
*
* @return array with with contact TabBar data
*/
function contacts_tab($a, $contact_id, $active_tab) { function contacts_tab($a, $contact_id, $active_tab) {
// tabs // tabs
$tabs = array( $tabs = array(
@ -846,6 +856,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
) )
); );
// Show this tab only if there is visible friend list
$x = count_all_friends(local_user(), $contact_id); $x = count_all_friends(local_user(), $contact_id);
if ($x) if ($x)
$tabs[] = array('label'=>t('Contacts'), $tabs[] = array('label'=>t('Contacts'),
@ -855,6 +866,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
'id' => 'allfriends-tab', 'id' => 'allfriends-tab',
'accesskey' => 't'); 'accesskey' => 't');
// Show this tab only if there is visible common friend list
$common = count_common_friends(local_user(),$contact_id); $common = count_common_friends(local_user(),$contact_id);
if ($common) if ($common)
$tabs[] = array('label'=>t('Common Friends'), $tabs[] = array('label'=>t('Common Friends'),
@ -864,41 +876,11 @@ function contacts_tab($a, $contact_id, $active_tab) {
'id' => 'common-loc-tab', 'id' => 'common-loc-tab',
'accesskey' => 'd'); 'accesskey' => 'd');
$tabs[] = array('label' => t('Repair'),
'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id,
'sel' => (($active_tab == 5)?'active':''),
'title' => t('Advanced Contact Settings'),
'id' => 'repair-tab',
'accesskey' => 'r');
$tabs[] = array('label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block',
'sel' => '',
'title' => t('Toggle Blocked status'),
'id' => 'toggle-block-tab',
'accesskey' => 'b');
$tabs[] = array('label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore',
'sel' => '',
'title' => t('Toggle Ignored status'),
'id' => 'toggle-ignore-tab',
'accesskey' => 'i');
$tabs[] = array('label' => (($contact['archive']) ? t('Unarchive') : t('Archive') ),
'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/archive',
'sel' => '',
'title' => t('Toggle Archive status'),
'id' => 'toggle-archive-tab',
'accesskey' => 'v');
$tab_tpl = get_markup_template('common_tabs.tpl'); $tab_tpl = get_markup_template('common_tabs.tpl');
$tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs)); $tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs));
return $tab_str; return $tab_str;
} }
}
if(! function_exists('contact_posts')) { if(! function_exists('contact_posts')) {
function contact_posts($a, $contact_id) { function contact_posts($a, $contact_id) {
@ -990,13 +972,14 @@ function _contact_detail_for_template($rr){
* This includes actions like e.g. 'block', 'hide', 'archive', 'delete' and others * This includes actions like e.g. 'block', 'hide', 'archive', 'delete' and others
* *
* @param array $contact Data about the Contact * @param array $contact Data about the Contact
* @return array with actions related actions * @return array with contact related actions
*/ */
function contact_actions($contact) { function contact_actions($contact) {
$poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2)); $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2));
$contact_action = array(); $contact_action = array();
// Provide friend suggestion only for Friendica contacts
if($contact['network'] === NETWORK_DFRN) { if($contact['network'] === NETWORK_DFRN) {
$contact_actions['suggest'] = array( $contact_actions['suggest'] = array(
'label' => t('Suggest friends'), 'label' => t('Suggest friends'),