]> git.mxchange.org Git - friendica.git/blob - src/Module/Itemsource.php
Merge pull request #6649 from MrPetovan/bug/6647-include-newlines-in-implicit-mention...
[friendica.git] / src / Module / Itemsource.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\Core\L10n;
6 use Friendica\Core\Renderer;
7 use Friendica\Model;
8
9 /**
10  * @author Hypolite Petovan <mrpetovan@gmail.com>
11  */
12 class Itemsource extends \Friendica\BaseModule
13 {
14         public static function content()
15         {
16                 if (!is_site_admin()) {
17                         return;
18                 }
19
20                 $a = self::getApp();
21
22                 if (!empty($a->argv[1])) {
23                         $guid = $a->argv[1];
24                 }
25
26                 $guid = defaults($_REQUEST['guid'], $guid);
27
28                 $source = '';
29                 $item_uri = '';
30                 if (!empty($guid)) {
31                         $item = Model\Item::selectFirst([], ['guid' => $guid]);
32
33                         $conversation = Model\Conversation::getByItemUri($item['uri']);
34
35                         $item_uri = $item['uri'];
36                         $source = $conversation['source'];
37                 }
38
39                 $tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl');
40                 $o = Renderer::replaceMacros($tpl, [
41                         '$guid'          => ['guid', L10n::t('Item Guid'), defaults($_REQUEST, 'guid', ''), ''],
42                         '$source'        => $source,
43                         '$item_uri'      => $item_uri
44                 ]);
45
46                 return $o;
47         }
48 }