]> git.mxchange.org Git - friendica.git/blob - src/Module/Special/DisplayNotFound.php
Merge pull request #13785 from foss-/patch-11
[friendica.git] / src / Module / Special / DisplayNotFound.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2024, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 namespace Friendica\Module\Special;
23
24 use Friendica\Core\Renderer;
25
26 /**
27  * This is a special case of the HTTPException module where the message is intended to be HTML.
28  * This module should be called directly from the Display module and shouldn't be routed to.
29  */
30 class DisplayNotFound extends \Friendica\BaseModule
31 {
32         protected function content(array $request = []): string
33         {
34                 $reasons = [
35                         $this->t("The top-level post isn't visible."),
36                         $this->t('The top-level post was deleted.'),
37                         $this->t('This node has blocked the top-level author or the author of the shared post.'),
38                         $this->t('You have ignored or blocked the top-level author or the author of the shared post.'),
39                         $this->t("You have ignored the top-level author's server or the shared post author's server."),
40                 ];
41
42                 $tpl = Renderer::getMarkupTemplate('special/displaynotfound.tpl');
43                 return Renderer::replaceMacros($tpl, [
44                         '$l10n' => [
45                                 'title'   => $this->t('Conversation Not Found'),
46                                 'desc1'   => $this->t("Unfortunately, the requested conversation isn't available to you."),
47                                 'desc2'   => $this->t('Possible reasons include:'),
48                                 'reasons' => $reasons,
49                         ]
50                 ]);
51         }
52 }