]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Media/Attachment/Browser.php
spelling: one
[friendica.git] / src / Module / Media / Attachment / Browser.php
index 021859c021e881693d5f296318f3e734c94ad442..80a87d5bde2bd34cf21896e655dc306486bd05e7 100644 (file)
@@ -1,6 +1,6 @@
 <?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
  *
@@ -55,7 +55,7 @@ class Browser extends BaseModule
        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
@@ -66,10 +66,9 @@ class Browser extends BaseModule
 
                $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')],
@@ -89,7 +88,7 @@ class Browser extends BaseModule
 
        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 [