<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
protected function content(array $request = []): string
{
if (!$this->session->getLocalUserId()) {
- throw new UnauthorizedException($this->t('Permission denied.'));
+ throw new UnauthorizedException($this->t('You need to be logged in to access this page.'));
}
// Needed to match the correct template in a module that uses a different theme than the user/site/default
$files = Attach::selectToArray(['id', 'filename', 'filetype'], ['uid' => $this->session->getLocalUserId()]);
-
$fileArray = array_map([$this, 'map_files'], $files);
- $tpl = Renderer::getMarkupTemplate('media/filebrowser.tpl');
+ $tpl = Renderer::getMarkupTemplate('media/browser.tpl');
$output = Renderer::replaceMacros($tpl, [
'$type' => 'attachment',
'$path' => ['' => $this->t('Files')],
protected function map_files(array $record): array
{
- [$m1, $m2] = explode('/', $record['filetype']);
+ list($m1, $m2) = explode('/', $record['filetype']);
$filetype = file_exists(sprintf('images/icons/%s.png', $m1) ? $m1 : 'text');
return [