]> git.mxchange.org Git - friendica.git/commitdiff
Don't display additional content when the output mode is "raw"
authorMichael <heluecht@pirati.ca>
Tue, 28 Nov 2023 15:21:20 +0000 (15:21 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 28 Nov 2023 15:21:20 +0000 (15:21 +0000)
src/Module/Conversation/Channel.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/Conversation/Timeline.php

index 171236e96671a9f0dbe35185669797ade0c47b84..e841eaa277e33a501335e68105d988f1d2d70f78 100644 (file)
@@ -103,7 +103,7 @@ class Channel extends Timeline
                        $o .= Renderer::replaceMacros($tpl, ['$reload_uri' => $this->args->getQueryString()]);
                }
 
-               if (empty($request['mode']) || ($request['mode'] != 'raw')) {
+               if (!$this->raw) {
                        $tabs = $this->getTabArray($this->channel->getTimelines($this->session->getLocalUserId()), 'channel');
                        $tabs = array_merge($tabs, $this->getTabArray($this->channelRepository->selectByUid($this->session->getLocalUserId()), 'channel'));
                        $tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel'));
index d0e3fb87022211c0bb6d434ee960ceac824f415f..117a18da37cec7c5e4aaf2b54fa9f57fb9ef773b 100644 (file)
@@ -97,7 +97,7 @@ class Community extends Timeline
                        $o .= Renderer::replaceMacros($tpl, ['$reload_uri' => $this->args->getQueryString()]);
                }
 
-               if (empty($request['mode']) || ($request['mode'] != 'raw')) {
+               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]);
index 002a92e538b7ffba2f51860b83797c4287fd722e..b98e9d36523a4d80c51b985f07d287adea71081c 100644 (file)
@@ -157,7 +157,7 @@ class Network extends Timeline
                        $o .= Renderer::replaceMacros($tpl, ['$reload_uri' => $this->args->getQueryString()]);
                }
 
-               if (!(isset($_GET['mode']) and ($_GET['mode'] == 'raw'))) {
+               if (!$this->raw) {
                        $o .= $this->getTabsHTML();
 
                        Nav::setSelected($this->args->get(0));
@@ -210,30 +210,30 @@ class Network extends Timeline
                        ];
 
                        $o .= $this->conversation->statusEditor($x);
-               }
 
-               if ($this->circleId) {
-                       $circle = $this->database->selectFirst('group', ['name'], ['id' => $this->circleId, 'uid' => $this->session->getLocalUserId()]);
-                       if (!$this->database->isResult($circle)) {
-                               $this->systemMessages->addNotice($this->l10n->t('No such circle'));
-                       }
+                       if ($this->circleId) {
+                               $circle = $this->database->selectFirst('group', ['name'], ['id' => $this->circleId, 'uid' => $this->session->getLocalUserId()]);
+                               if (!$this->database->isResult($circle)) {
+                                       $this->systemMessages->addNotice($this->l10n->t('No such circle'));
+                               }
 
-                       $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
-                               '$title' => $this->l10n->t('Circle: %s', $circle['name'])
-                       ]) . $o;
-               } elseif ($this->groupContactId) {
-                       $contact = Contact::getById($this->groupContactId);
-                       if ($this->database->isResult($contact)) {
-                               $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('contact/list.tpl'), [
-                                       'contacts' => [ModuleContact::getContactTemplateVars($contact)],
-                                       'id' => $this->args->get(0),
+                               $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
+                                       '$title' => $this->l10n->t('Circle: %s', $circle['name'])
                                ]) . $o;
-                       } else {
-                               $this->systemMessages->addNotice($this->l10n->t('Invalid contact.'));
+                       } elseif ($this->groupContactId) {
+                               $contact = Contact::getById($this->groupContactId);
+                               if ($this->database->isResult($contact)) {
+                                       $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('contact/list.tpl'), [
+                                               'contacts' => [ModuleContact::getContactTemplateVars($contact)],
+                                               'id' => $this->args->get(0),
+                                       ]) . $o;
+                               } else {
+                                       $this->systemMessages->addNotice($this->l10n->t('Invalid contact.'));
+                               }
+                       } elseif (Profile::shouldDisplayEventList($this->session->getLocalUserId(), $this->mode)) {
+                               $o .= Profile::getBirthdays($this->session->getLocalUserId());
+                               $o .= Profile::getEventsReminderHTML($this->session->getLocalUserId(), $this->session->getPublicContactId());
                        }
-               } elseif (Profile::shouldDisplayEventList($this->session->getLocalUserId(), $this->mode)) {
-                       $o .= Profile::getBirthdays($this->session->getLocalUserId());
-                       $o .= Profile::getEventsReminderHTML($this->session->getLocalUserId(), $this->session->getPublicContactId());
                }
 
                try {
index b2234aae6f4984e4df1fdc9871778076ae422066..88e3261cf2e4fa580795af3311389b5e91a367bc 100644 (file)
@@ -68,6 +68,8 @@ class Timeline extends BaseModule
        protected $force;
        /** @var bool */
        protected $update;
+       /** @var bool */
+       protected $raw;
 
        /** @var App\Mode $mode */
        protected $mode;
@@ -140,6 +142,7 @@ class Timeline extends BaseModule
                $this->noSharer = !empty($request['no_sharer']);
                $this->force    = !empty($request['force']) && !empty($request['item']);
                $this->update   = !empty($request['force']) && !empty($request['first_received']) && !empty($request['first_created']) && !empty($request['first_uriid']) && !empty($request['first_commented']);
+               $this->raw      = !empty($request['mode']) && ($request['mode'] == 'raw');
        }
 
        protected function getNoSharerWidget(string $base): string