2018-10-18 22:49:25 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\Core\L10n;
|
2018-10-31 10:35:50 -04:00
|
|
|
use Friendica\Core\Renderer;
|
2018-10-18 22:49:25 -04:00
|
|
|
use Friendica\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
|
|
|
*/
|
|
|
|
class Itemsource extends \Friendica\BaseModule
|
|
|
|
{
|
|
|
|
public static function content()
|
|
|
|
{
|
|
|
|
if (!is_site_admin()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$source = '';
|
|
|
|
$item_uri = '';
|
|
|
|
if (!empty($_REQUEST['guid'])) {
|
|
|
|
$item = Model\Item::selectFirst([], ['guid' => $_REQUEST['guid']]);
|
|
|
|
|
|
|
|
$conversation = Model\Conversation::getByItemUri($item['uri']);
|
|
|
|
|
|
|
|
$item_uri = $item['uri'];
|
|
|
|
$source = htmlspecialchars($conversation['source']);
|
|
|
|
}
|
|
|
|
|
2018-10-31 10:44:06 -04:00
|
|
|
$tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl');
|
2018-10-31 10:35:50 -04:00
|
|
|
$o = Renderer::replaceMacros($tpl, [
|
2018-10-18 22:49:25 -04:00
|
|
|
'$guid' => ['guid', L10n::t('Item Guid'), htmlentities(defaults($_REQUEST, 'guid', '')), ''],
|
|
|
|
'$source' => $source,
|
|
|
|
'$item_uri' => $item_uri
|
|
|
|
]);
|
|
|
|
|
|
|
|
return $o;
|
|
|
|
}
|
|
|
|
}
|