aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/course
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-03-18 09:37:23 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-03-18 09:37:23 +0000
commitdcf8a8d59b7ebafe7c1328d03c3e30eaf7147470 (patch)
tree2e1b444eeade4cccda33e2e187d21dc41cac418f /app/controllers/course
parent9dc18cc71a11e20a6fb5f4fda915e166d11dee3a (diff)
refine icon detection, fixes #3801
Closes #3801 Merge request studip/studip!2684
Diffstat (limited to 'app/controllers/course')
-rw-r--r--app/controllers/course/contentmodules.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/controllers/course/contentmodules.php b/app/controllers/course/contentmodules.php
index 6dc6c2d..923c61b 100644
--- a/app/controllers/course/contentmodules.php
+++ b/app/controllers/course/contentmodules.php
@@ -292,20 +292,20 @@ class Course_ContentmodulesController extends AuthenticatedController
$metadata = $plugin->getMetadata();
$list[$plugin_id] = [
- 'id' => $plugin_id,
- 'moduleclass' => get_class($plugin),
- 'position' => $tool ? $tool->position : null,
- 'toolname' => $toolname,
- 'displayname' => $displayname,
- 'visibility' => $visibility,
- 'active' => (bool) $tool,
- 'icon' => $this->getIconFromMetadata($metadata, $plugin),
+ 'id' => $plugin_id,
+ 'moduleclass' => get_class($plugin),
+ 'position' => $tool ? $tool->position : null,
+ 'toolname' => $toolname,
+ 'displayname' => $displayname,
+ 'visibility' => $visibility,
+ 'active' => (bool) $tool,
+ 'icon' => $this->getIconFromMetadata($metadata, $plugin),
+ 'summary' => $metadata['summary'] ?? null,
+ 'mandatory' => $this->sem_class->isModuleMandatory(get_class($plugin)),
+ 'highlighted' => (bool) $plugin->isHighlighted(),
+ 'highlight_text' => $plugin->getHighlightText(),
+ 'category' => $metadata['category'] ?? null,
];
- $list[$plugin_id]['summary'] = $metadata['summary'] ?? null;
- $list[$plugin_id]['mandatory'] = $this->sem_class->isModuleMandatory(get_class($plugin));
- $list[$plugin_id]['highlighted'] = (bool) $plugin->isHighlighted();
- $list[$plugin_id]['highlight_text'] = $plugin->getHighlightText();
- $list[$plugin_id]['category'] = $metadata['category'] ?? null;
}
return $list;
@@ -323,7 +323,7 @@ class Course_ContentmodulesController extends AuthenticatedController
return null;
}
- if ($plugin instanceof StudIPPlugin) {
+ if ($plugin instanceof StudIPPlugin && str_starts_with($icon, '..')) {
$path = $GLOBALS['ABSOLUTE_PATH_STUDIP'] . '/' . $plugin->getPluginPath() . '/' . $icon;
$icon = $this->getCoreIcon($path) ?? $icon;
}