-function frio_remote_nav(App $a, array &$nav_info)
-{
- // get the homelink from $_XSESSION
- $homelink = Model\Profile::getMyURL();
- if (!$homelink) {
- $homelink = Session::get('visitor_home', '');
- }
-
- // since $userinfo isn't available for the hook we write it to the nav array
- // this isn't optimal because the contact query will be done now twice
- $fields = ['id', 'url', 'avatar', 'micro', 'name', 'nick', 'baseurl', 'updated'];
- if ($a->isLoggedIn()) {
- $remoteUser = Contact::selectFirst($fields, ['uid' => $a->getLoggedInUserId(), 'self' => true]);
- } elseif (!local_user() && remote_user()) {
- $remoteUser = Contact::getById(remote_user(), $fields);
- $nav_info['nav']['remote'] = DI::l10n()->t('Guest');
- } elseif (Model\Profile::getMyURL()) {
- $remoteUser = Contact::getByURL($homelink, null, $fields);
- $nav_info['nav']['remote'] = DI::l10n()->t('Visitor');
- } else {
- $remoteUser = null;
- }
-
- if (DBA::isResult($remoteUser)) {
- $nav_info['userinfo'] = [
- 'icon' => Contact::getMicro($remoteUser),
- 'name' => $remoteUser['name'],
- ];
- $server_url = $remoteUser['baseurl'];
- }
-
- if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
- // user menu
- $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
- $nav_info['nav']['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '/profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
- $nav_info['nav']['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')];
- $nav_info['nav']['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')];
- $nav_info['nav']['usermenu'][] = [$server_url . '/events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')];
-
- // navbar links
- $nav_info['nav']['network'] = [$server_url . '/network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
- $nav_info['nav']['events'] = [$server_url . '/events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
- $nav_info['nav']['messages'] = [$server_url . '/message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')];
- $nav_info['nav']['settings'] = [$server_url . '/settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')];
- $nav_info['nav']['contacts'] = [$server_url . '/contact', DI::l10n()->t('Contacts'), '', DI::l10n()->t('Manage/edit friends and contacts')];
- $nav_info['nav']['sitename'] = DI::config()->get('config', 'sitename');
- }
-}
-
-/**
- * Search for contacts
- *
- * This function search for a users contacts. The code is copied from contact search
- * in /src/Module/Contact.php. With this function the contacts will permitted to acl_lookup()
- * and can grabbed as json. For this we use the type="r". This is usful to to let js
- * grab the contact data.
- * We use this to give the data to textcomplete and have a filter function at the
- * contact page.
- *
- * @param App $a The app data @TODO Unused
- * @param array $results The array with the originals from acl_lookup()
- */
-function frio_acl_lookup(App $a, &$results)