<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
namespace Friendica\Module\Notifications;
$notifications = [
'ident' => 'introductions',
- 'notifications' => DI::factNotIntro()->getList($all, self::$firstItemNum, self::ITEMS_PER_PAGE, $id),
+ 'notifications' => DI::notificationIntro()->getList($all, self::$firstItemNum, self::ITEMS_PER_PAGE, $id),
];
return [
// Normal connection requests
default:
- $friend_selected = (($notification->getNetwork() !== Protocol::OSTATUS) ? ' checked="checked" ' : ' disabled ');
- $fan_selected = (($notification->getNetwork() === Protocol::OSTATUS) ? ' checked="checked" disabled ' : '');
-
- $lbl_knowyou = '';
- $knowyou = '';
- $helptext = '';
- $helptext2 = '';
- $helptext3 = '';
-
if ($notification->getNetwork() === Protocol::DFRN) {
$lbl_knowyou = DI::l10n()->t('Claims to be known to you: ');
- $knowyou = ($notification->getKnowYou() ? DI::l10n()->t('yes') : DI::l10n()->t('no'));
- $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?');
- $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName());
- $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName());
- } elseif ($notification->getNetwork() === Protocol::DIASPORA) {
- $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?');
- $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName());
- $helptext3 = DI::l10n()->t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName());
+ $knowyou = ($notification->getKnowYou() ? DI::l10n()->t('Yes') : DI::l10n()->t('No'));
+ } else {
+ $lbl_knowyou = '';
+ $knowyou = '';
}
- $dfrn_tpl = Renderer::getMarkupTemplate('notifications/netfriend.tpl');
- $dfrn_text = Renderer::replaceMacros($dfrn_tpl, [
- '$intro_id' => $notification->getIntroId(),
- '$friend_selected' => $friend_selected,
- '$fan_selected' => $fan_selected,
- '$approve_as1' => $helptext,
- '$approve_as2' => $helptext2,
- '$approve_as3' => $helptext3,
- '$as_friend' => DI::l10n()->t('Friend'),
- '$as_fan' => (($notification->getNetwork() == Protocol::DIASPORA) ? DI::l10n()->t('Sharer') : DI::l10n()->t('Subscriber')),
- ]);
+ $helptext = DI::l10n()->t('Shall your connection be bidirectional or not?');
+ $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notification->getName(), $notification->getName());
+ $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notification->getName());
+
+ $friend = ['duplex', DI::l10n()->t('Friend'), '1', $helptext2, true];
+ $follower = ['duplex', DI::l10n()->t('Subscriber'), '0', $helptext3, false];
$contact = DBA::selectFirst('contact', ['network', 'protocol'], ['id' => $notification->getContactId()]);
'$header' => $header,
'$str_notification_type' => DI::l10n()->t('Notification type:'),
'$str_type' => $notification->getType(),
- '$dfrn_text' => $dfrn_text,
'$dfrn_id' => $notification->getDfrnId(),
'$uid' => $notification->getUid(),
'$intro_id' => $notification->getIntroId(),
'$lbl_about' => DI::l10n()->t('About:'),
'$keywords' => $notification->getKeywords(),
'$lbl_keywords' => DI::l10n()->t('Tags:'),
- '$gender' => $notification->getGender(),
- '$lbl_gender' => DI::l10n()->t('Gender:'),
'$hidden' => ['hidden', DI::l10n()->t('Hide this contact from others'), $notification->isHidden(), ''],
+ '$lbl_connection_type' => $helptext,
+ '$friend' => $friend,
+ '$follower' => $follower,
'$url' => $notification->getUrl(),
'$zrl' => $notification->getZrl(),
'$lbl_url' => DI::l10n()->t('Profile URL'),
}
if (count($notifications['notifications']) == 0) {
- info(DI::l10n()->t('No introductions.') . EOL);
+ notice(DI::l10n()->t('No introductions.'));
$notificationNoContent = DI::l10n()->t('No more %s notifications.', $notifications['ident']);
}