3 require_once('include/Contact.php');
4 require_once('include/socgraph.php');
5 require_once('include/contact_selectors.php');
6 require_once('include/Scrape.php');
7 require_once('mod/proxy.php');
8 require_once('include/Photo.php');
10 function contacts_init(&$a) {
16 if(($a->argc == 2) && intval($a->argv[1])) {
17 $contact_id = intval($a->argv[1]);
18 $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1",
27 require_once('include/group.php');
28 require_once('include/contact_widgets.php');
30 if(! x($a->page,'aside'))
31 $a->page['aside'] = '';
34 $a->data['contact'] = $r[0];
35 $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
36 '$name' => $a->data['contact']['name'],
37 '$photo' => $a->data['contact']['photo'],
38 '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? $a->get_baseurl()."/redir/".$a->data['contact']['id'] : $a->data['contact']['url']
44 if (isset($_GET['add']))
45 $follow_widget = follow_widget($_GET['add']);
47 $follow_widget = follow_widget();
50 if ($_GET['nets'] == "all")
53 $groups_widget .= group_side('contacts','group',false,0,$contact_id);
54 $findpeople_widget .= findpeople_widget();
55 $networks_widget .= networks_widget('contacts',$_GET['nets']);
56 $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"),array(
57 '$vcard_widget' => $vcard_widget,
58 '$follow_widget' => $follow_widget,
59 '$groups_widget' => $groups_widget,
60 '$findpeople_widget' => $findpeople_widget,
61 '$networks_widget' => $networks_widget
64 $base = $a->get_baseurl();
65 $tpl = get_markup_template("contacts-head.tpl");
66 $a->page['htmlhead'] .= replace_macros($tpl,array(
67 '$baseurl' => $a->get_baseurl(true),
71 $tpl = get_markup_template("contacts-end.tpl");
72 $a->page['end'] .= replace_macros($tpl,array(
73 '$baseurl' => $a->get_baseurl(true),
80 function contacts_batch_actions(&$a){
81 $contacts_id = $_POST['contact_batch'];
82 if (!is_array($contacts_id)) return;
84 $orig_records = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND `uid` = %d AND `self` = 0",
85 implode(",", $contacts_id),
90 foreach($orig_records as $orig_record) {
91 $contact_id = $orig_record['id'];
92 if (x($_POST, 'contacts_batch_update')) {
93 _contact_update($contact_id);
96 if (x($_POST, 'contacts_batch_block')) {
97 $r = _contact_block($contact_id, $orig_record);
98 if ($r) $count_actions++;
100 if (x($_POST, 'contacts_batch_ignore')) {
101 $r = _contact_ignore($contact_id, $orig_record);
102 if ($r) $count_actions++;
104 if (x($_POST, 'contacts_batch_archive')) {
105 $r = _contact_archive($contact_id, $orig_record);
106 if ($r) $count_actions++;
108 if (x($_POST, 'contacts_batch_drop')) {
109 _contact_drop($contact_id, $orig_record);
113 if ($count_actions>0) {
114 info ( sprintf( tt("%d contact edited.", "%d contacts edited", $count_actions), $count_actions) );
117 if(x($_SESSION,'return_url'))
118 goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
120 goaway($a->get_baseurl(true) . '/contacts');
125 function contacts_post(&$a) {
130 if ($a->argv[1]==="batch") {
131 contacts_batch_actions($a);
135 $contact_id = intval($a->argv[1]);
139 $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
144 if(! count($orig_record)) {
145 notice( t('Could not access contact record.') . EOL);
146 goaway($a->get_baseurl(true) . '/contacts');
147 return; // NOTREACHED
150 call_hooks('contact_edit_post', $_POST);
152 $profile_id = intval($_POST['profile-assign']);
154 $r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
159 notice( t('Could not locate selected profile.') . EOL);
164 $hidden = intval($_POST['hidden']);
166 $notify = intval($_POST['notify']);
168 $fetch_further_information = intval($_POST['fetch_further_information']);
170 $ffi_keyword_blacklist = fix_mce_lf(escape_tags(trim($_POST['ffi_keyword_blacklist'])));
172 $priority = intval($_POST['poll']);
173 if($priority > 5 || $priority < 0)
176 $info = fix_mce_lf(escape_tags(trim($_POST['info'])));
178 $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s',
179 `hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d,
180 `ffi_keyword_blacklist` = '%s' WHERE `id` = %d AND `uid` = %d",
186 intval($fetch_further_information),
187 dbesc($ffi_keyword_blacklist),
192 info( t('Contact updated.') . EOL);
194 notice( t('Failed to update contact record.') . EOL);
196 $r = q("select * from contact where id = %d and uid = %d limit 1",
201 $a->data['contact'] = $r[0];
208 function _contact_update($contact_id) {
209 $r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
215 if ($uid != local_user())
218 if ($r[0]["network"] == NETWORK_OSTATUS) {
219 $result = new_contact($uid, $r[0]["url"], false);
221 if ($result['success'])
222 $r = q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d",
223 intval($contact_id));
225 // pull feed and consume it, which should subscribe to the hub.
226 proc_run('php',"include/onepoll.php","$contact_id", "force");
229 function _contact_update_profile($contact_id) {
230 $r = q("SELECT `uid`, `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
236 if ($uid != local_user())
239 $data = probe_url($r[0]["url"]);
241 // "Feed" is mostly a sign of communication problems
242 if (($data["network"] == NETWORK_FEED) AND ($data["network"] != $r[0]["network"]))
245 $updatefields = array("name", "nick", "url", "addr", "batch", "notify", "poll", "request", "confirm",
246 "poco", "network", "alias", "pubkey");
249 if ($data["network"] == NETWORK_OSTATUS) {
250 $result = new_contact($uid, $data["url"], false);
252 if ($result['success'])
253 $update["subhub"] = true;
256 foreach($updatefields AS $field)
257 if (isset($data[$field]) AND ($data[$field] != ""))
258 $update[$field] = $data[$field];
260 $update["nurl"] = normalise_link($data["url"]);
264 if (isset($data["priority"]) AND ($data["priority"] != 0))
265 $query = "`priority` = ".intval($data["priority"]);
267 foreach($update AS $key => $value) {
271 $query .= "`".$key."` = '".dbesc($value)."'";
277 $r = q("UPDATE `contact` SET $query WHERE `id` = %d AND `uid` = %d",
282 $photos = import_profile_photo($data['photo'], local_user(), $contact_id);
284 $r = q("UPDATE `contact` SET `photo` = '%s',
294 dbesc(datetime_convert()),
295 dbesc(datetime_convert()),
296 dbesc(datetime_convert()),
302 function _contact_block($contact_id, $orig_record) {
303 $blocked = (($orig_record['blocked']) ? 0 : 1);
304 $r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d",
312 function _contact_ignore($contact_id, $orig_record) {
313 $readonly = (($orig_record['readonly']) ? 0 : 1);
314 $r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d",
321 function _contact_archive($contact_id, $orig_record) {
322 $archived = (($orig_record['archive']) ? 0 : 1);
323 $r = q("UPDATE `contact` SET `archive` = %d WHERE `id` = %d AND `uid` = %d",
329 q("UPDATE `item` SET `private` = 2 WHERE `contact-id` = %d AND `uid` = %d", intval($contact_id), intval(local_user()));
333 function _contact_drop($contact_id, $orig_record) {
334 require_once('include/Contact.php');
337 terminate_friendship($a->user,$a->contact,$orig_record);
338 contact_remove($orig_record['id']);
342 function contacts_content(&$a) {
346 nav_set_selected('contacts');
350 notice( t('Permission denied.') . EOL);
356 $contact_id = intval($a->argv[1]);
362 $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d AND `self` = 0 LIMIT 1",
367 if(! count($orig_record)) {
368 notice( t('Could not access contact record.') . EOL);
369 goaway($a->get_baseurl(true) . '/contacts');
370 return; // NOTREACHED
373 if($cmd === 'update') {
374 _contact_update($contact_id);
375 goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
379 if($cmd === 'updateprofile') {
380 _contact_update_profile($contact_id);
381 goaway($a->get_baseurl(true) . '/crepair/' . $contact_id);
385 if($cmd === 'block') {
386 $r = _contact_block($contact_id, $orig_record[0]);
388 $blocked = (($orig_record[0]['blocked']) ? 0 : 1);
389 info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')).EOL);
392 goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
393 return; // NOTREACHED
396 if($cmd === 'ignore') {
397 $r = _contact_ignore($contact_id, $orig_record[0]);
399 $readonly = (($orig_record[0]['readonly']) ? 0 : 1);
400 info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')).EOL);
403 goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
404 return; // NOTREACHED
408 if($cmd === 'archive') {
409 $r = _contact_archive($contact_id, $orig_record[0]);
411 $archived = (($orig_record[0]['archive']) ? 0 : 1);
412 info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')).EOL);
415 goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
416 return; // NOTREACHED
419 if($cmd === 'drop') {
421 // Check if we should do HTML-based delete confirmation
422 if($_REQUEST['confirm']) {
423 // <form> can't take arguments in its "action" parameter
424 // so add any arguments as hidden inputs
425 $query = explode_querystring($a->query_string);
427 foreach($query['args'] as $arg) {
428 if(strpos($arg, 'confirm=') === false) {
429 $arg_parts = explode('=', $arg);
430 $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
434 $a->page['aside'] = '';
436 return replace_macros(get_markup_template('contact_drop_confirm.tpl'), array(
437 '$contact' => _contact_detail_for_template($orig_record[0]),
439 '$message' => t('Do you really want to delete this contact?'),
440 '$extra_inputs' => $inputs,
441 '$confirm' => t('Yes'),
442 '$confirm_url' => $query['base'],
443 '$confirm_name' => 'confirmed',
444 '$cancel' => t('Cancel'),
447 // Now check how the user responded to the confirmation query
448 if($_REQUEST['canceled']) {
449 if(x($_SESSION,'return_url'))
450 goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
452 goaway($a->get_baseurl(true) . '/contacts');
455 _contact_drop($contact_id, $orig_record[0]);
456 info( t('Contact has been removed.') . EOL );
457 if(x($_SESSION,'return_url'))
458 goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']);
460 goaway($a->get_baseurl(true) . '/contacts');
461 return; // NOTREACHED
467 $_SESSION['return_url'] = $a->query_string;
469 if((x($a->data,'contact')) && (is_array($a->data['contact']))) {
471 $contact_id = $a->data['contact']['id'];
472 $contact = $a->data['contact'];
474 $editselect = 'none';
475 if( feature_enabled(local_user(),'richtext') )
476 $editselect = 'exact';
478 $a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
479 '$baseurl' => $a->get_baseurl(true),
480 '$editselect' => $editselect,
482 $a->page['end'] .= replace_macros(get_markup_template('contact_end.tpl'), array(
483 '$baseurl' => $a->get_baseurl(true),
484 '$editselect' => $editselect,
487 require_once('include/contact_selectors.php');
489 $tpl = get_markup_template("contact_edit.tpl");
491 switch($contact['rel']) {
492 case CONTACT_IS_FRIEND:
493 $dir_icon = 'images/lrarrow.gif';
494 $relation_text = t('You are mutual friends with %s');
496 case CONTACT_IS_FOLLOWER;
497 $dir_icon = 'images/larrow.gif';
498 $relation_text = t('You are sharing with %s');
501 case CONTACT_IS_SHARING;
502 $dir_icon = 'images/rarrow.gif';
503 $relation_text = t('%s is sharing with you');
509 if(!in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
512 $relation_text = sprintf($relation_text,$contact['name']);
514 if(($contact['network'] === NETWORK_DFRN) && ($contact['rel'])) {
515 $url = "redir/{$contact['id']}";
516 $sparkle = ' class="sparkle" ';
519 $url = $contact['url'];
523 $insecure = t('Private communications are not available for this contact.');
525 $last_update = (($contact['last-update'] == '0000-00-00 00:00:00')
527 : datetime_convert('UTC',date_default_timezone_get(),$contact['last-update'],'D, j M Y, g:i A'));
529 if($contact['last-update'] !== '0000-00-00 00:00:00')
530 $last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
532 $lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
534 $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2));
536 $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network'], $contact["url"]));
538 $common = count_common_friends(local_user(),$contact['id']);
539 $common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
541 $polling = (($contact['network'] === NETWORK_MAIL | $contact['network'] === NETWORK_FEED) ? 'polling' : '');
543 $x = count_all_friends(local_user(), $contact['id']);
544 $all_friends = (($x) ? t('View all contacts') : '');
549 'label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
550 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block',
552 'title' => t('Toggle Blocked status'),
556 'label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
557 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore',
559 'title' => t('Toggle Ignored status'),
564 'label' => (($contact['archive']) ? t('Unarchive') : t('Archive') ),
565 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/archive',
567 'title' => t('Toggle Archive status'),
571 'label' => t('Repair'),
572 'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id,
574 'title' => t('Advanced Contact Settings'),
578 $tab_tpl = get_markup_template('common_tabs.tpl');
579 $tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs));
581 $lost_contact = (($contact['archive'] && $contact['term-date'] != '0000-00-00 00:00:00' && $contact['term-date'] < datetime_convert('','','now')) ? t('Communications lost with this contact!') : '');
583 if ($contact['network'] == NETWORK_FEED)
584 $fetch_further_information = array('fetch_further_information', t('Fetch further information for feeds'), $contact['fetch_further_information'], t('Fetch further information for feeds'),
585 array('0'=>t('Disabled'), '1'=>t('Fetch information'), '2'=>t('Fetch information and keywords')));
587 if (in_array($contact['network'], array(NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2)))
588 $poll_interval = contact_poll_interval($contact['priority'],(! $poll_enabled));
590 if ($contact['network'] == NETWORK_DFRN)
591 $profile_select = contact_profile_assign($contact['profile-id'],(($contact['network'] !== NETWORK_DFRN) ? true : false));
593 $o .= replace_macros($tpl, array(
594 '$header' => t('Contact Editor'),
595 '$tab_str' => $tab_str,
596 '$submit' => t('Submit'),
597 '$lbl_vis1' => t('Profile Visibility'),
598 '$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['name']),
599 '$lbl_info1' => t('Contact Information / Notes'),
600 '$infedit' => t('Edit contact notes'),
601 '$common_text' => $common_text,
602 '$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'],
603 '$all_friends' => $all_friends,
604 '$relation_text' => $relation_text,
605 '$visit' => sprintf( t('Visit %s\'s profile [%s]'),$contact['name'],$contact['url']),
606 '$blockunblock' => t('Block/Unblock contact'),
607 '$ignorecont' => t('Ignore contact'),
608 '$lblcrepair' => t("Repair URL settings"),
609 '$lblrecent' => t('View conversations'),
610 '$lblsuggest' => $lblsuggest,
611 '$delete' => t('Delete contact'),
612 '$nettype' => $nettype,
613 '$poll_interval' => $poll_interval,
614 '$poll_enabled' => $poll_enabled,
615 '$lastupdtext' => t('Last update:'),
616 '$lost_contact' => $lost_contact,
617 '$updpub' => t('Update public posts'),
618 '$last_update' => $last_update,
619 '$udnow' => t('Update now'),
620 '$profile_select' => $profile_select,
621 '$contact_id' => $contact['id'],
622 '$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
623 '$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
624 '$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''),
625 '$info' => $contact['info'],
626 '$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
627 '$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
628 '$archived' => (($contact['archive']) ? t('Currently archived') : ''),
629 '$hidden' => array('hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')),
630 '$notify' => array('notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')),
631 '$fetch_further_information' => $fetch_further_information,
632 '$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
633 '$ffi_keyword_blacklist' => array('ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')),
634 '$photo' => $contact['photo'],
635 '$name' => $contact['name'],
636 '$dir_icon' => $dir_icon,
637 '$alt_text' => $alt_text,
638 '$sparkle' => $sparkle,
640 '$profileurllabel' => t('Profile URL'),
641 '$profileurl' => $contact['url'],
645 $arr = array('contact' => $contact,'output' => $o);
647 call_hooks('contact_edit', $arr);
649 return $arr['output'];
658 if(($a->argc == 2) && ($a->argv[1] === 'all')) {
662 elseif(($a->argc == 2) && ($a->argv[1] === 'blocked')) {
663 $sql_extra = " AND `blocked` = 1 ";
666 elseif(($a->argc == 2) && ($a->argv[1] === 'hidden')) {
667 $sql_extra = " AND `hidden` = 1 ";
670 elseif(($a->argc == 2) && ($a->argv[1] === 'ignored')) {
671 $sql_extra = " AND `readonly` = 1 ";
674 elseif(($a->argc == 2) && ($a->argv[1] === 'archived')) {
675 $sql_extra = " AND `archive` = 1 ";
679 $sql_extra = " AND `blocked` = 0 ";
681 $search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
682 $nets = ((x($_GET,'nets')) ? notags(trim($_GET['nets'])) : '');
686 'label' => t('Suggestions'),
687 'url' => $a->get_baseurl(true) . '/suggest',
689 'title' => t('Suggest potential friends'),
693 'label' => t('All Contacts'),
694 'url' => $a->get_baseurl(true) . '/contacts/all',
695 'sel' => ($all) ? 'active' : '',
696 'title' => t('Show all contacts'),
700 'label' => t('Unblocked'),
701 'url' => $a->get_baseurl(true) . '/contacts',
702 'sel' => ((! $all) && (! $blocked) && (! $hidden) && (! $search) && (! $nets) && (! $ignored) && (! $archived)) ? 'active' : '',
703 'title' => t('Only show unblocked contacts'),
708 'label' => t('Blocked'),
709 'url' => $a->get_baseurl(true) . '/contacts/blocked',
710 'sel' => ($blocked) ? 'active' : '',
711 'title' => t('Only show blocked contacts'),
716 'label' => t('Ignored'),
717 'url' => $a->get_baseurl(true) . '/contacts/ignored',
718 'sel' => ($ignored) ? 'active' : '',
719 'title' => t('Only show ignored contacts'),
724 'label' => t('Archived'),
725 'url' => $a->get_baseurl(true) . '/contacts/archived',
726 'sel' => ($archived) ? 'active' : '',
727 'title' => t('Only show archived contacts'),
732 'label' => t('Hidden'),
733 'url' => $a->get_baseurl(true) . '/contacts/hidden',
734 'sel' => ($hidden) ? 'active' : '',
735 'title' => t('Only show hidden contacts'),
741 $tab_tpl = get_markup_template('common_tabs.tpl');
742 $t = replace_macros($tab_tpl, array('$tabs'=>$tabs));
748 $search_hdr = $search;
749 $search_txt = dbesc(protect_sprintf(preg_quote($search)));
752 $sql_extra .= (($searching) ? " AND (name REGEXP '$search_txt' OR url REGEXP '$search_txt' OR nick REGEXP '$search_txt') " : "");
755 $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
757 $sql_extra2 = ((($sort_type > 0) && ($sort_type <= CONTACT_IS_FRIEND)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : '');
760 $r = q("SELECT COUNT(*) AS `total` FROM `contact`
761 WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
762 intval($_SESSION['uid']));
764 $a->set_pager_total($r[0]['total']);
765 $total = $r[0]['total'];
769 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ",
770 intval($_SESSION['uid']),
771 intval($a->pager['start']),
772 intval($a->pager['itemspage'])
779 $contacts[] = _contact_detail_for_template($rr);
783 $tpl = get_markup_template("contacts-template.tpl");
784 $o .= replace_macros($tpl, array(
785 '$baseurl' => $a->get_baseurl(),
786 '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''),
789 '$search' => $search_hdr,
790 '$desc' => t('Search your contacts'),
791 '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""),
792 '$submit' => t('Find'),
794 '$contacts' => $contacts,
795 '$contact_drop_confirm' => t('Do you really want to delete this contact?'),
796 '$batch_actions' => array(
797 'contacts_batch_update' => t('Update'),
798 'contacts_batch_block' => t('Block')."/".t("Unblock"),
799 "contacts_batch_ignore" => t('Ignore')."/".t("Unignore"),
800 "contacts_batch_archive" => t('Archive')."/".t("Unarchive"),
801 "contacts_batch_drop" => t('Delete'),
803 '$paginate' => paginate($a),
810 function _contact_detail_for_template($rr){
812 case CONTACT_IS_FRIEND:
813 $dir_icon = 'images/lrarrow.gif';
814 $alt_text = t('Mutual Friendship');
816 case CONTACT_IS_FOLLOWER;
817 $dir_icon = 'images/larrow.gif';
818 $alt_text = t('is a fan of yours');
820 case CONTACT_IS_SHARING;
821 $dir_icon = 'images/rarrow.gif';
822 $alt_text = t('you are a fan of');
827 if(($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
828 $url = "redir/{$rr['id']}";
829 $sparkle = ' class="sparkle" ';
838 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
839 'edit_hover' => t('Edit contact'),
840 'photo_menu' => contact_photo_menu($rr),
842 'alt_text' => $alt_text,
843 'dir_icon' => $dir_icon,
844 'thumb' => proxy_url($rr['thumb']),
845 'name' => $rr['name'],
846 'username' => $rr['name'],
847 'sparkle' => $sparkle,
848 'itemurl' => $rr['url'],
850 'network' => network_to_name($rr['network'], $rr['url']),