3 namespace Friendica\Module\Debug;
5 use Friendica\BaseModule;
6 use Friendica\Core\L10n;
7 use Friendica\Model\Item;
8 use Friendica\Network\HTTPException;
11 * Print the body of an Item
13 class ItemBody extends BaseModule
15 public static function content(array $parameters = [])
18 throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
21 $app = self::getApp();
23 // @TODO: Replace with parameter from router
24 $itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
27 throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
30 $item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $itemId]);
34 echo str_replace("\n", '<br />', $item['body']);
37 return str_replace("\n", '<br />', $item['body']);
40 throw new HTTPException\NotFoundException(L10n::t('Item not found.'));