From b66b7b3bfe98f3f7b5a0194d1eb7b51c8576af3a Mon Sep 17 00:00:00 2001 From: Julio Date: Tue, 31 Aug 2021 09:57:52 +0200 Subject: [PATCH] Tools: Update tool classes --- src/CoreBundle/Tool/Agenda.php | 32 +++++++++++++++++- src/CoreBundle/Tool/Announcement.php | 32 +++++++++++++++++- src/CoreBundle/Tool/Asset.php | 30 ++++++++++++++++- src/CoreBundle/Tool/Assignment.php | 36 +++++++++++++++++++- src/CoreBundle/Tool/Attendance.php | 30 ++++++++++++++++- src/CoreBundle/Tool/Chat.php | 30 ++++++++++++++++- src/CoreBundle/Tool/CourseDescription.php | 30 ++++++++++++++++- src/CoreBundle/Tool/CourseProgress.php | 30 ++++++++++++++++- src/CoreBundle/Tool/CourseTool.php | 30 ++++++++++++++++- src/CoreBundle/Tool/Document.php | 33 ++++++++++++++++-- src/CoreBundle/Tool/Exercise.php | 41 ++++++++++++++++++++++- src/CoreBundle/Tool/Forum.php | 38 ++++++++++++++++++++- src/CoreBundle/Tool/GlobalTool.php | 34 ++++++++++++++++++- src/CoreBundle/Tool/Glossary.php | 30 ++++++++++++++++- src/CoreBundle/Tool/Gradebook.php | 34 ++++++++++++++++++- src/CoreBundle/Tool/Group.php | 37 +++++++++++++++++++- src/CoreBundle/Tool/LearningPath.php | 32 +++++++++++++++++- src/CoreBundle/Tool/Link.php | 31 ++++++++++++++++- src/CoreBundle/Tool/Maintenance.php | 21 +++++++++++- src/CoreBundle/Tool/Member.php | 21 +++++++++++- src/CoreBundle/Tool/Notebook.php | 30 ++++++++++++++++- src/CoreBundle/Tool/Settings.php | 21 +++++++++++- src/CoreBundle/Tool/Shortcut.php | 32 +++++++++++++++++- src/CoreBundle/Tool/Survey.php | 32 +++++++++++++++++- src/CoreBundle/Tool/Tracking.php | 21 +++++++++++- src/CoreBundle/Tool/User.php | 32 +++++++++++++++++- src/CoreBundle/Tool/UserGroup.php | 28 +++++++++++++++- src/CoreBundle/Tool/Wiki.php | 30 ++++++++++++++++- 28 files changed, 829 insertions(+), 29 deletions(-) diff --git a/src/CoreBundle/Tool/Agenda.php b/src/CoreBundle/Tool/Agenda.php index 3b0903f2e9..40835a4488 100644 --- a/src/CoreBundle/Tool/Agenda.php +++ b/src/CoreBundle/Tool/Agenda.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Agenda extends AbstractTool +use Chamilo\CourseBundle\Entity\CCalendarEvent; +use Chamilo\CourseBundle\Entity\CCalendarEventAttachment; + +class Agenda extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'agenda'; + } + + public function getIcon(): string + { + return 'mdi-certificate'; + } + + public function getLink(): string + { + return '/resources/ccalendarevent'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'events' => CCalendarEvent::class, + 'event_attachments' => CCalendarEventAttachment::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Announcement.php b/src/CoreBundle/Tool/Announcement.php index 8c1ff61967..80b22bd07d 100644 --- a/src/CoreBundle/Tool/Announcement.php +++ b/src/CoreBundle/Tool/Announcement.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Announcement extends AbstractTool +use Chamilo\CourseBundle\Entity\CAnnouncement; +use Chamilo\CourseBundle\Entity\CAnnouncementAttachment; + +class Announcement extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'announcement'; + } + + public function getIcon(): string + { + return 'mdi-bullhorn'; + } + + public function getLink(): string + { + return '/main/announcements/announcements.php'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'announcements' => CAnnouncement::class, + 'announcements_attachments' => CAnnouncementAttachment::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Asset.php b/src/CoreBundle/Tool/Asset.php index e9eb953055..4cefec1b32 100644 --- a/src/CoreBundle/Tool/Asset.php +++ b/src/CoreBundle/Tool/Asset.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Asset extends AbstractTool +use Chamilo\CoreBundle\Entity\Illustration; + +class Asset extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'asset'; + } + + public function getCategory(): string + { + return 'admin'; + } + + public function getLink(): string + { + return ''; + } + + public function getIcon(): string + { + return 'admin'; + } + + public function getResourceTypes(): ?array + { + return [ + 'illustrations' => Illustration::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Assignment.php b/src/CoreBundle/Tool/Assignment.php index ead5ae7f6d..e960aedbd0 100644 --- a/src/CoreBundle/Tool/Assignment.php +++ b/src/CoreBundle/Tool/Assignment.php @@ -6,6 +6,40 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Assignment extends AbstractTool +use Chamilo\CourseBundle\Entity\CStudentPublication; +use Chamilo\CourseBundle\Entity\CStudentPublicationAssignment; +use Chamilo\CourseBundle\Entity\CStudentPublicationComment; +use Chamilo\CourseBundle\Entity\CStudentPublicationCorrection; + +class Assignment extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'student_publication'; + } + + public function getLink(): string + { + return '/main/work/work.php'; + } + + public function getIcon(): string + { + return 'mdi-inbox-full'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getResourceTypes(): ?array + { + return [ + 'student_publications' => CStudentPublication::class, + 'student_publications_assignments' => CStudentPublicationAssignment::class, + 'student_publications_comments' => CStudentPublicationComment::class, + 'student_publications_corrections' => CStudentPublicationCorrection::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Attendance.php b/src/CoreBundle/Tool/Attendance.php index babb7edf65..31b981d776 100644 --- a/src/CoreBundle/Tool/Attendance.php +++ b/src/CoreBundle/Tool/Attendance.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Attendance extends AbstractTool +use Chamilo\CourseBundle\Entity\CAttendance; + +class Attendance extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'attendance'; + } + + public function getLink(): string + { + return '/main/attendance/index.php'; + } + + public function getIcon(): string + { + return 'mdi-av-timer'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'attendances' => CAttendance::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Chat.php b/src/CoreBundle/Tool/Chat.php index 4f0e66e864..2b3281379c 100644 --- a/src/CoreBundle/Tool/Chat.php +++ b/src/CoreBundle/Tool/Chat.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Chat extends AbstractTool +use Chamilo\CourseBundle\Entity\CChatConversation; + +class Chat extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'chat'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getIcon(): string + { + return 'mdi-'; + } + + public function getLink(): string + { + return '/resources/chat'; + } + + public function getResourceTypes(): ?array + { + return [ + 'conversations' => CChatConversation::class, + ]; + } } diff --git a/src/CoreBundle/Tool/CourseDescription.php b/src/CoreBundle/Tool/CourseDescription.php index 5382a639e7..035458df97 100644 --- a/src/CoreBundle/Tool/CourseDescription.php +++ b/src/CoreBundle/Tool/CourseDescription.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class CourseDescription extends AbstractTool +use Chamilo\CourseBundle\Entity\CCourseDescription; + +class CourseDescription extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'course_description'; + } + + public function getLink(): string + { + return '/main/course_description/index.php'; + } + + public function getIcon(): string + { + return 'mdi-apple-safari'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'course_descriptions' => CCourseDescription::class, + ]; + } } diff --git a/src/CoreBundle/Tool/CourseProgress.php b/src/CoreBundle/Tool/CourseProgress.php index e398e59edb..1dcc3bb0cc 100644 --- a/src/CoreBundle/Tool/CourseProgress.php +++ b/src/CoreBundle/Tool/CourseProgress.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class CourseProgress extends AbstractTool +use Chamilo\CourseBundle\Entity\CThematic; + +class CourseProgress extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'course_progress'; + } + + public function getIcon(): string + { + return 'mdi-file-tree'; + } + + public function getLink(): string + { + return '/main/course_progress/index.php'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'thematics' => CThematic::class, + ]; + } } diff --git a/src/CoreBundle/Tool/CourseTool.php b/src/CoreBundle/Tool/CourseTool.php index a30a89e38d..ea603c0881 100644 --- a/src/CoreBundle/Tool/CourseTool.php +++ b/src/CoreBundle/Tool/CourseTool.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class CourseTool extends AbstractTool +use Chamilo\CourseBundle\Entity\CTool; + +class CourseTool extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'course_tool'; + } + + public function getLink(): string + { + return '/resources/course_tool/links'; + } + + public function getIcon(): string + { + return 'mdi-file-link'; + } + + public function getCategory(): string + { + return 'admin'; + } + + public function getResourceTypes(): ?array + { + return [ + 'links' => CTool::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Document.php b/src/CoreBundle/Tool/Document.php index 50b985f55e..9fbf1ee324 100644 --- a/src/CoreBundle/Tool/Document.php +++ b/src/CoreBundle/Tool/Document.php @@ -6,10 +6,39 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Document extends AbstractTool +use Chamilo\CourseBundle\Entity\CDocument; + +class Document extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'document'; + } + + public function getNameToShow(): string + { + return 'Documents'; + } + + public function getIcon(): string + { + return 'mdi-bookshelf'; + } + public function getLink(): string { - return $this->link.':nodeId/'; + return '/resources/document/:nodeId/'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'files' => CDocument::class, + ]; } } diff --git a/src/CoreBundle/Tool/Exercise.php b/src/CoreBundle/Tool/Exercise.php index 0635a29a0a..ab69c42c9f 100644 --- a/src/CoreBundle/Tool/Exercise.php +++ b/src/CoreBundle/Tool/Exercise.php @@ -6,6 +6,45 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Exercise extends AbstractTool +use Chamilo\CourseBundle\Entity\CExerciseCategory; +use Chamilo\CourseBundle\Entity\CQuiz; +use Chamilo\CourseBundle\Entity\CQuizQuestion; +use Chamilo\CourseBundle\Entity\CQuizQuestionCategory; + +class Exercise extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'quiz'; + } + + public function getNameToShow(): string + { + return 'Tests'; + } + + public function getIcon(): string + { + return 'mdi-ballot'; + } + + public function getLink(): string + { + return '/main/exercise/exercise.php'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'exercises' => CQuiz::class, + 'questions' => CQuizQuestion::class, + 'question_categories' => CQuizQuestionCategory::class, + 'exercise_categories' => CExerciseCategory::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Forum.php b/src/CoreBundle/Tool/Forum.php index c8a5b14369..8d70a1da9e 100644 --- a/src/CoreBundle/Tool/Forum.php +++ b/src/CoreBundle/Tool/Forum.php @@ -6,6 +6,42 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Forum extends AbstractTool +use Chamilo\CourseBundle\Entity\CForum; +use Chamilo\CourseBundle\Entity\CForumAttachment; +use Chamilo\CourseBundle\Entity\CForumCategory; +use Chamilo\CourseBundle\Entity\CForumThread; +use Chamilo\CourseBundle\Repository\CForumPostRepository; + +class Forum extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'forum'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getLink(): string + { + return '/main/forum/index.php'; + } + + public function getIcon(): string + { + return 'mdi-comment-quote'; + } + + public function getResourceTypes(): ?array + { + return [ + 'forums' => CForum::class, + 'forum_attachments' => CForumAttachment::class, + 'forum_categories' => CForumCategory::class, + 'forum_posts' => CForumPostRepository::class, + 'forum_threads' => CForumThread::class, + ]; + } } diff --git a/src/CoreBundle/Tool/GlobalTool.php b/src/CoreBundle/Tool/GlobalTool.php index 3fa8740383..2c0578d74a 100644 --- a/src/CoreBundle/Tool/GlobalTool.php +++ b/src/CoreBundle/Tool/GlobalTool.php @@ -6,6 +6,38 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class GlobalTool extends AbstractTool +use Chamilo\CoreBundle\Entity\AccessUrl; +use Chamilo\CoreBundle\Entity\Course; +use Chamilo\CoreBundle\Entity\User; + +class GlobalTool extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'global'; + } + + public function getIcon(): string + { + return 'mdi-'; + } + + public function getLink(): string + { + return '/resources/chat'; + } + + public function getCategory(): string + { + return 'admin'; + } + + public function getResourceTypes(): ?array + { + return [ + 'urls' => AccessUrl::class, + 'courses' => Course::class, + 'users' => User::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Glossary.php b/src/CoreBundle/Tool/Glossary.php index 7700a8fff4..2c547f60a3 100644 --- a/src/CoreBundle/Tool/Glossary.php +++ b/src/CoreBundle/Tool/Glossary.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Glossary extends AbstractTool +use Chamilo\CourseBundle\Entity\CGlossary; + +class Glossary extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'glossary'; + } + + public function getLink(): string + { + return '/main/glossary/index.php'; + } + + public function getIcon(): string + { + return 'mdi-alphabetical'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'glossaries' => CGlossary::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Gradebook.php b/src/CoreBundle/Tool/Gradebook.php index ab78da9ab5..94c55d8ce2 100644 --- a/src/CoreBundle/Tool/Gradebook.php +++ b/src/CoreBundle/Tool/Gradebook.php @@ -6,6 +6,38 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Gradebook extends AbstractTool +use Chamilo\CoreBundle\Entity\GradebookCategory; +use Chamilo\CoreBundle\Entity\GradebookEvaluation; +use Chamilo\CoreBundle\Entity\GradebookLink; + +class Gradebook extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'gradebook'; + } + + public function getLink(): string + { + return '/main/gradebook/index.php'; + } + + public function getIcon(): string + { + return 'mdi-certificate'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getResourceTypes(): ?array + { + return [ + 'gradebooks' => GradebookCategory::class, + 'gradebook_links' => GradebookLink::class, + 'gradebook_evaluations' => GradebookEvaluation::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Group.php b/src/CoreBundle/Tool/Group.php index 1a4af77062..5aab833bb2 100644 --- a/src/CoreBundle/Tool/Group.php +++ b/src/CoreBundle/Tool/Group.php @@ -6,6 +6,41 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Group extends AbstractTool +use Chamilo\CourseBundle\Entity\CGroup; +use Chamilo\CourseBundle\Entity\CGroupCategory; + +class Group extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'group'; + } + + public function getNameToShow(): string + { + return 'Groups'; + } + + public function getLink(): string + { + return '/main/group/group.php'; + } + + public function getIcon(): string + { + return 'mdi-account-group'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getResourceTypes(): ?array + { + return [ + 'groups' => CGroup::class, + 'group_categories' => CGroupCategory::class, + ]; + } } diff --git a/src/CoreBundle/Tool/LearningPath.php b/src/CoreBundle/Tool/LearningPath.php index dfb9096875..f244232168 100644 --- a/src/CoreBundle/Tool/LearningPath.php +++ b/src/CoreBundle/Tool/LearningPath.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class LearningPath extends AbstractTool +use Chamilo\CourseBundle\Entity\CLp; +use Chamilo\CourseBundle\Entity\CLpCategory; + +class LearningPath extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'learnpath'; + } + + public function getCategory(): string + { + return 'authoring'; + } + + public function getLink(): string + { + return '/main/lp/lp_controller.php'; + } + + public function getIcon(): string + { + return 'mdi-routes'; + } + + public function getResourceTypes(): ?array + { + return [ + 'lps' => CLp::class, + 'lp_categories' => CLpCategory::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Link.php b/src/CoreBundle/Tool/Link.php index f6be1ac6a9..e43a518d5f 100644 --- a/src/CoreBundle/Tool/Link.php +++ b/src/CoreBundle/Tool/Link.php @@ -6,6 +6,35 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Link extends AbstractTool +use Chamilo\CourseBundle\Entity\CLink; +use Chamilo\CourseBundle\Entity\CLinkCategory; + +class Link extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'link'; + } + + public function getCategory(): string + { + return 'authoring'; + } + public function getIcon(): string + { + return 'mdi-file-link'; + } + + public function getLink(): string + { + return '/main/link/link.php'; + } + + public function getResourceTypes(): ?array + { + return [ + 'links' => CLink::class, + 'link_categories' => CLinkCategory::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Maintenance.php b/src/CoreBundle/Tool/Maintenance.php index 055d684442..e754a9d8bb 100644 --- a/src/CoreBundle/Tool/Maintenance.php +++ b/src/CoreBundle/Tool/Maintenance.php @@ -6,6 +6,25 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Maintenance extends AbstractTool +class Maintenance extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'course_maintenance'; + } + + public function getIcon(): string + { + return 'mdi'; + } + + public function getLink(): string + { + return '/main/course_info/maintenance.php'; + } + + public function getCategory(): string + { + return 'admin'; + } } diff --git a/src/CoreBundle/Tool/Member.php b/src/CoreBundle/Tool/Member.php index 88df404f8d..ca93189590 100644 --- a/src/CoreBundle/Tool/Member.php +++ b/src/CoreBundle/Tool/Member.php @@ -6,6 +6,25 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Member extends AbstractTool +class Member extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'member'; + } + + public function getIcon(): string + { + return 'mdi-account'; + } + + public function getLink(): string + { + return '/main/user/user.php'; + } + + public function getCategory(): string + { + return 'interaction'; + } } diff --git a/src/CoreBundle/Tool/Notebook.php b/src/CoreBundle/Tool/Notebook.php index 1bcc10eac7..cf22565b7b 100644 --- a/src/CoreBundle/Tool/Notebook.php +++ b/src/CoreBundle/Tool/Notebook.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Notebook extends AbstractTool +use Chamilo\CourseBundle\Entity\CNotebook; + +class Notebook extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'notebook'; + } + + public function getIcon(): string + { + return 'mdi-note'; + } + + public function getLink(): string + { + return '/main/notebook/index.php'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getResourceTypes(): ?array + { + return [ + 'notebooks' => CNotebook::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Settings.php b/src/CoreBundle/Tool/Settings.php index ae13b47192..62bbf9e6ea 100644 --- a/src/CoreBundle/Tool/Settings.php +++ b/src/CoreBundle/Tool/Settings.php @@ -6,6 +6,25 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Settings extends AbstractTool +class Settings extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'course_setting'; + } + + public function getIcon(): string + { + return 'mdi-cog'; + } + + public function getLink(): string + { + return '/main/course_info/infocours.php'; + } + + public function getCategory(): string + { + return 'admin'; + } } diff --git a/src/CoreBundle/Tool/Shortcut.php b/src/CoreBundle/Tool/Shortcut.php index 636b8ef141..34423d737d 100644 --- a/src/CoreBundle/Tool/Shortcut.php +++ b/src/CoreBundle/Tool/Shortcut.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Shortcut extends AbstractTool +use Chamilo\CourseBundle\Entity\CShortcut; +use Chamilo\LtiBundle\Entity\ExternalTool; + +class Shortcut extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'shortcuts'; + } + + public function getIcon(): string + { + return 'mdi'; + } + + public function getLink(): string + { + return '/'; + } + + public function getCategory(): string + { + return 'admin'; + } + + public function getResourceTypes(): ?array + { + return [ + 'shortcuts' => CShortcut::class, + 'external_tools' => ExternalTool::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Survey.php b/src/CoreBundle/Tool/Survey.php index 1dab0e7edd..081377c370 100644 --- a/src/CoreBundle/Tool/Survey.php +++ b/src/CoreBundle/Tool/Survey.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Survey extends AbstractTool +use Chamilo\CourseBundle\Entity\CSurvey; +use Chamilo\CourseBundle\Entity\CSurveyQuestion; + +class Survey extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'survey'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getIcon(): string + { + return 'mdi-form-dropdown'; + } + + public function getLink(): string + { + return '/main/survey/survey_list.php'; + } + + public function getResourceTypes(): ?array + { + return [ + 'surveys' => CSurvey::class, + 'survey_questions' => CSurveyQuestion::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Tracking.php b/src/CoreBundle/Tool/Tracking.php index c6d5f3e448..479f42f170 100644 --- a/src/CoreBundle/Tool/Tracking.php +++ b/src/CoreBundle/Tool/Tracking.php @@ -6,6 +6,25 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Tracking extends AbstractTool +class Tracking extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'tracking'; + } + + public function getIcon(): string + { + return 'mdi-google-analytics'; + } + + public function getLink(): string + { + return '/main/tracking/courseLog.php'; + } + + public function getCategory(): string + { + return 'interaction'; + } } diff --git a/src/CoreBundle/Tool/User.php b/src/CoreBundle/Tool/User.php index d179379f0f..169d206660 100644 --- a/src/CoreBundle/Tool/User.php +++ b/src/CoreBundle/Tool/User.php @@ -6,6 +6,36 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class User extends AbstractTool +use Chamilo\CoreBundle\Entity\MessageAttachment; +use Chamilo\CoreBundle\Entity\PersonalFile; + +class User extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'user'; + } + + public function getIcon(): string + { + return 'mdi-user'; + } + + public function getLink(): string + { + return '/'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getResourceTypes(): ?array + { + return [ + 'files' => PersonalFile::class, + 'message_attachments' => MessageAttachment::class, + ]; + } } diff --git a/src/CoreBundle/Tool/UserGroup.php b/src/CoreBundle/Tool/UserGroup.php index cd691a8f39..2fc32a278b 100644 --- a/src/CoreBundle/Tool/UserGroup.php +++ b/src/CoreBundle/Tool/UserGroup.php @@ -6,6 +6,32 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class UserGroup extends AbstractTool +class UserGroup extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'usergroup'; + } + + public function getCategory(): string + { + return 'admin'; + } + + public function getIcon(): string + { + return 'mdi-xml'; + } + + public function getLink(): string + { + return '/resources/usergroup/'; + } + + public function getResourceTypes(): ?array + { + return [ + 'usergroups' => \Chamilo\CoreBundle\Entity\Usergroup::class, + ]; + } } diff --git a/src/CoreBundle/Tool/Wiki.php b/src/CoreBundle/Tool/Wiki.php index 42fbbc707b..3ca0b076f3 100644 --- a/src/CoreBundle/Tool/Wiki.php +++ b/src/CoreBundle/Tool/Wiki.php @@ -6,6 +6,34 @@ declare(strict_types=1); namespace Chamilo\CoreBundle\Tool; -class Wiki extends AbstractTool +use Chamilo\CourseBundle\Entity\CWiki; + +class Wiki extends AbstractTool implements ToolInterface { + public function getName(): string + { + return 'wiki'; + } + + public function getIcon(): string + { + return 'mdi-xml'; + } + + public function getLink(): string + { + return '/main/wiki/index.php'; + } + + public function getCategory(): string + { + return 'interaction'; + } + + public function getResourceTypes(): ?array + { + return [ + 'wikis' => CWiki::class, + ]; + } }