3 namespace Friendica\Module\Debug;
5 use Friendica\BaseModule;
6 use Friendica\Core\L10n;
8 use Friendica\Model\Item;
9 use Friendica\Network\HTTPException;
12 * Print the body of an Item
14 class ItemBody extends BaseModule
16 public static function content(array $parameters = [])
19 throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
24 // @TODO: Replace with parameter from router
25 $itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
28 throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
31 $item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $itemId]);
34 if (DI::mode()->isAjax()) {
35 echo str_replace("\n", '<br />', $item['body']);
38 return str_replace("\n", '<br />', $item['body']);
41 throw new HTTPException\NotFoundException(L10n::t('Item not found.'));