aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/CourseAvatar.php
diff options
context:
space:
mode:
authorMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2024-06-18 13:18:06 +0000
committerMarcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>2024-06-18 13:18:06 +0000
commit33fd1358507b4a5abb3dcebe78d407d0567717c1 (patch)
tree6bd8f6959da4c3fc1b8907c0bbc28eb9e10d4a5a /lib/classes/CourseAvatar.php
parent42d46671c0309bddb71a91bbfdc5f2fa2e44384e (diff)
Deprecate `StudipAutoloader` and use composer's `autoload`
Closes #4282 Merge request studip/studip!3099
Diffstat (limited to 'lib/classes/CourseAvatar.php')
-rw-r--r--lib/classes/CourseAvatar.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/classes/CourseAvatar.php b/lib/classes/CourseAvatar.php
new file mode 100644
index 0000000..8c153a8
--- /dev/null
+++ b/lib/classes/CourseAvatar.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * This class represents the avatar of a course.
+ *
+ * @author Marcus Lunzenauer (mlunzena@uos)
+ * @copyright (c) Authors
+ * @license GPL2 or any later version
+ * @since 1.10
+ */
+class CourseAvatar extends Avatar
+{
+ public const AVATAR_TYPE = 'course';
+
+ /**
+ * Returns the CSS class to use for this avatar image.
+ *
+ * @param string one of the constants Avatar::(NORMAL|MEDIUM|SMALL)
+ *
+ * @return string CSS class to use for the avatar
+ */
+ protected function getCssClass($size)
+ {
+ return "course-avatar-{$size} course-{$this->user_id}";
+ }
+
+ /**
+ * Return the default title of the avatar.
+ * @return string the default title
+ */
+ public function getDefaultTitle()
+ {
+ return Seminar::GetInstance($this->user_id)->name;
+ }
+
+ /**
+ * Return if avatar is visible to the current user.
+ * @return boolean: true if visible
+ */
+ protected function checkAvatarVisibility()
+ {
+ //no special conditions for visibility of course-avatars yet
+ return true;
+ }
+}