diff options
| author | Rasmus Fuhse <fuhse@data-quest.de> | 2023-07-15 13:49:38 +0000 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2023-07-15 13:49:38 +0000 |
| commit | 6f603e5ed007324c7edb7d3965850b2559979a16 (patch) | |
| tree | 9603117af2fd00b7cfd416a62dd865ad078e48b2 /app/controllers/course/contentmodules.php | |
| parent | 62e4affaacb398fd38089b56e1040d64c4d1d37a (diff) | |
Resolve "Werkzeuge: Info-Dialoge für Plugins zeigen keine Bilder an"
Closes #2847
Merge request studip/studip!1934
Diffstat (limited to 'app/controllers/course/contentmodules.php')
| -rw-r--r-- | app/controllers/course/contentmodules.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/controllers/course/contentmodules.php b/app/controllers/course/contentmodules.php index 2e4907a..06d46de 100644 --- a/app/controllers/course/contentmodules.php +++ b/app/controllers/course/contentmodules.php @@ -231,6 +231,34 @@ class Course_ContentmodulesController extends AuthenticatedController { $this->plugin = PluginManager::getInstance()->getPluginById($plugin_id); $this->metadata = $this->plugin->getMetadata(); + $this->screenshots = []; + + if (isset($this->metadata['screenshot'])) { + $screenshots = explode('.', $this->metadata['screenshot']); + $ext = end($screenshots); + $title = str_replace('_', ' ', basename($this->metadata['screenshot'], ".{$ext}")); + $source = "{$this->plugin->getPluginURL()}/{$this->metadata['screenshot']}"; + + $this->screenshots[] = compact('title', 'source'); + } + if (isset($this->metadata['additionalscreenshots'])) { + foreach ($this->metadata['additionalscreenshots'] as $picture) { + $pictures = explode('.', $picture); + $ext = end($pictures); + $title = str_replace('_', ' ', basename($picture, ".{$ext}")); + $source = "{$this->plugin->getPluginURL()}/{$picture}"; + + $this->screenshots[] = compact('title', 'source'); + } + } + if (isset($this->metadata['screenshots'])) { + foreach ($this->metadata['screenshots']['pictures'] as $picture) { + $title = $picture['title']; + $source = "{$this->plugin->getPluginURL()}/{$this->metadata['screenshots']['path']}/{$picture['source']}"; + $this->screenshots[] = compact('title', 'source'); + } + } + PageLayout::setTitle(sprintf(_('Informationen über %s'), $this->metadata['displayname'])); } |
