Skip to content
Snippets Groups Projects
Commit dcf8a8d5 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

refine icon detection, fixes #3801

Closes #3801

Merge request !2684
parent 9dc18cc7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment