diff options
| author | Rasmus Fuhse <fuhse@data-quest.de> | 2023-07-13 13:14:56 +0000 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2023-07-13 13:14:56 +0000 |
| commit | 74603117e50e764dfb0233d49cb99ffafaccac54 (patch) | |
| tree | 6dda9ee2c02a06a275d76aa05619eb6402176f18 /lib/plugins/core/CorePlugin.php | |
| parent | 578284e2ee4d8c8f2901b26abcb3efd440b9ad7f (diff) | |
Resolve "Restrukturierung der Veranstaltungsverwaltung inklusive Mehr-Seite"
Closes #2440
Merge request studip/studip!1695
Diffstat (limited to 'lib/plugins/core/CorePlugin.php')
| -rw-r--r-- | lib/plugins/core/CorePlugin.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/plugins/core/CorePlugin.php b/lib/plugins/core/CorePlugin.php index e16b77a..0bba289 100644 --- a/lib/plugins/core/CorePlugin.php +++ b/lib/plugins/core/CorePlugin.php @@ -60,6 +60,41 @@ abstract class CorePlugin return ''; } + public function getPluginDescription() + { + $metadata = $this->getMetadata(); + $language = getUserLanguage(User::findCurrent()->id); + if ($metadata['descriptionlong_' . $language]) { + return $metadata['descriptionlong_' . $language]; + } + if ($metadata['description_' . $language]) { + return $metadata['description_' . $language]; + } + $description = $metadata['descriptionlong'] ?? $metadata['description']; + + if ($this->plugin_info['description_mode'] === 'override_description') { + return $this->plugin_info['description']; + } else { + return '<!-- HTML --><div>' . $description . '</div>' . $this->plugin_info['description']; + } + } + + public function getDescriptionMode() + { + return $this->plugin_info['description_mode']; + } + + public function isHighlighted() + { + return $this->plugin_info['highlight_until'] > time(); + } + + public function getHighlightText() + { + return $this->plugin_info['highlight_text']; + } + + /** * Checks if the plugin is a core-plugin. Returns true if this is the case. * |
