diff --git a/src/App/Page.php b/src/App/Page.php index 87493a67e4..ca83173184 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -356,6 +356,7 @@ class Page implements ArrayAccess $tpl = Renderer::getMarkupTemplate('footer.tpl'); $this->page['footer'] = Renderer::replaceMacros($tpl, [ '$footerScripts' => array_unique($this->footerScripts), + '$close' => $l10n->t('Close'), ]) . $this->page['footer']; } diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index f03dfa84be..2102b43a32 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1583,7 +1583,7 @@ class BBCode // Check for headers if ($simple_html == self::INTERNAL) { - //Ensure to always start with

if possible + //Ensure to always start with

if possible $heading_count = 0; for ($level = 6; $level > 0; $level--) { if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) { @@ -1591,7 +1591,7 @@ class BBCode } } if ($heading_count > 0) { - $heading = min($heading_count + 3, 6); + $heading = min($heading_count + 2, 6); for ($level = 6; $level > 0; $level--) { if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) { $text = preg_replace("(\[h$level\](.*?)\[\/h$level\])ism", "

$1

", $text); diff --git a/src/Module/BaseProfile.php b/src/Module/BaseProfile.php index 2fab793152..4a73408bc9 100644 --- a/src/Module/BaseProfile.php +++ b/src/Module/BaseProfile.php @@ -31,35 +31,35 @@ class BaseProfile extends BaseModule $tabs = [ [ - 'label' => DI::l10n()->t('Profile'), - 'url' => $baseProfileUrl . '/profile', - 'sel' => $current == 'profile' ? 'active' : '', - 'title' => DI::l10n()->t('Profile Details'), - 'id' => 'profile-tab', + 'label' => DI::l10n()->t('Profile'), + 'url' => $baseProfileUrl . '/profile', + 'sel' => $current == 'profile' ? 'active' : '', + 'title' => DI::l10n()->t('Profile Details'), + 'id' => 'profile-tab', 'accesskey' => 'r', ], [ - 'label' => DI::l10n()->t('Conversations'), - 'url' => $baseProfileUrl . '/conversations', - 'sel' => $current == 'status' ? 'active' : '', - 'title' => DI::l10n()->t('Conversations started'), - 'id' => 'status-tab', + 'label' => DI::l10n()->t('Conversations'), + 'url' => $baseProfileUrl . '/conversations', + 'sel' => $current == 'status' ? 'active' : '', + 'title' => DI::l10n()->t('Conversations started'), + 'id' => 'status-tab', 'accesskey' => 'm', ], [ - 'label' => DI::l10n()->t('Photos'), - 'url' => $baseProfileUrl . '/photos', - 'sel' => $current == 'photos' ? 'active' : '', - 'title' => DI::l10n()->t('Photo Albums'), - 'id' => 'photo-tab', + 'label' => DI::l10n()->t('Photos'), + 'url' => $baseProfileUrl . '/photos', + 'sel' => $current == 'photos' ? 'active' : '', + 'title' => DI::l10n()->t('Photo Albums'), + 'id' => 'photo-tab', 'accesskey' => 'h', ], [ - 'label' => DI::l10n()->t('Media'), - 'url' => $baseProfileUrl . '/media', - 'sel' => $current == 'media' ? 'active' : '', - 'title' => DI::l10n()->t('Media'), - 'id' => 'media-tab', + 'label' => DI::l10n()->t('Media'), + 'url' => $baseProfileUrl . '/media', + 'sel' => $current == 'media' ? 'active' : '', + 'title' => DI::l10n()->t('Media'), + 'id' => 'media-tab', 'accesskey' => 'd', ], ]; @@ -67,22 +67,22 @@ class BaseProfile extends BaseModule // the calendar link for the full-featured events calendar if ($is_owner) { $tabs[] = [ - 'label' => DI::l10n()->t('Calendar'), - 'url' => DI::baseUrl() . '/calendar', - 'sel' => $current == 'calendar' ? 'active' : '', - 'title' => DI::l10n()->t('Calendar'), - 'id' => 'calendar-tab', + 'label' => DI::l10n()->t('Calendar'), + 'url' => DI::baseUrl() . '/calendar', + 'sel' => $current == 'calendar' ? 'active' : '', + 'title' => DI::l10n()->t('Calendar'), + 'id' => 'calendar-tab', 'accesskey' => 'c', ]; } else { $owner = User::getByNickname($nickname, ['uid']); if(DI::userSession()->isAuthenticated() || $owner && Feature::isEnabled($owner['uid'], Feature::PUBLIC_CALENDAR)) { $tabs[] = [ - 'label' => DI::l10n()->t('Calendar'), - 'url' => DI::baseUrl() . '/calendar/show/' . $nickname, - 'sel' => $current == 'calendar' ? 'active' : '', - 'title' => DI::l10n()->t('Calendar'), - 'id' => 'calendar-tab', + 'label' => DI::l10n()->t('Calendar'), + 'url' => DI::baseUrl() . '/calendar/show/' . $nickname, + 'sel' => $current == 'calendar' ? 'active' : '', + 'title' => DI::l10n()->t('Calendar'), + 'id' => 'calendar-tab', 'accesskey' => 'c', ]; } @@ -90,30 +90,30 @@ class BaseProfile extends BaseModule if ($is_owner) { $tabs[] = [ - 'label' => DI::l10n()->t('Personal Notes'), - 'url' => DI::baseUrl() . '/notes', - 'sel' => $current == 'notes' ? 'active' : '', - 'title' => DI::l10n()->t('Only You Can See This'), - 'id' => 'notes-tab', + 'label' => DI::l10n()->t('Personal Notes'), + 'url' => DI::baseUrl() . '/notes', + 'sel' => $current == 'notes' ? 'active' : '', + 'title' => DI::l10n()->t('Only You Can See This'), + 'id' => 'notes-tab', 'accesskey' => 't', ]; $tabs[] = [ - 'label' => DI::l10n()->t('Scheduled Posts'), - 'url' => $baseProfileUrl . '/schedule', - 'sel' => $current == 'schedule' ? 'active' : '', - 'title' => DI::l10n()->t('Posts that are scheduled for publishing'), - 'id' => 'schedule-tab', + 'label' => DI::l10n()->t('Scheduled Posts'), + 'url' => $baseProfileUrl . '/schedule', + 'sel' => $current == 'schedule' ? 'active' : '', + 'title' => DI::l10n()->t('Posts that are scheduled for publishing'), + 'id' => 'schedule-tab', 'accesskey' => 'o', ]; } if (!$hide_friends) { $tabs[] = [ - 'label' => DI::l10n()->t('Contacts'), - 'url' => $baseProfileUrl . '/contacts', - 'sel' => $current == 'contacts' ? 'active' : '', - 'title' => DI::l10n()->t('Contacts'), - 'id' => 'viewcontacts-tab', + 'label' => DI::l10n()->t('Contacts'), + 'url' => $baseProfileUrl . '/contacts', + 'sel' => $current == 'contacts' ? 'active' : '', + 'title' => DI::l10n()->t('Contacts'), + 'id' => 'viewcontacts-tab', 'accesskey' => 'k', ]; } @@ -134,6 +134,6 @@ class BaseProfile extends BaseModule $tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]); + return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs'], '$more' => DI::l10n()->t('More')]); } } diff --git a/src/Module/Calendar/Show.php b/src/Module/Calendar/Show.php index 0a55f7ada7..9e9376d8bf 100644 --- a/src/Module/Calendar/Show.php +++ b/src/Module/Calendar/Show.php @@ -21,7 +21,6 @@ use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Theme; use Friendica\Model\Event; use Friendica\Model\Profile; -use Friendica\Model\User; use Friendica\Module\BaseProfile; use Friendica\Module\Response; use Friendica\Module\Security\Login; @@ -119,6 +118,8 @@ class Show extends BaseModule '$week' => $this->t('week'), '$day' => $this->t('day'), '$list' => $this->t('list'), + '$prev' => $this->t('prev'), + '$next' => $this->t('next'), ]); return $o; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index b352648df7..e998160845 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -387,7 +387,7 @@ class Contact extends BaseModule ]; $tabs_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - $tabs_html = Renderer::replaceMacros($tabs_tpl, ['$tabs' => $tabs]); + $tabs_html = Renderer::replaceMacros($tabs_tpl, ['$tabs' => $tabs, '$more' => DI::l10n()->t('More')]); switch ($rel) { case 'followers': @@ -534,7 +534,7 @@ class Contact extends BaseModule } $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - $tab_str = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); + $tab_str = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => DI::l10n()->t('More')]); return $tab_str; } diff --git a/src/Module/Conversation/Channel.php b/src/Module/Conversation/Channel.php index b711a58f4e..37d9b18985 100644 --- a/src/Module/Conversation/Channel.php +++ b/src/Module/Conversation/Channel.php @@ -95,7 +95,7 @@ class Channel extends Timeline $tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel')); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); + $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]); Nav::setSelected('channel'); @@ -163,7 +163,7 @@ class Channel extends Timeline throw new HTTPException\BadRequestException($this->l10n->t('Channel not available.')); } - $this->maxId = $request['last_created'] ?? $this->maxId; + $this->maxId = $request['last_created'] ?? $this->maxId; $this->minId = $request['first_created'] ?? $this->minId; } } diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php index 375c86ee61..84e2179fe3 100644 --- a/src/Module/Conversation/Community.php +++ b/src/Module/Conversation/Community.php @@ -74,10 +74,10 @@ class Community extends Timeline $t = Renderer::getMarkupTemplate("community.tpl"); $o = Renderer::replaceMacros($t, [ - '$content' => '', - '$header' => '', + '$content' => '', + '$header' => '', '$show_global_community_hint' => ($this->selectedTab == CommunityEntity::GLOBAL) && $this->config->get('system', 'show_global_community_hint'), - '$global_community_hint' => $this->l10n->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") + '$global_community_hint' => $this->l10n->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.") ]); if ($this->pConfig->get($this->session->getLocalUserId(), 'system', 'infinite_scroll')) { @@ -88,7 +88,7 @@ class Community extends Timeline if (!$this->raw) { $tabs = $this->getTabArray($this->community->getTimelines($this->session->isAuthenticated()), 'community'); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); + $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]); Nav::setSelected('community'); @@ -185,7 +185,7 @@ class Community extends Timeline } } - $this->maxId = $request['last_received'] ?? $this->maxId; + $this->maxId = $request['last_received'] ?? $this->maxId; $this->minId = $request['first_received'] ?? $this->minId; } } diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index bf8b0614a9..86c2fcf736 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -192,9 +192,9 @@ class Network extends Timeline $x = [ 'lockstate' => $this->circleId || $this->network || ACL::getLockstateForUserId($this->session->getLocalUserId()) ? 'lock' : 'unlock', - 'acl' => ACL::getFullSelectorHTML($this->page, $this->session->getLocalUserId(), true, $default_permissions), - 'bang' => (($this->circleId || $this->network) ? '!' : ''), - 'content' => '', + 'acl' => ACL::getFullSelectorHTML($this->page, $this->session->getLocalUserId(), true, $default_permissions), + 'bang' => (($this->circleId || $this->network) ? '!' : ''), + 'content' => '', ]; $o .= $this->conversation->statusEditor($x); @@ -236,7 +236,7 @@ class Network extends Timeline $pager = new BoundariesPager( $this->l10n, $this->args->getQueryString(), - $items[0][$this->order] ?? null, + $items[0][$this->order] ?? null, $items[count($items) - 1][$this->order] ?? null, $this->itemsPerPage ); @@ -292,7 +292,7 @@ class Network extends Timeline $tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - return Renderer::replaceMacros($tpl, ['$tabs' => $tabs]); + return Renderer::replaceMacros($tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]); } protected function parseRequest(array $request) @@ -313,23 +313,23 @@ class Network extends Timeline if (!empty($request['star'])) { $this->selectedTab = NetworkEntity::STAR; - $this->star = true; + $this->star = true; } else { $this->star = $this->selectedTab == NetworkEntity::STAR; } if (!empty($request['mention'])) { $this->selectedTab = NetworkEntity::MENTION; - $this->mention = true; + $this->mention = true; } else { $this->mention = $this->selectedTab == NetworkEntity::MENTION; } if (!empty($request['order'])) { $this->selectedTab = $request['order']; - $this->order = $request['order']; - $this->star = false; - $this->mention = false; + $this->order = $request['order']; + $this->star = false; + $this->mention = false; } elseif (in_array($this->selectedTab, [NetworkEntity::RECEIVED, NetworkEntity::STAR]) || $this->community->isTimeline($this->selectedTab)) { $this->order = 'received'; } elseif (($this->selectedTab == NetworkEntity::CREATED) || $this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) { @@ -344,7 +344,8 @@ class Network extends Timeline // since otherwise the feed will optically jump, when some already visible thread has been updated. if ($this->update && ($this->selectedTab == NetworkEntity::COMMENTED)) { $this->order = 'received'; - $request['last_received'] = $request['last_commented'] ?? null; + + $request['last_received'] = $request['last_commented'] ?? null; $request['first_received'] = $request['first_commented'] ?? null; } @@ -361,7 +362,7 @@ class Network extends Timeline $this->network = $request['nets'] ?? ''; $this->dateFrom = $this->parameters['from'] ?? ''; - $this->dateTo = $this->parameters['to'] ?? ''; + $this->dateTo = $this->parameters['to'] ?? ''; $this->setMaxMinByOrder($request); diff --git a/src/Module/Moderation/BaseUsers.php b/src/Module/Moderation/BaseUsers.php index 0123ce5bc8..fcf4b4aa16 100644 --- a/src/Module/Moderation/BaseUsers.php +++ b/src/Module/Moderation/BaseUsers.php @@ -99,7 +99,7 @@ abstract class BaseUsers extends BaseModeration Hook::callAll('moderation_users_tabs', $tabs_arr); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); - return Renderer::replaceMacros($tpl, ['$tabs' => $tabs_arr['tabs']]); + return Renderer::replaceMacros($tpl, ['$tabs' => $tabs_arr['tabs'], '$more' => $this->t('More')]); } protected function setupUserCallback(): \Closure diff --git a/src/Object/Post.php b/src/Object/Post.php index aafe1b305b..363ad5e7a9 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -498,8 +498,10 @@ class Post } $languages = []; + $language = ''; if (!empty($item['language'])) { $languages = DI::l10n()->t('Languages'); + $language = array_key_first(json_decode($item['language'], true)); } if (in_array($item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($item['network'], Protocol::FEDERATED)) { @@ -579,6 +581,7 @@ class Post 'tagger' => $tagger, 'filer' => $filer, 'language' => $languages, + 'lang' => $language, 'searchtext' => DI::l10n()->t('Search Text'), 'drop' => $drop, 'block' => $block, diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 6d6c610762..9c61e10887 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -32,7 +32,7 @@ class BBCodeTest extends FixtureTestCase $config->set('HTML.Doctype', 'HTML5'); $config->set('Attr.AllowedRel', [ 'noreferrer' => true, - 'noopener' => true, + 'noopener' => true, ]); $config->set('Attr.AllowedFrameTargets', [ '_blank' => true, @@ -46,77 +46,77 @@ class BBCodeTest extends FixtureTestCase return [ /** @see https://github.com/friendica/friendica/issues/2487 */ 'bug-2487-1' => [ - 'data' => 'https://de.wikipedia.org/wiki/Juha_Sipilä', + 'data' => 'https://de.wikipedia.org/wiki/Juha_Sipilä', 'assertHTML' => true, ], 'bug-2487-2' => [ - 'data' => 'https://de.wikipedia.org/wiki/Dnepr_(Motorradmarke)', + 'data' => 'https://de.wikipedia.org/wiki/Dnepr_(Motorradmarke)', 'assertHTML' => true, ], 'bug-2487-3' => [ - 'data' => 'https://friendica.wäckerlin.ch/friendica', + 'data' => 'https://friendica.wäckerlin.ch/friendica', 'assertHTML' => true, ], 'bug-2487-4' => [ - 'data' => 'https://mastodon.social/@morevnaproject', + 'data' => 'https://mastodon.social/@morevnaproject', 'assertHTML' => true, ], /** @see https://github.com/friendica/friendica/issues/5795 */ 'bug-5795' => [ - 'data' => 'https://social.nasqueron.org/@liw/100798039015010628', + 'data' => 'https://social.nasqueron.org/@liw/100798039015010628', 'assertHTML' => true, ], /** @see https://github.com/friendica/friendica/issues/6095 */ 'bug-6095' => [ - 'data' => 'https://en.wikipedia.org/wiki/Solid_(web_decentralization_project)', + 'data' => 'https://en.wikipedia.org/wiki/Solid_(web_decentralization_project)', 'assertHTML' => true, ], 'no-protocol' => [ - 'data' => 'example.com/path', + 'data' => 'example.com/path', 'assertHTML' => false ], 'wrong-protocol' => [ - 'data' => 'ftp://example.com', + 'data' => 'ftp://example.com', 'assertHTML' => false ], 'wrong-domain-without-path' => [ - 'data' => 'http://example', + 'data' => 'http://example', 'assertHTML' => false ], 'wrong-domain-with-path' => [ - 'data' => 'http://example/path', + 'data' => 'http://example/path', 'assertHTML' => false ], 'bug-6857-domain-start' => [ - 'data' => "http://\nexample.com", + 'data' => "http://\nexample.com", 'assertHTML' => false ], 'bug-6857-domain-end' => [ - 'data' => "http://example\n.com", + 'data' => "http://example\n.com", 'assertHTML' => false ], 'bug-6857-tld' => [ - 'data' => "http://example.\ncom", + 'data' => "http://example.\ncom", 'assertHTML' => false ], 'bug-6857-end' => [ - 'data' => "http://example.com\ntest", + 'data' => "http://example.com\ntest", 'assertHTML' => false ], 'bug-6901' => [ - 'data' => "http://example.com

+ {{* contact info header for smartphones *}} @@ -113,7 +113,7 @@ {{* item content *}}
{{if $item.title}} -

{{$item.title}}


+

{{$item.title}}


{{/if}}
{{$item.body_html nofilter}}
diff --git a/view/theme/frio/templates/sub/delivery_count.tpl b/view/theme/frio/templates/sub/delivery_count.tpl index 968211b3bf..25c87f342e 100644 --- a/view/theme/frio/templates/sub/delivery_count.tpl +++ b/view/theme/frio/templates/sub/delivery_count.tpl @@ -6,7 +6,7 @@ *}} {{if $delivery.queue_count >= -1 && $delivery.queue_count !== '' && $delivery.queue_count !== null}} - • + {{if $delivery.queue_count == 0}} {{$delivery.notifier_pending}} diff --git a/view/theme/frio/templates/sub/direction.tpl b/view/theme/frio/templates/sub/direction.tpl index b5672ff0fc..3498354151 100644 --- a/view/theme/frio/templates/sub/direction.tpl +++ b/view/theme/frio/templates/sub/direction.tpl @@ -6,7 +6,7 @@ *}} {{if $direction.direction > 0}} - • + {{if $direction.direction == 1}} {{elseif $direction.direction == 2}} diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index c945105eef..2c04ccde17 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -138,7 +138,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.thread_level==1}}