From 00883c9dcbebe6eb6fe11c504f0699d41e062503 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Nov 2022 22:26:52 +0100 Subject: [PATCH 1/9] Move mod/editpost.php to src\Module\Post\Edit --- doc/Addons.md | 8 +- doc/de/Addons.md | 8 +- mod/editpost.php | 166 ---------------------------- src/Module/Post/Edit.php | 228 +++++++++++++++++++++++++++++++++++++++ src/Object/Post.php | 2 +- static/routes.config.php | 1 + 6 files changed, 238 insertions(+), 175 deletions(-) delete mode 100644 mod/editpost.php create mode 100644 src/Module/Post/Edit.php diff --git a/doc/Addons.md b/doc/Addons.md index b43a8a915..171b5681a 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -790,10 +790,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- Hook::callAll('post_local', $datarray); Hook::callAll('post_local_end', $datarray); -### mod/editpost.php - - Hook::callAll('jot_tool', $jotplugins); - ### src/Render/FriendicaSmartyEngine.php Hook::callAll("template_vars", $arr); @@ -855,6 +851,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- Hook::callAll('lockview_content', $item); +### src/Module/Post/Edit.php + + Hook::callAll('jot_tool', $jotplugins); + ### src/Module/Settings/Delegation.php Hook::callAll('authenticate', $addon_auth); diff --git a/doc/de/Addons.md b/doc/de/Addons.md index 342dd1b81..143e309cb 100644 --- a/doc/de/Addons.md +++ b/doc/de/Addons.md @@ -309,10 +309,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap Hook::callAll('post_local', $datarray); Hook::callAll('post_local_end', $datarray); -### mod/editpost.php - - Hook::callAll('jot_tool', $jotplugins); - ### src/Network/FKOAuth1.php Hook::callAll('logged_in', $a->user); @@ -422,6 +418,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap Hook::callAll('lockview_content', $item); +### src/Module/Post/Edit.php + + Hook::callAll('jot_tool', $jotplugins); + ### src/Worker/Directory.php Hook::callAll('globaldir_update', $arr); diff --git a/mod/editpost.php b/mod/editpost.php deleted file mode 100644 index bec5d3449..000000000 --- a/mod/editpost.php +++ /dev/null @@ -1,166 +0,0 @@ -. - * - */ - -use Friendica\App; -use Friendica\Content\Feature; -use Friendica\Core\Hook; -use Friendica\Core\Renderer; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Contact; -use Friendica\Model\Post; -use Friendica\Model\User; -use Friendica\Util\Crypto; - -function editpost_content(App $a) -{ - $o = ''; - - if (!DI::userSession()->getLocalUserId()) { - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return; - } - - $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0); - - if (!$post_id) { - DI::sysmsg()->addNotice(DI::l10n()->t('Item not found')); - return; - } - - $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', - 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid']; - - $item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['id' => $post_id, 'uid' => DI::userSession()->getLocalUserId()]); - - if (!DBA::isResult($item)) { - DI::sysmsg()->addNotice(DI::l10n()->t('Item not found')); - return; - } - - $user = User::getById(DI::userSession()->getLocalUserId()); - - $geotag = ''; - - $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate("section_title.tpl"), [ - '$title' => DI::l10n()->t('Edit post') - ]); - - $tpl = Renderer::getMarkupTemplate('jot-header.tpl'); - DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [ - '$ispublic' => ' ', // DI::l10n()->t('Visible to everybody'), - '$geotag' => $geotag, - '$nickname' => $a->getLoggedInUserNickname(), - '$is_mobile' => DI::mode()->isMobile(), - ]); - - if (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) { - $lockstate = 'lock'; - } else { - $lockstate = 'unlock'; - } - - $jotplugins = ''; - $jotnets = ''; - - Hook::callAll('jot_tool', $jotplugins); - - $tpl = Renderer::getMarkupTemplate('jot.tpl'); - $o .= Renderer::replaceMacros($tpl, [ - '$is_edit' => true, - '$return_path' => '/display/' . $item['guid'], - '$action' => 'item', - '$share' => DI::l10n()->t('Save'), - '$loading' => DI::l10n()->t('Loading...'), - '$upload' => DI::l10n()->t('Upload photo'), - '$shortupload' => DI::l10n()->t('upload photo'), - '$attach' => DI::l10n()->t('Attach file'), - '$shortattach' => DI::l10n()->t('attach file'), - '$weblink' => DI::l10n()->t('Insert web link'), - '$shortweblink' => DI::l10n()->t('web link'), - '$video' => DI::l10n()->t('Insert video link'), - '$shortvideo' => DI::l10n()->t('video link'), - '$audio' => DI::l10n()->t('Insert audio link'), - '$shortaudio' => DI::l10n()->t('audio link'), - '$setloc' => DI::l10n()->t('Set your location'), - '$shortsetloc' => DI::l10n()->t('set location'), - '$noloc' => DI::l10n()->t('Clear browser location'), - '$shortnoloc' => DI::l10n()->t('clear location'), - '$wait' => DI::l10n()->t('Please wait'), - '$permset' => DI::l10n()->t('Permission settings'), - '$wall' => $item['wall'], - '$posttype' => $item['post-type'], - '$content' => undo_post_tagging($item['body']), - '$post_id' => $post_id, - '$defloc' => $user['default-location'], - '$visitor' => 'none', - '$pvisit' => 'none', - '$emailcc' => DI::l10n()->t('CC: email addresses'), - '$public' => DI::l10n()->t('Public post'), - '$jotnets' => $jotnets, - '$title' => $item['title'], - '$placeholdertitle' => DI::l10n()->t('Set title'), - '$category' => Post\Category::getCSVByURIId($item['uri-id'], DI::userSession()->getLocalUserId(), Post\Category::CATEGORY), - '$placeholdercategory' => (Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''), - '$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'), - '$lockstate' => $lockstate, - '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), - '$bang' => ($lockstate === 'lock' ? '!' : ''), - '$profile_uid' => $_SESSION['uid'], - '$preview' => DI::l10n()->t('Preview'), - '$jotplugins' => $jotplugins, - '$cancel' => DI::l10n()->t('Cancel'), - '$rand_num' => Crypto::randomDigits(12), - - // Formatting button labels - '$edbold' => DI::l10n()->t('Bold'), - '$editalic' => DI::l10n()->t('Italic'), - '$eduline' => DI::l10n()->t('Underline'), - '$edquote' => DI::l10n()->t('Quote'), - '$edcode' => DI::l10n()->t('Code'), - '$edurl' => DI::l10n()->t('Link'), - '$edattach' => DI::l10n()->t('Link or Media'), - - //jot nav tab (used in some themes) - '$message' => DI::l10n()->t('Message'), - '$browser' => DI::l10n()->t('Browser'), - '$shortpermset' => DI::l10n()->t('Permissions'), - - '$compose_link_title' => DI::l10n()->t('Open Compose page'), - ]); - - return $o; -} - -function undo_post_tagging($s) { - $matches = null; - $cnt = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism', $s, $matches, PREG_SET_ORDER); - if ($cnt) { - foreach ($matches as $mtch) { - if (in_array($mtch[1], ['!', '@'])) { - $contact = Contact::getByURL($mtch[2], false, ['addr']); - $mtch[3] = empty($contact['addr']) ? $mtch[2] : $contact['addr']; - } - $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s); - } - } - return $s; -} diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php new file mode 100644 index 000000000..5531cb249 --- /dev/null +++ b/src/Module/Post/Edit.php @@ -0,0 +1,228 @@ +. + * + */ + +namespace Friendica\Module\Post; + +use Friendica\App; +use Friendica\BaseModule; +use Friendica\Content\Feature; +use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\Renderer; +use Friendica\Core\Session\Capability\IHandleUserSessions; +use Friendica\Model\Contact; +use Friendica\Model\Post; +use Friendica\Model\User; +use Friendica\Module\Response; +use Friendica\Navigation\SystemMessages; +use Friendica\Network\HTTPException; +use Friendica\Util\Crypto; +use Friendica\Util\Profiler; +use Psr\Log\LoggerInterface; + +/** + * Controller to edit a post + */ +class Edit extends BaseModule +{ + /** @var IHandleUserSessions */ + protected $session; + /** @var SystemMessages */ + protected $sysMessages; + /** @var App\Page */ + protected $page; + /** @var App\Mode */ + protected $mode; + /** @var App */ + protected $app; + /** @var bool */ + protected $isModal = false; + + public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, App\Page $page, App\Mode $mode, App $app, array $server, array $parameters = []) + { + parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); + + $this->session = $session; + $this->sysMessages = $sysMessages; + $this->page = $page; + $this->mode = $mode; + $this->app = $app; + } + + + protected function content(array $request = []): string + { + $this->isModal = $request['mode'] ?? '' === 'none'; + + if (!$this->session->getLocalUserId()) { + $this->errorExit($this->t('Permission denied.'), HTTPException\UnauthorizedException::class); + } + + $postId = $this->parameters['post_id']; + + if (empty($postId)) { + $this->errorExit($this->t('Post not found.'), HTTPException\BadRequestException::class); + } + + $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', + 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid']; + + $item = Post::selectFirstForUser($this->session->getLocalUserId(), $fields, [ + 'id' => $postId, + 'uid' => $this->session->getLocalUserId(), + ]); + + if (empty($item)) { + $this->errorExit($this->t('Post not found.'), HTTPException\BadRequestException::class); + } + + $user = User::getById($this->session->getLocalUserId()); + $geoTag = ''; + + $output = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [ + '$title' => $this->t('Edit post'), + ]); + + $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('jot-header.tpl'), [ + '$ispublic' => ' ', // $this->t('Visible to everybody'), + '$geotag' => $geoTag, + '$nickname' => $this->app->getLoggedInUserNickname(), + '$is_mobile' => $this->mode->isMobile(), + ]); + + if (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) { + $lockstate = 'lock'; + } else { + $lockstate = 'unlock'; + } + + $jotplugins = ''; + $jotnets = ''; + + Hook::callAll('jot_tool', $jotplugins); + + $output .= Renderer::replaceMacros(Renderer::getMarkupTemplate('jot.tpl'), [ + '$is_edit' => true, + '$return_path' => '/display/' . $item['guid'], + '$action' => 'item', + '$share' => $this->t('Save'), + '$loading' => $this->t('Loading...'), + '$upload' => $this->t('Upload photo'), + '$shortupload' => $this->t('upload photo'), + '$attach' => $this->t('Attach file'), + '$shortattach' => $this->t('attach file'), + '$weblink' => $this->t('Insert web link'), + '$shortweblink' => $this->t('web link'), + '$video' => $this->t('Insert video link'), + '$shortvideo' => $this->t('video link'), + '$audio' => $this->t('Insert audio link'), + '$shortaudio' => $this->t('audio link'), + '$setloc' => $this->t('Set your location'), + '$shortsetloc' => $this->t('set location'), + '$noloc' => $this->t('Clear browser location'), + '$shortnoloc' => $this->t('clear location'), + '$wait' => $this->t('Please wait'), + '$permset' => $this->t('Permission settings'), + '$wall' => $item['wall'], + '$posttype' => $item['post-type'], + '$content' => $this->undoPostTagging($item['body']), + '$post_id' => $postId, + '$defloc' => $user['default-location'], + '$visitor' => 'none', + '$pvisit' => 'none', + '$emailcc' => $this->t('CC: email addresses'), + '$public' => $this->t('Public post'), + '$jotnets' => $jotnets, + '$title' => $item['title'], + '$placeholdertitle' => $this->t('Set title'), + '$category' => Post\Category::getCSVByURIId($item['uri-id'], $this->session->getLocalUserId(), Post\Category::CATEGORY), + '$placeholdercategory' => (Feature::isEnabled($this->session->getLocalUserId(), 'categories') ? $this->t("Categories \x28comma-separated list\x29") : ''), + '$emtitle' => $this->t('Example: bob@example.com, mary@example.com'), + '$lockstate' => $lockstate, + '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), + '$bang' => ($lockstate === 'lock' ? '!' : ''), + '$profile_uid' => $_SESSION['uid'], + '$preview' => $this->t('Preview'), + '$jotplugins' => $jotplugins, + '$cancel' => $this->t('Cancel'), + '$rand_num' => Crypto::randomDigits(12), + + // Formatting button labels + '$edbold' => $this->t('Bold'), + '$editalic' => $this->t('Italic'), + '$eduline' => $this->t('Underline'), + '$edquote' => $this->t('Quote'), + '$edcode' => $this->t('Code'), + '$edurl' => $this->t('Link'), + '$edattach' => $this->t('Link or Media'), + + //jot nav tab (used in some themes) + '$message' => $this->t('Message'), + '$browser' => $this->t('Browser'), + '$shortpermset' => $this->t('Permissions'), + + '$compose_link_title' => $this->t('Open Compose page'), + ]); + + return $output; + } + + /** + * Removes Tags from the item-body + * + * @param string $body The item body + * + * @return string the new item body without tagging + */ + protected function undoPostTagging(string $body) + { + $matches = null; + $content = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism', $body, $matches, PREG_SET_ORDER); + if ($content) { + foreach ($matches as $match) { + if (in_array($match[1], ['!', '@'])) { + $contact = Contact::getByURL($match[2], false, ['addr']); + $match[3] = empty($contact['addr']) ? $match[2] : $contact['addr']; + } + $body = str_replace($match[0], $match[1] . $match[3], $body); + } + } + return $body; + } + + /** + * Exists the current Module because of an error + * + * @param string $message The error message + * @param string $exceptionClass In case it's a modal, throw an exception instead of an redirect + * + * @return void + */ + protected function errorExit(string $message, string $exceptionClass) + { + if ($this->isModal) { + throw new $exceptionClass($message); + } else { + $this->sysMessages->addNotice($message); + $this->baseUrl->redirect(); + } + } +} diff --git a/src/Object/Post.php b/src/Object/Post.php index 87951c19c..8b8463f85 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -220,7 +220,7 @@ class Post if ($item['event-id'] != 0) { $edpost = ['calendar/event/edit/' . $item['event-id'], DI::l10n()->t('Edit')]; } else { - $edpost = ['editpost/' . $item['id'], DI::l10n()->t('Edit')]; + $edpost = [sprintf('post/%s/edit', $item['id']), DI::l10n()->t('Edit')]; } } $dropping = in_array($item['uid'], [0, DI::userSession()->getLocalUserId()]); diff --git a/static/routes.config.php b/static/routes.config.php index 7a86d8d03..5f5c238e0 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -552,6 +552,7 @@ return [ '/ping' => [Module\Notifications\Ping::class, [R::GET]], '/post' => [ + '/{post_id}/edit' => [Module\Post\Edit::class, [R::GET ]], '/{post_id}/share' => [Module\Post\Share::class, [R::GET ]], '/{item_id}/tag/add' => [Module\Post\Tag\Add::class, [ R::POST]], '/{item_id}/tag/remove[/{tag_name}]' => [Module\Post\Tag\Remove::class, [R::GET, R::POST]], From 01c2a775e4515f0cd51f654369d15a7f7b17c2d4 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Nov 2022 22:34:31 +0100 Subject: [PATCH 2/9] Update messages.po --- view/lang/C/messages.po | 467 ++++++++++++++++++++-------------------- 1 file changed, 236 insertions(+), 231 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 059e79bd8..261a3bd36 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-15 00:00+0000\n" +"POT-Creation-Date: 2022-11-15 21:34+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,9 +18,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" -#: mod/editpost.php:38 mod/item.php:181 mod/item.php:186 mod/item.php:870 -#: mod/message.php:69 mod/message.php:114 mod/notes.php:44 mod/photos.php:159 -#: mod/photos.php:886 src/Module/Attach.php:56 src/Module/BaseApi.php:94 +#: mod/fbrowser.php:61 src/Content/Nav.php:195 src/Module/BaseProfile.php:64 +#: view/theme/frio/theme.php:239 +msgid "Photos" +msgstr "" + +#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:999 +#: mod/photos.php:1100 src/Content/Conversation.php:389 +#: src/Module/Contact/Follow.php:171 src/Module/Contact/Revoke.php:109 +#: src/Module/Contact/Unfollow.php:126 src/Module/Post/Edit.php:165 +#: src/Module/Post/Tag/Remove.php:109 src/Module/Profile/RemoteFollow.php:134 +#: src/Module/Security/TwoFactor/SignOut.php:125 +msgid "Cancel" +msgstr "" + +#: mod/fbrowser.php:121 mod/fbrowser.php:148 +#: src/Module/Settings/Profile/Photo/Index.php:128 +msgid "Upload" +msgstr "" + +#: mod/fbrowser.php:143 +msgid "Files" +msgstr "" + +#: mod/item.php:131 mod/item.php:135 +msgid "Unable to locate original post." +msgstr "" + +#: mod/item.php:181 mod/item.php:186 mod/item.php:870 mod/message.php:69 +#: mod/message.php:114 mod/notes.php:44 mod/photos.php:159 mod/photos.php:886 +#: src/Module/Attach.php:56 src/Module/BaseApi.php:94 #: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52 #: src/Module/Calendar/Event/API.php:88 src/Module/Calendar/Event/Form.php:84 #: src/Module/Calendar/Event/Show.php:54 src/Module/Calendar/Export.php:62 @@ -35,16 +62,17 @@ msgstr "" #: src/Module/Notifications/Notification.php:76 #: src/Module/Notifications/Notification.php:107 #: src/Module/OStatus/Repair.php:60 src/Module/OStatus/Subscribe.php:66 -#: src/Module/Profile/Attachment/Upload.php:97 src/Module/Profile/Common.php:55 -#: src/Module/Profile/Contacts.php:55 src/Module/Profile/Photos/Upload.php:108 -#: src/Module/Profile/Schedule.php:39 src/Module/Profile/Schedule.php:56 -#: src/Module/Profile/UnkMail.php:69 src/Module/Profile/UnkMail.php:121 -#: src/Module/Profile/UnkMail.php:132 src/Module/Register.php:77 -#: src/Module/Register.php:90 src/Module/Register.php:206 -#: src/Module/Register.php:245 src/Module/Search/Directory.php:37 -#: src/Module/Settings/Account.php:50 src/Module/Settings/Account.php:407 -#: 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/Post/Edit.php:76 src/Module/Profile/Attachment/Upload.php:97 +#: src/Module/Profile/Common.php:55 src/Module/Profile/Contacts.php:55 +#: src/Module/Profile/Photos/Upload.php:108 src/Module/Profile/Schedule.php:39 +#: src/Module/Profile/Schedule.php:56 src/Module/Profile/UnkMail.php:69 +#: src/Module/Profile/UnkMail.php:121 src/Module/Profile/UnkMail.php:132 +#: src/Module/Register.php:77 src/Module/Register.php:90 +#: src/Module/Register.php:206 src/Module/Register.php:245 +#: src/Module/Search/Directory.php:37 src/Module/Settings/Account.php:50 +#: src/Module/Settings/Account.php:407 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/Index.php:111 #: src/Module/Settings/RemoveMe.php:117 src/Module/Settings/UserExport.php:80 @@ -56,206 +84,6 @@ msgstr "" msgid "Permission denied." msgstr "" -#: mod/editpost.php:45 mod/editpost.php:55 -#: src/Module/Moderation/Item/Source.php:88 -msgid "Item not found" -msgstr "" - -#: mod/editpost.php:64 -msgid "Edit post" -msgstr "" - -#: mod/editpost.php:91 mod/notes.php:56 src/Content/Text/HTML.php:882 -#: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:74 -msgid "Save" -msgstr "" - -#: mod/editpost.php:92 mod/photos.php:1335 src/Content/Conversation.php:341 -#: src/Object/Post.php:987 -msgid "Loading..." -msgstr "" - -#: mod/editpost.php:93 mod/message.php:201 mod/message.php:357 -#: src/Content/Conversation.php:342 -msgid "Upload photo" -msgstr "" - -#: mod/editpost.php:94 src/Content/Conversation.php:343 -msgid "upload photo" -msgstr "" - -#: mod/editpost.php:95 src/Content/Conversation.php:344 -msgid "Attach file" -msgstr "" - -#: mod/editpost.php:96 src/Content/Conversation.php:345 -msgid "attach file" -msgstr "" - -#: mod/editpost.php:97 mod/message.php:202 mod/message.php:358 -#: src/Module/Profile/UnkMail.php:154 -msgid "Insert web link" -msgstr "" - -#: mod/editpost.php:98 -msgid "web link" -msgstr "" - -#: mod/editpost.php:99 -msgid "Insert video link" -msgstr "" - -#: mod/editpost.php:100 -msgid "video link" -msgstr "" - -#: mod/editpost.php:101 -msgid "Insert audio link" -msgstr "" - -#: mod/editpost.php:102 -msgid "audio link" -msgstr "" - -#: mod/editpost.php:103 src/Content/Conversation.php:355 -#: src/Module/Item/Compose.php:200 -msgid "Set your location" -msgstr "" - -#: mod/editpost.php:104 src/Content/Conversation.php:356 -msgid "set location" -msgstr "" - -#: mod/editpost.php:105 src/Content/Conversation.php:357 -msgid "Clear browser location" -msgstr "" - -#: mod/editpost.php:106 src/Content/Conversation.php:358 -msgid "clear location" -msgstr "" - -#: mod/editpost.php:107 mod/message.php:203 mod/message.php:360 -#: mod/photos.php:1486 src/Content/Conversation.php:371 -#: src/Content/Conversation.php:717 src/Module/Item/Compose.php:204 -#: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 -msgid "Please wait" -msgstr "" - -#: mod/editpost.php:108 src/Content/Conversation.php:372 -msgid "Permission settings" -msgstr "" - -#: mod/editpost.php:116 src/Core/ACL.php:326 -msgid "CC: email addresses" -msgstr "" - -#: mod/editpost.php:117 src/Content/Conversation.php:382 -msgid "Public post" -msgstr "" - -#: mod/editpost.php:120 src/Content/Conversation.php:360 -#: src/Module/Item/Compose.php:205 -msgid "Set title" -msgstr "" - -#: mod/editpost.php:122 src/Content/Conversation.php:362 -#: src/Module/Item/Compose.php:206 -msgid "Categories (comma-separated list)" -msgstr "" - -#: mod/editpost.php:123 src/Core/ACL.php:327 -msgid "Example: bob@example.com, mary@example.com" -msgstr "" - -#: mod/editpost.php:128 mod/photos.php:1334 mod/photos.php:1390 -#: mod/photos.php:1464 src/Content/Conversation.php:386 -#: src/Module/Calendar/Event/Form.php:248 src/Module/Item/Compose.php:199 -#: src/Object/Post.php:997 -msgid "Preview" -msgstr "" - -#: mod/editpost.php:130 mod/fbrowser.php:119 mod/fbrowser.php:146 -#: mod/photos.php:999 mod/photos.php:1100 src/Content/Conversation.php:389 -#: src/Module/Contact/Follow.php:171 src/Module/Contact/Revoke.php:109 -#: src/Module/Contact/Unfollow.php:126 src/Module/Post/Tag/Remove.php:109 -#: src/Module/Profile/RemoteFollow.php:134 -#: src/Module/Security/TwoFactor/SignOut.php:125 -msgid "Cancel" -msgstr "" - -#: mod/editpost.php:134 src/Content/Conversation.php:346 -#: src/Module/Item/Compose.php:190 src/Object/Post.php:988 -msgid "Bold" -msgstr "" - -#: mod/editpost.php:135 src/Content/Conversation.php:347 -#: src/Module/Item/Compose.php:191 src/Object/Post.php:989 -msgid "Italic" -msgstr "" - -#: mod/editpost.php:136 src/Content/Conversation.php:348 -#: src/Module/Item/Compose.php:192 src/Object/Post.php:990 -msgid "Underline" -msgstr "" - -#: mod/editpost.php:137 src/Content/Conversation.php:349 -#: src/Module/Item/Compose.php:193 src/Object/Post.php:991 -msgid "Quote" -msgstr "" - -#: mod/editpost.php:138 src/Content/Conversation.php:350 -#: src/Module/Item/Compose.php:194 src/Object/Post.php:992 -msgid "Code" -msgstr "" - -#: mod/editpost.php:139 src/Content/Conversation.php:352 -#: src/Module/Item/Compose.php:196 src/Object/Post.php:994 -msgid "Link" -msgstr "" - -#: mod/editpost.php:140 src/Content/Conversation.php:353 -#: src/Module/Item/Compose.php:197 src/Object/Post.php:995 -msgid "Link or Media" -msgstr "" - -#: mod/editpost.php:143 src/Content/Conversation.php:396 -#: src/Content/Widget/VCard.php:113 src/Model/Profile.php:465 -#: src/Module/Admin/Logs/View.php:93 -msgid "Message" -msgstr "" - -#: mod/editpost.php:144 src/Content/Conversation.php:397 -#: src/Module/Settings/TwoFactor/Trusted.php:139 -msgid "Browser" -msgstr "" - -#: mod/editpost.php:145 mod/photos.php:934 mod/photos.php:1288 -#: src/Content/Conversation.php:373 src/Module/Calendar/Event/Form.php:253 -msgid "Permissions" -msgstr "" - -#: mod/editpost.php:147 src/Content/Conversation.php:399 -msgid "Open Compose page" -msgstr "" - -#: mod/fbrowser.php:61 src/Content/Nav.php:195 src/Module/BaseProfile.php:64 -#: view/theme/frio/theme.php:239 -msgid "Photos" -msgstr "" - -#: mod/fbrowser.php:121 mod/fbrowser.php:148 -#: src/Module/Settings/Profile/Photo/Index.php:128 -msgid "Upload" -msgstr "" - -#: mod/fbrowser.php:143 -msgid "Files" -msgstr "" - -#: mod/item.php:131 mod/item.php:135 -msgid "Unable to locate original post." -msgstr "" - #: mod/item.php:337 mod/item.php:342 msgid "Empty post discarded." msgstr "" @@ -274,7 +102,7 @@ msgstr "" #: mod/item.php:846 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 -#: src/Module/Debug/ItemBody.php:57 src/Module/Item/Feed.php:81 +#: src/Module/Debug/ItemBody.php:57 src/Module/Item/Feed.php:80 msgid "Item not found." msgstr "" @@ -478,6 +306,23 @@ msgstr "" msgid "Your message:" msgstr "" +#: mod/message.php:201 mod/message.php:357 src/Content/Conversation.php:342 +#: src/Module/Post/Edit.php:128 +msgid "Upload photo" +msgstr "" + +#: mod/message.php:202 mod/message.php:358 src/Module/Post/Edit.php:132 +#: src/Module/Profile/UnkMail.php:154 +msgid "Insert web link" +msgstr "" + +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1486 +#: src/Content/Conversation.php:371 src/Content/Conversation.php:717 +#: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 +#: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 +msgid "Please wait" +msgstr "" + #: mod/message.php:204 mod/message.php:359 mod/photos.php:916 #: mod/photos.php:1020 mod/photos.php:1292 mod/photos.php:1333 #: mod/photos.php:1389 mod/photos.php:1463 @@ -557,6 +402,12 @@ msgstr "" msgid "Personal notes are visible only by yourself." msgstr "" +#: mod/notes.php:56 src/Content/Text/HTML.php:882 +#: src/Module/Admin/Storage.php:142 src/Module/Filer/SaveTag.php:74 +#: src/Module/Post/Edit.php:126 +msgid "Save" +msgstr "" + #: mod/photos.php:68 mod/photos.php:139 mod/photos.php:793 #: src/Model/Event.php:514 src/Model/Profile.php:234 #: src/Module/Calendar/Export.php:67 src/Module/Feed.php:72 @@ -679,6 +530,11 @@ msgstr "" msgid "Do not show a status post for this upload" msgstr "" +#: mod/photos.php:934 mod/photos.php:1288 src/Content/Conversation.php:373 +#: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:180 +msgid "Permissions" +msgstr "" + #: mod/photos.php:997 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" @@ -794,6 +650,18 @@ msgstr "" msgid "Comment" msgstr "" +#: mod/photos.php:1334 mod/photos.php:1390 mod/photos.php:1464 +#: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 +#: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:163 +#: src/Object/Post.php:997 +msgid "Preview" +msgstr "" + +#: mod/photos.php:1335 src/Content/Conversation.php:341 +#: src/Module/Post/Edit.php:127 src/Object/Post.php:987 +msgid "Loading..." +msgstr "" + #: mod/photos.php:1421 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" @@ -1347,19 +1215,116 @@ msgstr "" msgid "Share" msgstr "" +#: src/Content/Conversation.php:343 src/Module/Post/Edit.php:129 +msgid "upload photo" +msgstr "" + +#: src/Content/Conversation.php:344 src/Module/Post/Edit.php:130 +msgid "Attach file" +msgstr "" + +#: src/Content/Conversation.php:345 src/Module/Post/Edit.php:131 +msgid "attach file" +msgstr "" + +#: src/Content/Conversation.php:346 src/Module/Item/Compose.php:190 +#: src/Module/Post/Edit.php:169 src/Object/Post.php:988 +msgid "Bold" +msgstr "" + +#: src/Content/Conversation.php:347 src/Module/Item/Compose.php:191 +#: src/Module/Post/Edit.php:170 src/Object/Post.php:989 +msgid "Italic" +msgstr "" + +#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:192 +#: src/Module/Post/Edit.php:171 src/Object/Post.php:990 +msgid "Underline" +msgstr "" + +#: src/Content/Conversation.php:349 src/Module/Item/Compose.php:193 +#: src/Module/Post/Edit.php:172 src/Object/Post.php:991 +msgid "Quote" +msgstr "" + +#: src/Content/Conversation.php:350 src/Module/Item/Compose.php:194 +#: src/Module/Post/Edit.php:173 src/Object/Post.php:992 +msgid "Code" +msgstr "" + #: src/Content/Conversation.php:351 src/Module/Item/Compose.php:195 #: src/Object/Post.php:993 msgid "Image" msgstr "" +#: src/Content/Conversation.php:352 src/Module/Item/Compose.php:196 +#: src/Module/Post/Edit.php:174 src/Object/Post.php:994 +msgid "Link" +msgstr "" + +#: src/Content/Conversation.php:353 src/Module/Item/Compose.php:197 +#: src/Module/Post/Edit.php:175 src/Object/Post.php:995 +msgid "Link or Media" +msgstr "" + #: src/Content/Conversation.php:354 msgid "Video" msgstr "" +#: src/Content/Conversation.php:355 src/Module/Item/Compose.php:200 +#: src/Module/Post/Edit.php:138 +msgid "Set your location" +msgstr "" + +#: src/Content/Conversation.php:356 src/Module/Post/Edit.php:139 +msgid "set location" +msgstr "" + +#: src/Content/Conversation.php:357 src/Module/Post/Edit.php:140 +msgid "Clear browser location" +msgstr "" + +#: src/Content/Conversation.php:358 src/Module/Post/Edit.php:141 +msgid "clear location" +msgstr "" + +#: src/Content/Conversation.php:360 src/Module/Item/Compose.php:205 +#: src/Module/Post/Edit.php:155 +msgid "Set title" +msgstr "" + +#: src/Content/Conversation.php:362 src/Module/Item/Compose.php:206 +#: src/Module/Post/Edit.php:157 +msgid "Categories (comma-separated list)" +msgstr "" + #: src/Content/Conversation.php:367 src/Module/Item/Compose.php:222 msgid "Scheduled at" msgstr "" +#: src/Content/Conversation.php:372 src/Module/Post/Edit.php:143 +msgid "Permission settings" +msgstr "" + +#: src/Content/Conversation.php:382 src/Module/Post/Edit.php:152 +msgid "Public post" +msgstr "" + +#: src/Content/Conversation.php:396 src/Content/Widget/VCard.php:113 +#: src/Model/Profile.php:465 src/Module/Admin/Logs/View.php:93 +#: src/Module/Post/Edit.php:178 +msgid "Message" +msgstr "" + +#: src/Content/Conversation.php:397 src/Module/Post/Edit.php:179 +#: src/Module/Settings/TwoFactor/Trusted.php:139 +msgid "Browser" +msgstr "" + +#: src/Content/Conversation.php:399 src/Module/Post/Edit.php:182 +msgid "Open Compose page" +msgstr "" + #: src/Content/Conversation.php:661 src/Object/Post.php:243 msgid "Pinned item" msgstr "" @@ -1985,8 +1950,8 @@ msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1245 src/Model/Item.php:3486 -#: src/Model/Item.php:3492 src/Model/Item.php:3493 +#: src/Content/Text/BBCode.php:1245 src/Model/Item.php:3493 +#: src/Model/Item.php:3499 src/Model/Item.php:3500 msgid "Link to source" msgstr "" @@ -2277,6 +2242,14 @@ msgstr "" msgid "Except to:" msgstr "" +#: src/Core/ACL.php:326 src/Module/Post/Edit.php:151 +msgid "CC: email addresses" +msgstr "" + +#: src/Core/ACL.php:327 src/Module/Post/Edit.php:158 +msgid "Example: bob@example.com, mary@example.com" +msgstr "" + #: src/Core/ACL.php:328 msgid "Connectors" msgstr "" @@ -3037,7 +3010,7 @@ msgstr "" msgid "No events to display" msgstr "" -#: src/Model/Event.php:525 src/Module/Item/Display.php:221 +#: src/Model/Event.php:525 src/Module/Item/Display.php:224 #: src/Module/Profile/Profile.php:93 src/Module/Profile/Profile.php:108 #: src/Module/Profile/Status.php:109 src/Module/Update/Profile.php:55 msgid "Access to this profile has been restricted." @@ -3159,44 +3132,44 @@ msgstr "" msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3398 +#: src/Model/Item.php:3405 msgid "bytes" msgstr "" -#: src/Model/Item.php:3429 +#: src/Model/Item.php:3436 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3431 +#: src/Model/Item.php:3438 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3436 +#: src/Model/Item.php:3443 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3438 +#: src/Model/Item.php:3445 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3440 +#: src/Model/Item.php:3447 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3474 src/Model/Item.php:3475 +#: src/Model/Item.php:3481 src/Model/Item.php:3482 msgid "View on separate page" msgstr "" @@ -5854,10 +5827,10 @@ msgstr[1] "" #: src/Module/Contact/Follow.php:69 src/Module/Contact/Redir.php:62 #: src/Module/Contact/Redir.php:222 src/Module/Conversation/Community.php:193 #: src/Module/Debug/ItemBody.php:38 src/Module/Diaspora/Receive.php:57 -#: src/Module/Item/Display.php:93 src/Module/Item/Feed.php:60 +#: src/Module/Item/Display.php:95 src/Module/Item/Feed.php:59 #: src/Module/Item/Follow.php:41 src/Module/Item/Ignore.php:41 #: src/Module/Item/Pin.php:41 src/Module/Item/Pin.php:56 -#: src/Module/Item/Star.php:42 src/Module/Update/Display.php:38 +#: src/Module/Item/Star.php:42 src/Module/Update/Display.php:37 msgid "Access denied." msgstr "" @@ -7116,12 +7089,12 @@ msgid "" "Theme Customization settings." msgstr "" -#: src/Module/Item/Display.php:133 src/Module/Item/Display.php:247 -#: src/Module/Update/Display.php:56 +#: src/Module/Item/Display.php:135 src/Module/Item/Display.php:252 +#: src/Module/Update/Display.php:55 msgid "The requested item doesn't exist or has been deleted." msgstr "" -#: src/Module/Item/Feed.php:87 +#: src/Module/Item/Feed.php:86 msgid "The feed for this item is unavailable." msgstr "" @@ -7600,6 +7573,10 @@ msgstr "" msgid "Implicit Mention" msgstr "" +#: src/Module/Moderation/Item/Source.php:88 +msgid "Item not found" +msgstr "" + #: src/Module/Moderation/Item/Source.php:89 msgid "No source recorded" msgstr "" @@ -8104,6 +8081,34 @@ msgstr "" msgid "Invalid photo with id %s." msgstr "" +#: src/Module/Post/Edit.php:82 src/Module/Post/Edit.php:94 +msgid "Post not found." +msgstr "" + +#: src/Module/Post/Edit.php:101 +msgid "Edit post" +msgstr "" + +#: src/Module/Post/Edit.php:133 +msgid "web link" +msgstr "" + +#: src/Module/Post/Edit.php:134 +msgid "Insert video link" +msgstr "" + +#: src/Module/Post/Edit.php:135 +msgid "video link" +msgstr "" + +#: src/Module/Post/Edit.php:136 +msgid "Insert audio link" +msgstr "" + +#: src/Module/Post/Edit.php:137 +msgid "audio link" +msgstr "" + #: src/Module/Post/Tag/Remove.php:106 msgid "Remove Item Tag" msgstr "" @@ -10209,7 +10214,7 @@ msgstr "" msgid "Privacy Statement" msgstr "" -#: src/Module/Update/Display.php:46 +#: src/Module/Update/Display.php:45 msgid "Parameter uri_id is missing." msgstr "" From 09e01b93564bb80822af4acad7eecdfa280d1caf Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 15 Nov 2022 22:52:23 +0100 Subject: [PATCH 3/9] Replace $_SESSION --- src/Module/Post/Edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index 5531cb249..f89f73f0b 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -159,7 +159,7 @@ class Edit extends BaseModule '$lockstate' => $lockstate, '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), '$bang' => ($lockstate === 'lock' ? '!' : ''), - '$profile_uid' => $_SESSION['uid'], + '$profile_uid' => $this->session->getLocalUserId(), '$preview' => $this->t('Preview'), '$jotplugins' => $jotplugins, '$cancel' => $this->t('Cancel'), From db7af4c45ba6b1a42201c66335d14c89e53827bd Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 08:49:48 +0100 Subject: [PATCH 4/9] Remove jotnets --- src/Module/Post/Edit.php | 4 +--- view/theme/smoothly/templates/jot.tpl | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index f89f73f0b..ba6a73620 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -76,7 +76,7 @@ class Edit extends BaseModule $this->errorExit($this->t('Permission denied.'), HTTPException\UnauthorizedException::class); } - $postId = $this->parameters['post_id']; + $postId = $this->parameters['post_id'] ?? 0; if (empty($postId)) { $this->errorExit($this->t('Post not found.'), HTTPException\BadRequestException::class); @@ -115,7 +115,6 @@ class Edit extends BaseModule } $jotplugins = ''; - $jotnets = ''; Hook::callAll('jot_tool', $jotplugins); @@ -150,7 +149,6 @@ class Edit extends BaseModule '$pvisit' => 'none', '$emailcc' => $this->t('CC: email addresses'), '$public' => $this->t('Public post'), - '$jotnets' => $jotnets, '$title' => $item['title'], '$placeholdertitle' => $this->t('Set title'), '$category' => Post\Category::getCSVByURIId($item['uri-id'], $this->session->getLocalUserId(), Post\Category::CATEGORY), diff --git a/view/theme/smoothly/templates/jot.tpl b/view/theme/smoothly/templates/jot.tpl index 74c9d0523..86485cad1 100644 --- a/view/theme/smoothly/templates/jot.tpl +++ b/view/theme/smoothly/templates/jot.tpl @@ -70,7 +70,6 @@
{{$acl nofilter}} - {{$jotnets nofilter}} {{if $scheduled_at}}{{$scheduled_at nofilter}}{{/if}} {{if $created_at}}{{$created_at nofilter}}{{/if}}
From 5dc9319bb27dd2e7ecd83c0c904acfd9cb7f775d Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 08:50:57 +0100 Subject: [PATCH 5/9] Remove geotag --- src/Module/Post/Edit.php | 2 -- view/templates/jot-header.tpl | 2 -- view/theme/frio/templates/jot-header.tpl | 2 -- view/theme/smoothly/templates/jot-header.tpl | 3 --- 4 files changed, 9 deletions(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index ba6a73620..0f382aebf 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -95,7 +95,6 @@ class Edit extends BaseModule } $user = User::getById($this->session->getLocalUserId()); - $geoTag = ''; $output = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [ '$title' => $this->t('Edit post'), @@ -103,7 +102,6 @@ class Edit extends BaseModule $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('jot-header.tpl'), [ '$ispublic' => ' ', // $this->t('Visible to everybody'), - '$geotag' => $geoTag, '$nickname' => $this->app->getLoggedInUserNickname(), '$is_mobile' => $this->mode->isMobile(), ]); diff --git a/view/templates/jot-header.tpl b/view/templates/jot-header.tpl index a67f9c3f0..53d5c7288 100644 --- a/view/templates/jot-header.tpl +++ b/view/templates/jot-header.tpl @@ -236,7 +236,5 @@ function enableOnUser(){ $("#profile-jot-text").val(currentText + data); } - {{$geotag nofilter}} - diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index 25a02b9b6..d64799c9a 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -317,8 +317,6 @@ autosize.update($("#profile-jot-text")); } - {{$geotag nofilter}} - function jotShow() { var modal = $('#jot-modal').modal(); jotcache = $("#jot-sections"); diff --git a/view/theme/smoothly/templates/jot-header.tpl b/view/theme/smoothly/templates/jot-header.tpl index 69233b926..8a8f3db68 100644 --- a/view/theme/smoothly/templates/jot-header.tpl +++ b/view/theme/smoothly/templates/jot-header.tpl @@ -264,7 +264,4 @@ function enableOnUser(){ $("#profile-jot-text").val(currentText + data); } - - {{$geotag nofilter}} - From e7fd4a4cd19be78917d44239bce4653b8c437db1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 08:56:19 +0100 Subject: [PATCH 6/9] Remove legacy comments --- src/Module/Post/Edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index 0f382aebf..2b371ba9c 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -94,14 +94,14 @@ class Edit extends BaseModule $this->errorExit($this->t('Post not found.'), HTTPException\BadRequestException::class); } - $user = User::getById($this->session->getLocalUserId()); + $user = User::getById($this->session->getLocalUserId()); $output = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [ '$title' => $this->t('Edit post'), ]); $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('jot-header.tpl'), [ - '$ispublic' => ' ', // $this->t('Visible to everybody'), + '$ispublic' => ' ', '$nickname' => $this->app->getLoggedInUserNickname(), '$is_mobile' => $this->mode->isMobile(), ]); @@ -153,7 +153,7 @@ class Edit extends BaseModule '$placeholdercategory' => (Feature::isEnabled($this->session->getLocalUserId(), 'categories') ? $this->t("Categories \x28comma-separated list\x29") : ''), '$emtitle' => $this->t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, - '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)), + '$acl' => '', '$bang' => ($lockstate === 'lock' ? '!' : ''), '$profile_uid' => $this->session->getLocalUserId(), '$preview' => $this->t('Preview'), From 12fb897f54f8f11f9118d14286a003a3817eaaee Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 08:56:37 +0100 Subject: [PATCH 7/9] Adhere PHP-CS --- src/Module/Post/Edit.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index 2b371ba9c..ed5ce0062 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -162,18 +162,18 @@ class Edit extends BaseModule '$rand_num' => Crypto::randomDigits(12), // Formatting button labels - '$edbold' => $this->t('Bold'), - '$editalic' => $this->t('Italic'), - '$eduline' => $this->t('Underline'), - '$edquote' => $this->t('Quote'), - '$edcode' => $this->t('Code'), - '$edurl' => $this->t('Link'), - '$edattach' => $this->t('Link or Media'), + '$edbold' => $this->t('Bold'), + '$editalic' => $this->t('Italic'), + '$eduline' => $this->t('Underline'), + '$edquote' => $this->t('Quote'), + '$edcode' => $this->t('Code'), + '$edurl' => $this->t('Link'), + '$edattach' => $this->t('Link or Media'), //jot nav tab (used in some themes) - '$message' => $this->t('Message'), - '$browser' => $this->t('Browser'), - '$shortpermset' => $this->t('Permissions'), + '$message' => $this->t('Message'), + '$browser' => $this->t('Browser'), + '$shortpermset' => $this->t('Permissions'), '$compose_link_title' => $this->t('Open Compose page'), ]); From 96212795725e5155fea44b29d116c6dfd68c4b66 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 10:49:12 +0100 Subject: [PATCH 8/9] Make PHP-CS happy ... --- src/Module/Post/Edit.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index ed5ce0062..347c00725 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -82,8 +82,10 @@ class Edit extends BaseModule $this->errorExit($this->t('Post not found.'), HTTPException\BadRequestException::class); } - $fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', - 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid']; + $fields = [ + 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', + 'body', 'title', 'uri-id', 'wall', 'post-type', 'guid' + ]; $item = Post::selectFirstForUser($this->session->getLocalUserId(), $fields, [ 'id' => $postId, From 81b21c41311249cdb319c06f00cb837614338ec3 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 16 Nov 2022 21:20:24 +0100 Subject: [PATCH 9/9] Revert "Remove geotag" This reverts commit 5dc9319b --- src/Module/Post/Edit.php | 1 + view/templates/jot-header.tpl | 2 ++ view/theme/frio/templates/jot-header.tpl | 2 ++ view/theme/smoothly/templates/jot-header.tpl | 3 +++ 4 files changed, 8 insertions(+) diff --git a/src/Module/Post/Edit.php b/src/Module/Post/Edit.php index 347c00725..11c50ff13 100644 --- a/src/Module/Post/Edit.php +++ b/src/Module/Post/Edit.php @@ -104,6 +104,7 @@ class Edit extends BaseModule $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('jot-header.tpl'), [ '$ispublic' => ' ', + '$geotag' => '', '$nickname' => $this->app->getLoggedInUserNickname(), '$is_mobile' => $this->mode->isMobile(), ]); diff --git a/view/templates/jot-header.tpl b/view/templates/jot-header.tpl index 53d5c7288..a67f9c3f0 100644 --- a/view/templates/jot-header.tpl +++ b/view/templates/jot-header.tpl @@ -236,5 +236,7 @@ function enableOnUser(){ $("#profile-jot-text").val(currentText + data); } + {{$geotag nofilter}} + diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index d64799c9a..25a02b9b6 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -317,6 +317,8 @@ autosize.update($("#profile-jot-text")); } + {{$geotag nofilter}} + function jotShow() { var modal = $('#jot-modal').modal(); jotcache = $("#jot-sections"); diff --git a/view/theme/smoothly/templates/jot-header.tpl b/view/theme/smoothly/templates/jot-header.tpl index 8a8f3db68..69233b926 100644 --- a/view/theme/smoothly/templates/jot-header.tpl +++ b/view/theme/smoothly/templates/jot-header.tpl @@ -264,4 +264,7 @@ function enableOnUser(){ $("#profile-jot-text").val(currentText + data); } + + {{$geotag nofilter}} +