diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-22 11:56:11 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-03-22 11:56:11 +0000 |
| commit | 3dcee65137d7c25129c93a2f197084e2e9c8ab2f (patch) | |
| tree | 00bab06ca06cda301075c10b9b095c58ea808a1a /app | |
| parent | 2ba898859c58b7538f51a257c281a70d42452390 (diff) | |
use event bus to toggle display of gallery link and make sure the gallery link...
Closes #2409
Merge request studip/studip!1604
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/course/files.php | 25 | ||||
| -rw-r--r-- | app/controllers/files.php | 24 |
2 files changed, 25 insertions, 24 deletions
diff --git a/app/controllers/course/files.php b/app/controllers/course/files.php index 2cb69a8..91d1918 100644 --- a/app/controllers/course/files.php +++ b/app/controllers/course/files.php @@ -59,16 +59,6 @@ class Course_FilesController extends AuthenticatedController ); } - $actions->addLink( - _('Bildergalerie öffnen'), - '#g', - Icon::create('file-pic', 'clickable'), - [ - 'onClick' => "STUDIP.Files.openGallery(); return false;", - 'v-if' => "hasFilesOfType('image')" - ] - ); - if ($this->topFolder && $this->topFolder->isSubfolderAllowed($GLOBALS['user']->id)) { $actions->addLink( _('Neuer Ordner'), @@ -93,9 +83,18 @@ class Course_FilesController extends AuthenticatedController )->asDialog(); } - $sidebar->addWidget($actions); + $actions->addLink( + _('Bildergalerie öffnen'), + '#g', + Icon::create('file-pic'), + [ + 'onClick' => "STUDIP.Files.openGallery(); return false;", + 'style' => 'display: none', + ] + ); + $sidebar->addWidget($actions); if ($this->topFolder->isWritable($GLOBALS['user']->id)) { $uploadArea = new LinksWidget(); @@ -172,10 +171,10 @@ class Course_FilesController extends AuthenticatedController $actions->addLink( _('Bildergalerie öffnen'), '#g', - Icon::create('file-pic', 'clickable'), + Icon::create('file-pic'), [ 'onClick' => "STUDIP.Files.openGallery(); return false;", - 'v-if' => "hasFilesOfType('image')" + 'style' => 'display: none', ] ); if ($GLOBALS['user']->id !== 'nobody') { diff --git a/app/controllers/files.php b/app/controllers/files.php index 555e788..46a67e6 100644 --- a/app/controllers/files.php +++ b/app/controllers/files.php @@ -100,15 +100,6 @@ class FilesController extends AuthenticatedController ); } - $actions->addLink( - _('Bildergalerie öffnen'), - '#g', - Icon::create('file-pic', 'clickable'), - [ - 'onClick' => "STUDIP.Files.openGallery(); return false;" - ] - ); - if ($folder->isWritable($GLOBALS['user']->id)) { $actions->addLink( _('Dokument hinzufügen'), @@ -146,6 +137,17 @@ class FilesController extends AuthenticatedController )->asDialog(); } } + + $actions->addLink( + _('Bildergalerie öffnen'), + '#g', + Icon::create('file-pic'), + [ + 'onClick' => "STUDIP.Files.openGallery(); return false;", + 'style' => 'display: none', + ] + ); + $sidebar->addWidget($actions); if ($folder->isWritable($GLOBALS['user']->id)) { @@ -612,10 +614,10 @@ class FilesController extends AuthenticatedController $actions->addLink( _('Bildergalerie öffnen'), '#g', - Icon::create('file-pic', 'clickable'), + Icon::create('file-pic'), [ 'onClick' => "STUDIP.Files.openGallery(); return false;", - 'v-if' => "hasFilesOfType('image')" + 'style' => 'display: none', ] ); $sidebar->addWidget($actions); |
