aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/files.php
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2022-05-09 12:01:54 +0000
committerMoritz Strohm <strohm@data-quest.de>2022-05-09 12:01:54 +0000
commit3fa639daa6fb2fa7cdffb178a87666d9d136e7b8 (patch)
tree165a079c31fb7c0764fca33dc9b6f79ed62dac10 /app/controllers/files.php
parent26f43b744aaf8524f1b7c2f50e4c0212f7bdeb7b (diff)
fix for BIESt #800
Merge request studip/studip!587
Diffstat (limited to 'app/controllers/files.php')
-rw-r--r--app/controllers/files.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/app/controllers/files.php b/app/controllers/files.php
index 4e11440..9910398 100644
--- a/app/controllers/files.php
+++ b/app/controllers/files.php
@@ -270,7 +270,7 @@ class FilesController extends AuthenticatedController
)->setActive($current_view == 'all_files');
$views->addLink(
- _('Persönlicher Dateibereich'),
+ _('Meine hochgeladenen Dateien'),
$this->url_for('files/overview', ['view' => 'my_uploaded_files']),
null,
[],
@@ -506,10 +506,36 @@ class FilesController extends AuthenticatedController
$this->files[] = $file_ref->getFileType();
}
} elseif ($this->current_view == 'my_uploaded_files') {
+ $this->page_size = 25;
+ $this->page = 1;
+ if (!$course_did_change) {
+ $this->page = Request::get('page') + 1;
+ }
+ if (($this->page < 1) || !$this->page) {
+ $this->page = 1;
+ }
+ $offset = $this->page_size * ($this->page - 1);
+
$this->addFiltersToOverviewSidebar(['time_range', 'course']);
- $this->table_title = _('Persönlicher Dateibereich');
- $file_refs = FileRef::findUploadedFiles($GLOBALS['user']->id, $this->begin, $this->end, $this->course_id);
+ $this->table_title = _('Meine hochgeladenen Dateien');
+ $file_refs = FileRef::findUploadedFiles($GLOBALS['user']->id, $this->begin, $this->end, $this->course_id, $this->page_size, $offset);
$this->files_c = FileRef::countUploadedFiles($GLOBALS['user']->id, $this->begin, $this->end, $this->course_id);
+ $pagination = Pagination::create(
+ $this->files_c,
+ $this->page - 1,
+ $this->page_size
+ );
+ $this->pagination_html = $pagination->asLinks(
+ function ($page_id) {
+ return URLHelper::getLink(
+ 'dispatch.php/files/overview',
+ [
+ 'view' => 'my_uploaded_files',
+ 'page' => $page_id
+ ]
+ );
+ }
+ );
$this->files = [];
foreach ($file_refs as $file_ref) {
$this->files[] = $file_ref->getFileType();