Merge pull request #12078 from MrPetovan/task/4090-move-mod-wallmessage

Move mod/wallmessage.php to src/Module
This commit is contained in:
Philipp 2022-10-30 19:04:47 +01:00 committed by GitHub
commit f826ce70ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 349 additions and 329 deletions

View file

@ -1,146 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @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/>.
*
*/
use Friendica\App;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Mail;
use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
if (!$replyto) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$subject = trim($_REQUEST['subject'] ?? '');
$body = Strings::escapeHtml(trim($_REQUEST['body'] ?? ''));
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
if ((! $recipient) || (! $body)) {
return;
}
$user = User::getByNickname($recipient);
if (empty($r)) {
Logger::notice('wallmessage: no recipient');
return;
}
if (!$user['unkmail']) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
switch ($ret) {
case -1:
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
break;
case -2:
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to check your home location.'));
break;
case -3:
DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
break;
}
DI::baseUrl()->redirect('profile/'.$user['nickname']);
}
function wallmessage_content(App $a) {
if (!Profile::getMyURL()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
if (!$recipient) {
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.'));
return;
}
$user = User::getByNickname($recipient);
if (empty($user)) {
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient.'));
Logger::notice('wallmessage: no recipient');
return;
}
if (!$user['unkmail']) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
return;
}
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
DI::sysmsg()->addNotice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$tpl = Renderer::getMarkupTemplate('wallmsg-header.tpl');
DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$baseurl' => DI::baseUrl()->get(true),
'$nickname' => $user['nickname'],
'$linkurl' => DI::l10n()->t('Please enter a link URL:')
]);
$tpl = Renderer::getMarkupTemplate('wallmessage.tpl');
$o = Renderer::replaceMacros($tpl, [
'$header' => DI::l10n()->t('Send Private Message'),
'$subheader' => DI::l10n()->t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
'$to' => DI::l10n()->t('To:'),
'$subject' => DI::l10n()->t('Subject:'),
'$recipname' => $user['username'],
'$nickname' => $user['nickname'],
'$subjtxt' => $_REQUEST['subject'] ?? '',
'$text' => $_REQUEST['body'] ?? '',
'$readonly' => '',
'$yourmessage'=> DI::l10n()->t('Your message:'),
'$parent' => '',
'$upload' => DI::l10n()->t('Upload photo'),
'$insert' => DI::l10n()->t('Insert web link'),
'$wait' => DI::l10n()->t('Please wait')
]);
return $o;
}

View file

@ -65,6 +65,13 @@ interface IHandleUserSessions extends IHandleSessions
*/ */
public function getUserIDForVisitorContactID(int $cid): int; public function getUserIDForVisitorContactID(int $cid): int;
/**
* Returns the account URL of the currently logged in user
*
* @return string
*/
public function getMyUrl(): string;
/** /**
* Returns if the current visitor is authenticated * Returns if the current visitor is authenticated
* *

View file

@ -110,6 +110,12 @@ class UserSession implements IHandleUserSessions
return array_search($cid, $this->session->get('remote')); return array_search($cid, $this->session->get('remote'));
} }
/** {@inheritDoc} */
public function getMyUrl(): string
{
return $this->session->get('my_url', '');
}
/** {@inheritDoc} */ /** {@inheritDoc} */
public function isAuthenticated(): bool public function isAuthenticated(): bool
{ {

View file

@ -349,7 +349,7 @@ class Profile
if ($visitor_is_followed || $visitor_is_following) { if ($visitor_is_followed || $visitor_is_following) {
$wallmessage_link = $visitor_base_path . '/message/new/' . $profile_contact['id']; $wallmessage_link = $visitor_base_path . '/message/new/' . $profile_contact['id'];
} elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) { } elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
$wallmessage_link = 'wallmessage/' . $profile['nickname']; $wallmessage_link = 'profile/' . $profile['nickname'] . '/unkmail';
} }
} }
} }
@ -679,10 +679,11 @@ class Profile
* Retrieves the my_url session variable * Retrieves the my_url session variable
* *
* @return string * @return string
* @deprecated since version 2022.12, please use UserSession->getMyUrl instead
*/ */
public static function getMyURL(): string public static function getMyURL(): string
{ {
return DI::session()->get('my_url') ?? ''; return DI::userSession()->getMyUrl();
} }
/** /**

View file

@ -0,0 +1,166 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @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\Profile;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Database;
use Friendica\Model\Mail;
use Friendica\Model\User;
use Friendica\Module\Response;
use Friendica\Navigation\SystemMessages;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
/**
* Unknown Mail module
*/
class UnkMail extends \Friendica\BaseModule
{
/** @var IHandleUserSessions */
private $userSessions;
/** @var SystemMessages */
private $systemMessages;
/** @var Database */
private $database;
/** @var App\Page */
private $page;
public function __construct(App\Page $page, Database $database, SystemMessages $systemMessages, IHandleUserSessions $userSessions, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->userSessions = $userSessions;
$this->systemMessages = $systemMessages;
$this->database = $database;
$this->page = $page;
}
protected function post(array $request = [])
{
$replyto = $this->userSessions->getMyUrl();
if (!$replyto) {
$this->systemMessages->addNotice($this->l10n->t('Permission denied.'));
return;
}
$recipient = $this->parameters['nickname'];
$subject = trim($request['subject'] ?? '');
$body = Strings::escapeHtml(trim($request['body'] ?? ''));
if (!$body) {
$this->systemMessages->addNotice($this->l10n->t('Empty message body.'));
return;
}
$user = User::getByNickname($recipient);
if (empty($user)) {
return;
}
if (!$user['unkmail']) {
return;
}
$total = $this->database->count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
switch ($ret) {
case -1:
$this->systemMessages->addNotice($this->l10n->t('No recipient selected.'));
break;
case -2:
$this->systemMessages->addNotice($this->l10n->t('Unable to check your home location.'));
break;
case -3:
$this->systemMessages->addNotice($this->l10n->t('Message could not be sent.'));
break;
case -4:
$this->systemMessages->addNotice($this->l10n->t('Message collection failure.'));
break;
}
$this->baseUrl->redirect('profile/' . $user['nickname']);
}
protected function content(array $request = []): string
{
$returnUrl = 'profile/' . $this->parameters['nickname'];
if (!$this->userSessions->getMyUrl()) {
$this->systemMessages->addNotice($this->l10n->t('Permission denied.'));
$this->baseUrl->redirect($returnUrl);
}
$user = User::getByNickname($this->parameters['nickname']);
if (empty($user)) {
$this->systemMessages->addNotice($this->l10n->t('Recipient not found.'));
$this->baseUrl->redirect($returnUrl);
}
if (!$user['unkmail']) {
$this->systemMessages->addNotice($this->l10n->t('Permission denied.'));
$this->baseUrl->redirect($returnUrl);
}
$total = $this->database->count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
$this->systemMessages->addNotice($this->l10n->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
$this->baseUrl->redirect($returnUrl);
}
$tpl = Renderer::getMarkupTemplate('profile/unkmail-header.tpl');
$this->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
'$baseurl' => $this->baseUrl->get(true),
'$nickname' => $user['nickname'],
'$linkurl' => $this->l10n->t('Please enter a link URL:')
]);
$tpl = Renderer::getMarkupTemplate('profile/unkmail.tpl');
return Renderer::replaceMacros($tpl, [
'$l10n' => [
'header' => $this->l10n->t('Send Private Message'),
'subheader' => $this->l10n->t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
'insert' => $this->l10n->t('Insert web link'),
'wait' => $this->l10n->t('Please wait'),
'submit' => $this->l10n->t('Submit'),
],
'$nickname' => $user['nickname'],
'$to' => ['to' , $this->l10n->t('To') , $user['username'], '', '', 'disabled'],
'$subject' => ['subject', $this->l10n->t('Subject') , $request['subject'] ?? ''],
'$body' => ['body' , $this->l10n->t('Your message'), $request['body'] ?? ''],
]);
}
}

View file

@ -38,6 +38,7 @@ $profileRoutes = [
'/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]], '/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
'/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]], '/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]],
'/media' => [Module\Profile\Media::class, [R::GET]], '/media' => [Module\Profile\Media::class, [R::GET]],
'/unkmail' => [Module\Profile\UnkMail::class, [R::GET, R::POST]],
]; ];
$apiRoutes = [ $apiRoutes = [

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2022.12-dev\n" "Project-Id-Version: 2022.12-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-25 19:06-0400\n" "POT-Creation-Date: 2022-10-29 21:45-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -125,23 +125,22 @@ msgstr ""
#: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156 #: mod/settings.php:40 mod/settings.php:50 mod/settings.php:156
#: mod/suggest.php:34 mod/uimport.php:33 mod/unfollow.php:35 #: mod/suggest.php:34 mod/uimport.php:33 mod/unfollow.php:35
#: mod/unfollow.php:50 mod/unfollow.php:82 mod/wall_attach.php:70 #: mod/unfollow.php:50 mod/unfollow.php:82 mod/wall_attach.php:70
#: mod/wall_attach.php:72 mod/wall_upload.php:90 mod/wallmessage.php:37 #: mod/wall_attach.php:72 mod/wall_upload.php:90 src/Module/Attach.php:56
#: mod/wallmessage.php:56 mod/wallmessage.php:90 mod/wallmessage.php:110 #: src/Module/BaseApi.php:94 src/Module/BaseNotifications.php:98
#: src/Module/Attach.php:56 src/Module/BaseApi.php:94 #: src/Module/Contact/Advanced.php:60 src/Module/Delegation.php:118
#: src/Module/BaseNotifications.php:98 src/Module/Contact/Advanced.php:60 #: src/Module/FollowConfirm.php:38 src/Module/FriendSuggest.php:57
#: src/Module/Delegation.php:118 src/Module/FollowConfirm.php:38 #: src/Module/Group.php:40 src/Module/Group.php:83 src/Module/Invite.php:42
#: src/Module/FriendSuggest.php:57 src/Module/Group.php:40 #: src/Module/Invite.php:131 src/Module/Notifications/Notification.php:76
#: src/Module/Group.php:83 src/Module/Invite.php:42 src/Module/Invite.php:131
#: src/Module/Notifications/Notification.php:76
#: src/Module/Notifications/Notification.php:107 #: src/Module/Notifications/Notification.php:107
#: src/Module/Profile/Common.php:55 src/Module/Profile/Contacts.php:55 #: src/Module/Profile/Common.php:55 src/Module/Profile/Contacts.php:55
#: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56 #: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56
#: src/Module/Register.php:77 src/Module/Register.php:90 #: src/Module/Profile/UnkMail.php:69 src/Module/Profile/UnkMail.php:121
#: src/Module/Register.php:206 src/Module/Register.php:245 #: src/Module/Profile/UnkMail.php:132 src/Module/Register.php:77
#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50 #: src/Module/Register.php:90 src/Module/Register.php:206
#: src/Module/Settings/Account.php:410 src/Module/Settings/Delegation.php:41 #: src/Module/Register.php:245 src/Module/Search/Directory.php:37
#: src/Module/Settings/Delegation.php:69 src/Module/Settings/Display.php:41 #: src/Module/Settings/Account.php:50 src/Module/Settings/Account.php:410
#: src/Module/Settings/Display.php:119 #: src/Module/Settings/Delegation.php:41 src/Module/Settings/Delegation.php:69
#: src/Module/Settings/Display.php:41 src/Module/Settings/Display.php:119
#: src/Module/Settings/Profile/Photo/Crop.php:165 #: src/Module/Settings/Profile/Photo/Crop.php:165
#: src/Module/Settings/Profile/Photo/Index.php:111 #: src/Module/Settings/Profile/Photo/Index.php:111
#: src/Module/Settings/UserExport.php:84 src/Module/Settings/UserExport.php:118 #: src/Module/Settings/UserExport.php:84 src/Module/Settings/UserExport.php:118
@ -165,12 +164,12 @@ msgid "Save"
msgstr "" msgstr ""
#: mod/editpost.php:92 mod/photos.php:1333 src/Content/Conversation.php:341 #: mod/editpost.php:92 mod/photos.php:1333 src/Content/Conversation.php:341
#: src/Object/Post.php:992 #: src/Object/Post.php:987
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: mod/editpost.php:93 mod/message.php:201 mod/message.php:357 #: mod/editpost.php:93 mod/message.php:201 mod/message.php:357
#: mod/wallmessage.php:140 src/Content/Conversation.php:342 #: src/Content/Conversation.php:342
msgid "Upload photo" msgid "Upload photo"
msgstr "" msgstr ""
@ -187,7 +186,7 @@ msgid "attach file"
msgstr "" msgstr ""
#: mod/editpost.php:97 mod/message.php:202 mod/message.php:358 #: mod/editpost.php:97 mod/message.php:202 mod/message.php:358
#: mod/wallmessage.php:141 #: src/Module/Profile/UnkMail.php:154
msgid "Insert web link" msgid "Insert web link"
msgstr "" msgstr ""
@ -229,9 +228,9 @@ msgid "clear location"
msgstr "" msgstr ""
#: mod/editpost.php:107 mod/message.php:203 mod/message.php:360 #: mod/editpost.php:107 mod/message.php:203 mod/message.php:360
#: mod/photos.php:1484 mod/wallmessage.php:142 src/Content/Conversation.php:371 #: mod/photos.php:1484 src/Content/Conversation.php:371
#: src/Content/Conversation.php:717 src/Module/Item/Compose.php:204 #: src/Content/Conversation.php:717 src/Module/Item/Compose.php:204
#: src/Object/Post.php:537 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537
msgid "Please wait" msgid "Please wait"
msgstr "" msgstr ""
@ -263,7 +262,7 @@ msgstr ""
#: mod/editpost.php:128 mod/events.php:514 mod/photos.php:1332 #: mod/editpost.php:128 mod/events.php:514 mod/photos.php:1332
#: mod/photos.php:1388 mod/photos.php:1462 src/Content/Conversation.php:386 #: mod/photos.php:1388 mod/photos.php:1462 src/Content/Conversation.php:386
#: src/Module/Item/Compose.php:199 src/Object/Post.php:1002 #: src/Module/Item/Compose.php:199 src/Object/Post.php:997
msgid "Preview" msgid "Preview"
msgstr "" msgstr ""
@ -276,37 +275,37 @@ msgid "Cancel"
msgstr "" msgstr ""
#: mod/editpost.php:134 src/Content/Conversation.php:346 #: mod/editpost.php:134 src/Content/Conversation.php:346
#: src/Module/Item/Compose.php:190 src/Object/Post.php:993 #: src/Module/Item/Compose.php:190 src/Object/Post.php:988
msgid "Bold" msgid "Bold"
msgstr "" msgstr ""
#: mod/editpost.php:135 src/Content/Conversation.php:347 #: mod/editpost.php:135 src/Content/Conversation.php:347
#: src/Module/Item/Compose.php:191 src/Object/Post.php:994 #: src/Module/Item/Compose.php:191 src/Object/Post.php:989
msgid "Italic" msgid "Italic"
msgstr "" msgstr ""
#: mod/editpost.php:136 src/Content/Conversation.php:348 #: mod/editpost.php:136 src/Content/Conversation.php:348
#: src/Module/Item/Compose.php:192 src/Object/Post.php:995 #: src/Module/Item/Compose.php:192 src/Object/Post.php:990
msgid "Underline" msgid "Underline"
msgstr "" msgstr ""
#: mod/editpost.php:137 src/Content/Conversation.php:349 #: mod/editpost.php:137 src/Content/Conversation.php:349
#: src/Module/Item/Compose.php:193 src/Object/Post.php:996 #: src/Module/Item/Compose.php:193 src/Object/Post.php:991
msgid "Quote" msgid "Quote"
msgstr "" msgstr ""
#: mod/editpost.php:138 src/Content/Conversation.php:350 #: mod/editpost.php:138 src/Content/Conversation.php:350
#: src/Module/Item/Compose.php:194 src/Object/Post.php:997 #: src/Module/Item/Compose.php:194 src/Object/Post.php:992
msgid "Code" msgid "Code"
msgstr "" msgstr ""
#: mod/editpost.php:139 src/Content/Conversation.php:352 #: mod/editpost.php:139 src/Content/Conversation.php:352
#: src/Module/Item/Compose.php:196 src/Object/Post.php:999 #: src/Module/Item/Compose.php:196 src/Object/Post.php:994
msgid "Link" msgid "Link"
msgstr "" msgstr ""
#: mod/editpost.php:140 src/Content/Conversation.php:353 #: mod/editpost.php:140 src/Content/Conversation.php:353
#: src/Module/Item/Compose.php:197 src/Object/Post.php:1000 #: src/Module/Item/Compose.php:197 src/Object/Post.php:995
msgid "Link or Media" msgid "Link or Media"
msgstr "" msgstr ""
@ -416,9 +415,10 @@ msgstr ""
#: src/Module/Install.php:252 src/Module/Install.php:294 #: src/Module/Install.php:252 src/Module/Install.php:294
#: src/Module/Install.php:331 src/Module/Invite.php:178 #: src/Module/Install.php:331 src/Module/Invite.php:178
#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:246 #: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:246
#: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:991 #: src/Module/Profile/UnkMail.php:156 src/Module/Settings/Profile/Index.php:222
#: view/theme/duepuntozero/config.php:85 view/theme/frio/config.php:171 #: src/Object/Post.php:986 view/theme/duepuntozero/config.php:85
#: view/theme/quattro/config.php:87 view/theme/vier/config.php:135 #: view/theme/frio/config.php:171 view/theme/quattro/config.php:87
#: view/theme/vier/config.php:135
msgid "Submit" msgid "Submit"
msgstr "" msgstr ""
@ -695,7 +695,7 @@ msgstr ""
msgid "New Message" msgid "New Message"
msgstr "" msgstr ""
#: mod/message.php:83 mod/wallmessage.php:70 #: mod/message.php:83 src/Module/Profile/UnkMail.php:100
msgid "No recipient selected." msgid "No recipient selected."
msgstr "" msgstr ""
@ -703,11 +703,11 @@ msgstr ""
msgid "Unable to locate contact information." msgid "Unable to locate contact information."
msgstr "" msgstr ""
#: mod/message.php:92 mod/wallmessage.php:76 #: mod/message.php:92 src/Module/Profile/UnkMail.php:106
msgid "Message could not be sent." msgid "Message could not be sent."
msgstr "" msgstr ""
#: mod/message.php:96 mod/wallmessage.php:79 #: mod/message.php:96 src/Module/Profile/UnkMail.php:109
msgid "Message collection failure." msgid "Message collection failure."
msgstr "" msgstr ""
@ -733,24 +733,23 @@ msgstr ""
msgid "Conversation was not removed." msgid "Conversation was not removed."
msgstr "" msgstr ""
#: mod/message.php:183 mod/message.php:289 mod/wallmessage.php:124 #: mod/message.php:183 mod/message.php:289 src/Module/Profile/UnkMail.php:146
msgid "Please enter a link URL:" msgid "Please enter a link URL:"
msgstr "" msgstr ""
#: mod/message.php:192 mod/wallmessage.php:129 #: mod/message.php:192 src/Module/Profile/UnkMail.php:152
msgid "Send Private Message" msgid "Send Private Message"
msgstr "" msgstr ""
#: mod/message.php:193 mod/message.php:349 mod/wallmessage.php:131 #: mod/message.php:193 mod/message.php:349
msgid "To:" msgid "To:"
msgstr "" msgstr ""
#: mod/message.php:194 mod/message.php:350 mod/wallmessage.php:132 #: mod/message.php:194 mod/message.php:350
msgid "Subject:" msgid "Subject:"
msgstr "" msgstr ""
#: mod/message.php:198 mod/message.php:353 mod/wallmessage.php:138 #: mod/message.php:198 mod/message.php:353 src/Module/Invite.php:171
#: src/Module/Invite.php:171
msgid "Your message:" msgid "Your message:"
msgstr "" msgstr ""
@ -1071,12 +1070,12 @@ msgstr ""
#: mod/photos.php:1328 mod/photos.php:1384 mod/photos.php:1458 #: mod/photos.php:1328 mod/photos.php:1384 mod/photos.php:1458
#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188
#: src/Object/Post.php:988 #: src/Object/Post.php:983
msgid "This is you" msgid "This is you"
msgstr "" msgstr ""
#: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460 #: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460
#: src/Object/Post.php:531 src/Object/Post.php:990 #: src/Object/Post.php:531 src/Object/Post.php:985
msgid "Comment" msgid "Comment"
msgstr "" msgstr ""
@ -1411,7 +1410,7 @@ msgstr ""
msgid "Friend Suggestions" msgid "Friend Suggestions"
msgstr "" msgstr ""
#: mod/tagger.php:77 src/Content/Item.php:304 src/Model/Item.php:2860 #: mod/tagger.php:77 src/Content/Item.php:304 src/Model/Item.php:2861
msgid "photo" msgid "photo"
msgstr "" msgstr ""
@ -1529,26 +1528,6 @@ msgstr ""
msgid "Wall Photos" msgid "Wall Photos"
msgstr "" msgstr ""
#: mod/wallmessage.php:62 mod/wallmessage.php:116
#, php-format
msgid "Number of daily wall messages for %s exceeded. Message failed."
msgstr ""
#: mod/wallmessage.php:73
msgid "Unable to check your home location."
msgstr ""
#: mod/wallmessage.php:97 mod/wallmessage.php:104
msgid "No recipient."
msgstr ""
#: mod/wallmessage.php:130
#, php-format
msgid ""
"If you wish for %s to respond, please check that the privacy settings on "
"your site allow private mail from unknown senders."
msgstr ""
#: src/App.php:490 #: src/App.php:490
msgid "No system theme config value set." msgid "No system theme config value set."
msgstr "" msgstr ""
@ -2021,7 +2000,7 @@ msgid "Visible to <strong>everybody</strong>"
msgstr "" msgstr ""
#: src/Content/Conversation.php:311 src/Module/Item/Compose.php:198 #: src/Content/Conversation.php:311 src/Module/Item/Compose.php:198
#: src/Object/Post.php:1001 #: src/Object/Post.php:996
msgid "Please enter a image/video/audio/webpage URL:" msgid "Please enter a image/video/audio/webpage URL:"
msgstr "" msgstr ""
@ -2054,7 +2033,7 @@ msgid "Share"
msgstr "" msgstr ""
#: src/Content/Conversation.php:351 src/Module/Item/Compose.php:195 #: src/Content/Conversation.php:351 src/Module/Item/Compose.php:195
#: src/Object/Post.php:998 #: src/Object/Post.php:993
msgid "Image" msgid "Image"
msgstr "" msgstr ""
@ -2292,7 +2271,7 @@ msgstr ""
msgid "show more" msgid "show more"
msgstr "" msgstr ""
#: src/Content/Item.php:295 src/Model/Item.php:2858 #: src/Content/Item.php:295 src/Model/Item.php:2859
msgid "event" msgid "event"
msgstr "" msgstr ""
@ -2628,39 +2607,39 @@ msgstr ""
msgid "last" msgid "last"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1879 #: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1903
#: src/Content/Text/BBCode.php:1880 #: src/Content/Text/BBCode.php:1904
msgid "Image/photo" msgid "Image/photo"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1234 #: src/Content/Text/BBCode.php:1258
#, php-format #, php-format
msgid "" msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s" "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1259 src/Model/Item.php:3461 #: src/Content/Text/BBCode.php:1283 src/Model/Item.php:3460
#: src/Model/Item.php:3467 src/Model/Item.php:3468 #: src/Model/Item.php:3466 src/Model/Item.php:3467
msgid "Link to source" msgid "Link to source"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1797 src/Content/Text/HTML.php:940 #: src/Content/Text/BBCode.php:1821 src/Content/Text/HTML.php:940
msgid "Click to open/close" msgid "Click to open/close"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1828 #: src/Content/Text/BBCode.php:1852
msgid "$1 wrote:" msgid "$1 wrote:"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1884 src/Content/Text/BBCode.php:1885 #: src/Content/Text/BBCode.php:1908 src/Content/Text/BBCode.php:1909
msgid "Encrypted content" msgid "Encrypted content"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:2105 #: src/Content/Text/BBCode.php:2129
msgid "Invalid source protocol" msgid "Invalid source protocol"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:2120 #: src/Content/Text/BBCode.php:2144
msgid "Invalid link protocol" msgid "Invalid link protocol"
msgstr "" msgstr ""
@ -3782,66 +3761,66 @@ msgstr ""
msgid "Edit groups" msgid "Edit groups"
msgstr "" msgstr ""
#: src/Model/Item.php:1970 #: src/Model/Item.php:1971
#, php-format #, php-format
msgid "Detected languages in this post:\\n%s" msgid "Detected languages in this post:\\n%s"
msgstr "" msgstr ""
#: src/Model/Item.php:2862 #: src/Model/Item.php:2863
msgid "activity" msgid "activity"
msgstr "" msgstr ""
#: src/Model/Item.php:2864 #: src/Model/Item.php:2865
msgid "comment" msgid "comment"
msgstr "" msgstr ""
#: src/Model/Item.php:2867 #: src/Model/Item.php:2868
msgid "post" msgid "post"
msgstr "" msgstr ""
#: src/Model/Item.php:3010 #: src/Model/Item.php:3009
#, php-format #, php-format
msgid "Content warning: %s" msgid "Content warning: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:3373 #: src/Model/Item.php:3372
msgid "bytes" msgid "bytes"
msgstr "" msgstr ""
#: src/Model/Item.php:3404 #: src/Model/Item.php:3403
#, php-format #, php-format
msgid "%2$s (%3$d%%, %1$d vote)" msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)" msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3406 #: src/Model/Item.php:3405
#, php-format #, php-format
msgid "%2$s (%1$d vote)" msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)" msgid_plural "%2$s (%1$d votes)"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3411 #: src/Model/Item.php:3410
#, php-format #, php-format
msgid "%d voter. Poll end: %s" msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s" msgid_plural "%d voters. Poll end: %s"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3413 #: src/Model/Item.php:3412
#, php-format #, php-format
msgid "%d voter." msgid "%d voter."
msgid_plural "%d voters." msgid_plural "%d voters."
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:3415 #: src/Model/Item.php:3414
#, php-format #, php-format
msgid "Poll end: %s" msgid "Poll end: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:3449 src/Model/Item.php:3450 #: src/Model/Item.php:3448 src/Model/Item.php:3449
msgid "View on separate page" msgid "View on separate page"
msgstr "" msgstr ""
@ -3904,88 +3883,88 @@ msgstr ""
msgid "Upcoming events the next 7 days:" msgid "Upcoming events the next 7 days:"
msgstr "" msgstr ""
#: src/Model/Profile.php:867 #: src/Model/Profile.php:868
#, php-format #, php-format
msgid "OpenWebAuth: %1$s welcomes %2$s" msgid "OpenWebAuth: %1$s welcomes %2$s"
msgstr "" msgstr ""
#: src/Model/Profile.php:1007 #: src/Model/Profile.php:1008
msgid "Hometown:" msgid "Hometown:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1008 #: src/Model/Profile.php:1009
msgid "Marital Status:" msgid "Marital Status:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1009 #: src/Model/Profile.php:1010
msgid "With:" msgid "With:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1010 #: src/Model/Profile.php:1011
msgid "Since:" msgid "Since:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1011 #: src/Model/Profile.php:1012
msgid "Sexual Preference:" msgid "Sexual Preference:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1012 #: src/Model/Profile.php:1013
msgid "Political Views:" msgid "Political Views:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1013 #: src/Model/Profile.php:1014
msgid "Religious Views:" msgid "Religious Views:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1014 #: src/Model/Profile.php:1015
msgid "Likes:" msgid "Likes:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1015 #: src/Model/Profile.php:1016
msgid "Dislikes:" msgid "Dislikes:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1016 #: src/Model/Profile.php:1017
msgid "Title/Description:" msgid "Title/Description:"
msgstr "" msgstr ""
#: src/Model/Profile.php:1017 src/Module/Admin/Summary.php:236 #: src/Model/Profile.php:1018 src/Module/Admin/Summary.php:236
msgid "Summary" msgid "Summary"
msgstr "" msgstr ""
#: src/Model/Profile.php:1018 #: src/Model/Profile.php:1019
msgid "Musical interests" msgid "Musical interests"
msgstr "" msgstr ""
#: src/Model/Profile.php:1019 #: src/Model/Profile.php:1020
msgid "Books, literature" msgid "Books, literature"
msgstr "" msgstr ""
#: src/Model/Profile.php:1020 #: src/Model/Profile.php:1021
msgid "Television" msgid "Television"
msgstr "" msgstr ""
#: src/Model/Profile.php:1021 #: src/Model/Profile.php:1022
msgid "Film/dance/culture/entertainment" msgid "Film/dance/culture/entertainment"
msgstr "" msgstr ""
#: src/Model/Profile.php:1022 #: src/Model/Profile.php:1023
msgid "Hobbies/Interests" msgid "Hobbies/Interests"
msgstr "" msgstr ""
#: src/Model/Profile.php:1023 #: src/Model/Profile.php:1024
msgid "Love/romance" msgid "Love/romance"
msgstr "" msgstr ""
#: src/Model/Profile.php:1024 #: src/Model/Profile.php:1025
msgid "Work/employment" msgid "Work/employment"
msgstr "" msgstr ""
#: src/Model/Profile.php:1025 #: src/Model/Profile.php:1026
msgid "School/education" msgid "School/education"
msgstr "" msgstr ""
#: src/Model/Profile.php:1026 #: src/Model/Profile.php:1027
msgid "Contact information and Social Networks" msgid "Contact information and Social Networks"
msgstr "" msgstr ""
@ -8423,6 +8402,42 @@ msgstr ""
msgid "Remove post" msgid "Remove post"
msgstr "" msgstr ""
#: src/Module/Profile/UnkMail.php:78
msgid "Empty message body."
msgstr ""
#: src/Module/Profile/UnkMail.php:103
msgid "Unable to check your home location."
msgstr ""
#: src/Module/Profile/UnkMail.php:127
msgid "Recipient not found."
msgstr ""
#: src/Module/Profile/UnkMail.php:138
#, php-format
msgid "Number of daily wall messages for %s exceeded. Message failed."
msgstr ""
#: src/Module/Profile/UnkMail.php:153
#, php-format
msgid ""
"If you wish for %s to respond, please check that the privacy settings on "
"your site allow private mail from unknown senders."
msgstr ""
#: src/Module/Profile/UnkMail.php:161
msgid "To"
msgstr ""
#: src/Module/Profile/UnkMail.php:162
msgid "Subject"
msgstr ""
#: src/Module/Profile/UnkMail.php:163
msgid "Your message"
msgstr ""
#: src/Module/Register.php:84 #: src/Module/Register.php:84
msgid "Only parent users can create additional accounts." msgid "Only parent users can create additional accounts."
msgstr "" msgstr ""
@ -11065,7 +11080,7 @@ msgstr ""
msgid "%1$d %2$s ago" msgid "%1$d %2$s ago"
msgstr "" msgstr ""
#: src/Worker/Delivery.php:527 #: src/Worker/Delivery.php:534
msgid "(no subject)" msgid "(no subject)"
msgstr "" msgstr ""

View file

@ -0,0 +1,15 @@
<script language="javascript" type="text/javascript">
$("#id_body").editor_autocomplete(baseurl + '/search/acl');
</script>
<script>
function jotGetLink() {
reply = prompt("{{$linkurl}}");
if (reply && reply.length) {
$('#profile-rotator').show();
$.get('parseurl?url=' + reply, function (data) {
addeditortext(data);
$('#profile-rotator').hide();
});
}
}
</script>

View file

@ -0,0 +1,26 @@
<div class="generic-page-wrapper">
<h2>{{$l10n.header}}</h2>
<p>{{$l10n.subheader}}</p>
<div id="prvmail-wrapper">
<form id="prvmail-form" action="profile/{{$nickname}}/unkmail" method="post">
{{include file="field_input.tpl" field=$to}}
{{include file="field_input.tpl" field=$subject}}
{{include file="field_textarea.tpl" field=$body}}
<div id="prvmail-submit-wrapper">
<button type="submit" id="prvmail-submit" class="btn btn-primary" name="submit">
{{$l10n.submit}}
</button>
<div id="prvmail-link-wrapper">
<div id="prvmail-link" class="icon border link" title="{{$l10n.insert}}" onclick="jotGetLink();"></div>
</div>
<div id="prvmail-rotator-wrapper">
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$l10n.wait}}" title="{{$l10n.wait}}" style="display: none;"/>
</div>
</div>
<div id="prvmail-end"></div>
</form>
</div>
</div>

View file

@ -1,34 +0,0 @@
<div class="generic-page-wrapper">
<h3>{{$header}}</h3>
<h4>{{$subheader}}</h4>
<div id="prvmail-wrapper">
<form id="prvmail-form" action="wallmessage/{{$nickname}}" method="post">
{{$parent nofilter}}
<div id="prvmail-to-label">{{$to}}</div>
{{$recipname}}
<div id="prvmail-subject-label">{{$subject}}</div>
<input type="text" size="64" maxlength="255" id="prvmail-subject" name="subject" value="{{$subjtxt}}" {{$readonly}} tabindex="11" />
<div id="prvmail-message-label">{{$yourmessage}}</div>
<textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea>
<div id="prvmail-submit-wrapper">
<input type="submit" id="prvmail-submit" name="submit" value="Submit" tabindex="13" />
<div id="prvmail-link-wrapper">
<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();"></div>
</div>
<div id="prvmail-rotator-wrapper">
<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
</div>
</div>
<div id="prvmail-end"></div>
</form>
</div>
</div>

View file

@ -1,37 +0,0 @@
<script language="javascript" type="text/javascript">
$("#prvmail-text").editor_autocomplete(baseurl + '/search/acl');
</script>
<script>
function jotGetLink() {
reply = prompt("{{$linkurl}}");
if(reply && reply.length) {
$('#profile-rotator').show();
$.get('parseurl?url=' + reply, function(data) {
addeditortext(data);
$('#profile-rotator').hide();
});
}
}
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");
if(linkFound)
event.preventDefault();
}
function linkdrop(event) {
var reply = event.dataTransfer.getData("text/uri-list");
event.target.textContent = reply;
event.preventDefault();
if(reply && reply.length) {
$('#profile-rotator').show();
$.get('parseurl?url=' + reply, function(data) {
addeditortext(data);
$('#profile-rotator').hide();
});
}
}
</script>