X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontacts.php;h=017b1d6435fd8456953d3fadcc312312fdc0b6e7;hb=14dff6b0e0c5ff43df8b2cd8da440bdeaf2b3384;hp=ee62bf3c9e77cf6966101cbe6274c644786901d4;hpb=26983bafff024adab0339b828ec21d83fc5d1007;p=friendica.git diff --git a/mod/contacts.php b/mod/contacts.php index ee62bf3c9e..017b1d6435 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -27,6 +27,9 @@ function contacts_init(&$a) { require_once('include/group.php'); require_once('include/contact_widgets.php'); + if ($_GET['nets'] == "all") + $_GET['nets'] = ""; + if(! x($a->page,'aside')) $a->page['aside'] = ''; @@ -35,29 +38,30 @@ function contacts_init(&$a) { $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array( '$name' => htmlentities($a->data['contact']['name']), '$photo' => $a->data['contact']['photo'], - '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url'] + '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url'] )); + $finpeople_widget = ''; $follow_widget = ''; + $networks_widget = ''; } else { $vcard_widget = ''; + $networks_widget .= networks_widget('contacts',$_GET['nets']); if (isset($_GET['add'])) $follow_widget = follow_widget($_GET['add']); else $follow_widget = follow_widget(); - } - if ($_GET['nets'] == "all") - $_GET['nets'] = ""; + $findpeople_widget .= findpeople_widget(); + } $groups_widget .= group_side('contacts','group',false,0,$contact_id); - $findpeople_widget .= findpeople_widget(); - $networks_widget .= networks_widget('contacts',$_GET['nets']); + $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array( '$vcard_widget' => $vcard_widget, + '$findpeople_widget' => $findpeople_widget, '$follow_widget' => $follow_widget, '$groups_widget' => $groups_widget, - '$findpeople_widget' => $findpeople_widget, '$networks_widget' => $networks_widget )); @@ -550,6 +554,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block', 'sel' => '', 'title' => t('Toggle Blocked status'), + 'id' => 'toggle-block-tab', 'accesskey' => 'b', ), array( @@ -557,6 +562,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore', 'sel' => '', 'title' => t('Toggle Ignored status'), + 'id' => 'toggle-ignore-tab', 'accesskey' => 'i', ), @@ -565,6 +571,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/archive', 'sel' => '', 'title' => t('Toggle Archive status'), + 'id' => 'toggle-archive-tab', 'accesskey' => 'v', ), array( @@ -572,6 +579,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id, 'sel' => '', 'title' => t('Advanced Contact Settings'), + 'id' => 'repair-tab', 'accesskey' => 'r', ) ); @@ -590,6 +598,10 @@ function contacts_content(&$a) { if ($contact['network'] == NETWORK_DFRN) $profile_select = contact_profile_assign($contact['profile-id'],(($contact['network'] !== NETWORK_DFRN) ? true : false)); + if (in_array($contact['network'], array(NETWORK_DIASPORA, NETWORK_OSTATUS)) AND + ($contact['rel'] == CONTACT_IS_FOLLOWER)) + $follow = $a->get_baseurl(true)."/follow?url=".urlencode($contact["url"]); + $o .= replace_macros($tpl, array( '$header' => t('Contact Editor'), '$tab_str' => $tab_str, @@ -617,6 +629,8 @@ function contacts_content(&$a) { '$updpub' => t('Update public posts'), '$last_update' => $last_update, '$udnow' => t('Update now'), + '$follow' => $follow, + '$follow_text' => t("Connect/Follow"), '$profile_select' => $profile_select, '$contact_id' => $contact['id'], '$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ), @@ -687,6 +701,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/suggest', 'sel' => '', 'title' => t('Suggest potential friends'), + 'id' => 'suggestions-tab', 'accesskey' => 'g', ), array( @@ -694,6 +709,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/all', 'sel' => ($all) ? 'active' : '', 'title' => t('Show all contacts'), + 'id' => 'showall-tab', 'accesskey' => 'l', ), array( @@ -701,6 +717,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts', 'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored) && (! $archived)) ? 'active' : '', 'title' => t('Only show unblocked contacts'), + 'id' => 'showunblocked-tab', 'accesskey' => 'o', ), @@ -709,6 +726,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/blocked', 'sel' => ($blocked) ? 'active' : '', 'title' => t('Only show blocked contacts'), + 'id' => 'showblocked-tab', 'accesskey' => 'b', ), @@ -717,6 +735,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/ignored', 'sel' => ($ignored) ? 'active' : '', 'title' => t('Only show ignored contacts'), + 'id' => 'showignored-tab', 'accesskey' => 'i', ), @@ -725,6 +744,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/archived', 'sel' => ($archived) ? 'active' : '', 'title' => t('Only show archived contacts'), + 'id' => 'showarchived-tab', 'accesskey' => 'y', ), @@ -733,6 +753,7 @@ function contacts_content(&$a) { 'url' => $a->get_baseurl(true) . '/contacts/hidden', 'sel' => ($hidden) ? 'active' : '', 'title' => t('Only show hidden contacts'), + 'id' => 'showhidden-tab', 'accesskey' => 'h', ), @@ -793,6 +814,7 @@ function contacts_content(&$a) { '$cmd' => $a->cmd, '$contacts' => $contacts, '$contact_drop_confirm' => t('Do you really want to delete this contact?'), + 'multiselect' => 1, '$batch_actions' => array( 'contacts_batch_update' => t('Update'), 'contacts_batch_block' => t('Block')."/".t("Unblock"), @@ -845,7 +867,7 @@ function _contact_detail_for_template($rr){ 'name' => htmlentities($rr['name']), 'username' => htmlentities($rr['name']), 'sparkle' => $sparkle, - 'itemurl' => $rr['url'], + 'itemurl' => (($rr['addr'] != "") ? $rr['addr'] : $rr['url']), 'url' => $url, 'network' => network_to_name($rr['network'], $rr['url']), );