mirror of
https://github.com/friendica/friendica
synced 2025-04-25 06:30:11 +00:00
Add itemsource module
This commit is contained in:
parent
eb714f0487
commit
d0681075bf
3 changed files with 72 additions and 0 deletions
39
src/Module/Itemsource.php
Normal file
39
src/Module/Itemsource.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\Core\L10n;
|
||||
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']);
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('debug/itemsource.tpl');
|
||||
$o = replace_macros($tpl, [
|
||||
'$guid' => ['guid', L10n::t('Item Guid'), htmlentities(defaults($_REQUEST, 'guid', '')), ''],
|
||||
'$source' => $source,
|
||||
'$item_uri' => $item_uri
|
||||
]);
|
||||
|
||||
return $o;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue