Total Complexity | 43 |
Total Lines | 874 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
Complex classes like IndexBlocksController often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use IndexBlocksController, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
30 | #[Security("is_granted('ROLE_ADMIN') or is_granted('ROLE_SESSION_MANAGER')")] |
||
31 | #[Route('/admin/index', name: 'admin_index_blocks')] |
||
32 | class IndexBlocksController extends BaseController |
||
33 | { |
||
34 | private bool $isAdmin = false; |
||
35 | private bool $isSessionAdmin = false; |
||
36 | private array $extAuthSource = []; |
||
37 | |||
38 | public function __construct( |
||
39 | private readonly TranslatorInterface $translator, |
||
40 | private readonly SettingsManager $settingsManager, |
||
41 | private readonly PageRepository $pageRepository, |
||
42 | private readonly PageCategoryRepository $pageCategoryRepository, |
||
43 | private readonly SerializerInterface $serializer, |
||
44 | private readonly EventDispatcherInterface $eventDispatcher, |
||
45 | private readonly PluginRepository $pluginRepository, |
||
46 | private readonly AccessUrlHelper $accessUrlHelper, |
||
47 | ) { |
||
48 | $this->extAuthSource = [ |
||
49 | 'extldap' => [], |
||
50 | 'ldap' => [], |
||
51 | ]; |
||
52 | } |
||
53 | |||
54 | public function __invoke(): JsonResponse |
||
55 | { |
||
56 | $this->isAdmin = $this->isGranted('ROLE_ADMIN'); |
||
57 | $this->isSessionAdmin = $this->isGranted('ROLE_SESSION_MANAGER'); |
||
58 | |||
59 | $json = []; |
||
60 | |||
61 | $adminBlockEvent = new AdminBlockDisplayedEvent($json, AbstractEvent::TYPE_PRE); |
||
62 | |||
63 | $this->eventDispatcher->dispatch($adminBlockEvent, Events::ADMIN_BLOCK_DISPLAYED); |
||
64 | |||
65 | $json = $adminBlockEvent->getData(); |
||
66 | |||
67 | $json['users'] = [ |
||
68 | 'id' => 'block-admin-users', |
||
69 | 'searchUrl' => '/main/admin/user_list.php', |
||
70 | 'editable' => $this->isAdmin, |
||
71 | 'items' => $this->getItemsUsers(), |
||
72 | 'extraContent' => $this->getExtraContent('block-admin-users'), |
||
73 | ]; |
||
74 | |||
75 | if ($this->isAdmin) { |
||
76 | $json['courses'] = [ |
||
77 | 'id' => 'block-admin-courses', |
||
78 | 'searchUrl' => '/main/admin/course_list.php', |
||
79 | 'editable' => true, |
||
80 | 'items' => $this->getItemsCourses(), |
||
81 | 'extraContent' => $this->getExtraContent('block-admin-courses'), |
||
82 | ]; |
||
83 | |||
84 | $json['platform'] = [ |
||
85 | 'id' => 'block-admin-platform', |
||
86 | 'searchUrl' => $this->generateUrl('chamilo_platform_settings_search'), |
||
87 | 'editable' => true, |
||
88 | 'items' => $this->getItemsPlatform(), |
||
89 | 'extraContent' => $this->getExtraContent('block-admin-platform'), |
||
90 | ]; |
||
91 | |||
92 | /* Settings */ |
||
93 | $json['settings'] = [ |
||
94 | 'id' => 'block-admin-settings', |
||
95 | 'editable' => false, |
||
96 | 'items' => $this->getItemsSettings(), |
||
97 | 'extraContent' => $this->getExtraContent('block-admin-settings'), |
||
98 | ]; |
||
99 | |||
100 | // Skills |
||
101 | if ('true' === $this->settingsManager->getSetting('skill.allow_skills_tool')) { |
||
102 | $json['skills'] = [ |
||
103 | 'id' => 'block-admin-skills', |
||
104 | 'editable' => false, |
||
105 | 'items' => $this->getItemsSkills(), |
||
106 | 'extraContent' => $this->getExtraContent('block-admin-skills'), |
||
107 | ]; |
||
108 | } |
||
109 | |||
110 | if ('true' === $this->settingsManager->getSetting('gradebook.gradebook_dependency')) { |
||
111 | $json['gradebook'] = [ |
||
112 | 'id' => 'block-admin-gradebook', |
||
113 | 'editable' => false, |
||
114 | 'items' => $this->getItemsGradebook(), |
||
115 | 'extraContent' => $this->getExtraContent('block-admin-gradebook'), |
||
116 | ]; |
||
117 | } |
||
118 | |||
119 | // Data protection |
||
120 | if ('true' !== $this->settingsManager->getSetting('privacy.disable_gdpr')) { |
||
121 | $json['data_privacy'] = [ |
||
122 | 'id' => 'block-admin-privacy', |
||
123 | 'editable' => false, |
||
124 | 'items' => $this->getItemsPrivacy(), |
||
125 | 'extraContent' => $this->getExtraContent('block-admin-privacy'), |
||
126 | ]; |
||
127 | } |
||
128 | |||
129 | $json['security'] = [ |
||
130 | 'id' => 'block-admin-security', |
||
131 | 'editable' => false, |
||
132 | 'items' => $this->getItemsSecurity(), |
||
133 | 'extraContent' => $this->getExtraContent('block-admin-security'), |
||
134 | ]; |
||
135 | |||
136 | /* Chamilo.org */ |
||
137 | $json['chamilo'] = [ |
||
138 | 'id' => 'block-admin-chamilo', |
||
139 | 'editable' => false, |
||
140 | 'items' => $this->getItemsChamilo(), |
||
141 | 'extraContent' => $this->getExtraContent('block-admin-chamilo'), |
||
142 | ]; |
||
143 | |||
144 | $json['plugins'] = [ |
||
145 | 'id' => 'block-admin-plugins', |
||
146 | 'editable' => false, |
||
147 | 'items' => $this->getItemsPlugins(), |
||
148 | ]; |
||
149 | } |
||
150 | |||
151 | /* Sessions */ |
||
152 | $json['sessions'] = [ |
||
153 | 'id' => 'block-admin-sessions', |
||
154 | 'searchUrl' => '/main/session/session_list.php', |
||
155 | 'editable' => $this->isAdmin, |
||
156 | 'items' => $this->getItemsSessions(), |
||
157 | 'extraContent' => $this->getExtraContent('block-admin-sessions'), |
||
158 | ]; |
||
159 | |||
160 | $adminBlockEvent = new AdminBlockDisplayedEvent($json, AbstractEvent::TYPE_POST); |
||
161 | |||
162 | $this->eventDispatcher->dispatch($adminBlockEvent, Events::ADMIN_BLOCK_DISPLAYED); |
||
163 | |||
164 | $json = $adminBlockEvent->getData(); |
||
165 | |||
166 | return $this->json($json); |
||
167 | } |
||
168 | |||
169 | private function getItemsSecurity(): array |
||
170 | { |
||
171 | return [ |
||
172 | [ |
||
173 | 'class' => 'item-security-login-attempts', |
||
174 | 'url' => $this->generateUrl('admin_security_login_attempts'), |
||
175 | 'label' => $this->translator->trans('Login attempts'), |
||
176 | ], |
||
177 | ]; |
||
178 | } |
||
179 | |||
180 | private function getItemsUsers(): array |
||
181 | { |
||
182 | $items = []; |
||
183 | $items[] = [ |
||
184 | 'class' => 'item-user-list', |
||
185 | 'url' => '/main/admin/user_list.php', |
||
186 | 'label' => $this->translator->trans('User list'), |
||
187 | ]; |
||
188 | $items[] = [ |
||
189 | 'class' => 'item-user-add', |
||
190 | 'url' => '/main/admin/user_add.php', |
||
191 | 'label' => $this->translator->trans('Add a user'), |
||
192 | ]; |
||
193 | |||
194 | if ($this->isAdmin) { |
||
195 | $items[] = [ |
||
196 | 'class' => 'item-user-export', |
||
197 | 'url' => '/main/admin/user_export.php', |
||
198 | 'label' => $this->translator->trans('Export users list'), |
||
199 | ]; |
||
200 | $items[] = [ |
||
201 | 'class' => 'item-user-import', |
||
202 | 'url' => '/main/admin/user_import.php', |
||
203 | 'label' => $this->translator->trans('Import users list'), |
||
204 | ]; |
||
205 | $items[] = [ |
||
206 | 'class' => 'item-user-import-update', |
||
207 | 'url' => '/main/admin/user_update_import.php', |
||
208 | 'label' => $this->translator->trans('Edit users list'), |
||
209 | ]; |
||
210 | $items[] = [ |
||
211 | 'class' => 'item-user-import-anonymize', |
||
212 | 'url' => '/main/admin/user_anonymize_import.php', |
||
213 | 'label' => $this->translator->trans('Anonymise users list'), |
||
214 | ]; |
||
215 | |||
216 | if (\count($this->extAuthSource['extldap']) > 0) { |
||
217 | $items[] = [ |
||
218 | 'class' => 'item-user-ldap-list', |
||
219 | 'url' => '/main/admin/ldap_users_list.php', |
||
220 | 'label' => $this->translator->trans('Import LDAP users into the platform'), |
||
221 | ]; |
||
222 | } |
||
223 | |||
224 | $items[] = [ |
||
225 | 'class' => 'item-user-field', |
||
226 | 'url' => '/main/admin/extra_fields.php?'.http_build_query(['type' => 'user']), |
||
227 | 'label' => $this->translator->trans('Profiling'), |
||
228 | ]; |
||
229 | $items[] = [ |
||
230 | 'class' => 'item-user-groups', |
||
231 | 'url' => '/main/admin/usergroups.php', |
||
232 | 'label' => $this->translator->trans('Classes'), |
||
233 | ]; |
||
234 | |||
235 | if ('true' === $this->settingsManager->getSetting('admin.show_link_request_hrm_user')) { |
||
236 | $items[] = [ |
||
237 | 'class' => 'item-user-linking-requests', |
||
238 | 'url' => '/main/admin/user_linking_requests.php', |
||
239 | 'label' => $this->translator->trans('Student linking requests'), |
||
240 | ]; |
||
241 | } |
||
242 | } else { |
||
243 | $items[] = [ |
||
244 | 'class' => 'item-user-import', |
||
245 | 'url' => '/main/admin/user_import.php', |
||
246 | 'label' => $this->translator->trans('Import users list'), |
||
247 | ]; |
||
248 | $items[] = [ |
||
249 | 'class' => 'item-user-groups', |
||
250 | 'url' => '/main/admin/usergroups.php', |
||
251 | 'label' => $this->translator->trans('Classes'), |
||
252 | ]; |
||
253 | |||
254 | if ('true' === $this->settingsManager->getSetting('session.limit_session_admin_role')) { |
||
255 | $items = array_filter($items, function (array $item) { |
||
256 | $urls = [ |
||
257 | '/main/admin/user_list.php', |
||
258 | '/main/admin/user_add.php', |
||
259 | ]; |
||
260 | |||
261 | return \in_array($item['url'], $urls, true); |
||
262 | }); |
||
263 | } |
||
264 | |||
265 | if ('true' === $this->settingsManager->getSetting('session.limit_session_admin_list_users')) { |
||
266 | $items = array_filter($items, function (array $item): bool { |
||
267 | $urls = [ |
||
268 | '/main/admin/user_list.php', |
||
269 | ]; |
||
270 | |||
271 | return !\in_array($item['url'], $urls, true); |
||
272 | }); |
||
273 | } |
||
274 | |||
275 | if ('true' === $this->settingsManager->getSetting('session.allow_session_admin_extra_access')) { |
||
276 | $items[] = [ |
||
277 | 'class' => 'item-user-import-update', |
||
278 | 'url' => '/main/admin/user_update_import.php', |
||
279 | 'label' => $this->translator->trans('Edit users list'), |
||
280 | ]; |
||
281 | $items[] = [ |
||
282 | 'class' => 'item-user-export', |
||
283 | 'url' => '/main/admin/user_export.php', |
||
284 | 'label' => $this->translator->trans('Export users list'), |
||
285 | ]; |
||
286 | } |
||
287 | } |
||
288 | |||
289 | return array_values($items); |
||
290 | } |
||
291 | |||
292 | private function getExtraContent(string $title): ?array |
||
293 | { |
||
294 | /** @var Page|null $page */ |
||
295 | $page = $this->pageRepository->findOneBy(['title' => $title]); |
||
296 | |||
297 | $pageJsonld = $this->serializer->serialize($page, 'jsonld', ['groups' => ['adminblock:read']]); |
||
298 | $pageArray = json_decode($pageJsonld, true); |
||
299 | |||
300 | if ($page) { |
||
301 | return $pageArray; |
||
302 | } |
||
303 | |||
304 | /** @var PageCategory $category */ |
||
305 | $category = $this->pageCategoryRepository->findOneBy(['title' => $title]); |
||
306 | $categoryJsonld = $this->serializer->serialize($category, 'jsonld', ['groups' => ['page:read']]); |
||
307 | $categoryArray = json_decode($categoryJsonld, true); |
||
308 | |||
309 | if (empty($categoryArray)) { |
||
310 | return []; |
||
311 | } |
||
312 | |||
313 | return [ |
||
314 | 'category' => $categoryArray['@id'], |
||
315 | ]; |
||
316 | } |
||
317 | |||
318 | private function getItemsCourses(): array |
||
413 | } |
||
414 | |||
415 | private function getItemsPlatform(): array |
||
416 | { |
||
417 | $items = []; |
||
418 | $items[] = [ |
||
419 | 'class' => 'item-setting-list', |
||
420 | 'url' => $this->generateUrl('admin_settings'), |
||
421 | 'label' => $this->translator->trans('Configuration settings'), |
||
422 | ]; |
||
423 | $items[] = [ |
||
424 | 'class' => 'item-language-list', |
||
425 | 'url' => '/main/admin/languages.php', |
||
426 | 'label' => $this->translator->trans('Languages'), |
||
427 | ]; |
||
428 | $items[] = [ |
||
429 | 'class' => 'item-plugin-list', |
||
430 | 'url' => '/main/admin/settings.php?'.http_build_query(['category' => 'Plugins']), |
||
431 | 'label' => $this->translator->trans('Plugins'), |
||
432 | ]; |
||
433 | $items[] = [ |
||
434 | 'class' => 'item-region-list', |
||
435 | 'url' => '/main/admin/settings.php?'.http_build_query(['category' => 'Regions']), |
||
436 | 'label' => $this->translator->trans('Regions'), |
||
437 | ]; |
||
438 | $items[] = [ |
||
439 | 'class' => 'item-global-announcement', |
||
440 | 'url' => '/main/admin/system_announcements.php', |
||
441 | 'label' => $this->translator->trans('Portal news'), |
||
442 | ]; |
||
443 | $items[] = [ |
||
444 | 'class' => 'item-global-agenda', |
||
445 | 'route' => ['name' => 'CCalendarEventList', 'query' => ['type' => 'global']], |
||
446 | 'label' => $this->translator->trans('Global agenda'), |
||
447 | ]; |
||
448 | $items[] = [ |
||
449 | 'class' => 'item-agenda-reminders', |
||
450 | 'url' => '/main/admin/import_course_agenda_reminders.php', |
||
451 | 'label' => $this->translator->trans('Import course events'), |
||
452 | ]; |
||
453 | $items[] = [ |
||
454 | 'class' => 'item-pages-list', |
||
455 | 'route' => ['name' => 'PageList'], |
||
456 | 'label' => $this->translator->trans('Pages'), |
||
457 | ]; |
||
458 | /* |
||
459 | * Disabled until differentiated with Pages, and reviewed - see GH#6404 |
||
460 | $items[] = [ |
||
461 | 'class' => 'item-page-layouts', |
||
462 | 'route' => ['name' => 'PageLayoutList'], |
||
463 | 'label' => $this->translator->trans('Page layouts'), |
||
464 | ]; |
||
465 | */ |
||
466 | $items[] = [ |
||
467 | 'class' => 'item-registration-page', |
||
468 | 'url' => '/main/auth/registration.php?'.http_build_query(['create_intro_page' => 1]), |
||
469 | 'label' => $this->translator->trans('Setting the registration page'), |
||
470 | ]; |
||
471 | $items[] = [ |
||
472 | 'class' => 'item-stats', |
||
473 | 'url' => '/main/admin/statistics/index.php', |
||
474 | 'label' => $this->translator->trans('Statistics'), |
||
475 | ]; |
||
476 | $items[] = [ |
||
477 | 'class' => 'item-stats-report', |
||
478 | 'url' => '/main/my_space/company_reports.php', |
||
479 | 'label' => $this->translator->trans('Reports'), |
||
480 | ]; |
||
481 | $items[] = [ |
||
482 | 'class' => 'item-teacher-time-report', |
||
483 | 'url' => '/main/admin/teacher_time_report.php', |
||
484 | 'label' => $this->translator->trans('Teachers time report'), |
||
485 | ]; |
||
486 | |||
487 | if (api_get_configuration_value('chamilo_cms')) { |
||
488 | $items[] = [ |
||
489 | 'class' => 'item-cms', |
||
490 | 'url' => api_get_path(WEB_PATH).'web/app_dev.php/administration/dashboard', |
||
491 | 'label' => $this->translator->trans('CMS'), |
||
492 | ]; |
||
493 | } |
||
494 | |||
495 | /* Event settings */ |
||
496 | |||
497 | $items[] = [ |
||
498 | 'class' => 'item-field', |
||
499 | 'url' => '/main/admin/extra_field_list.php', |
||
500 | 'label' => $this->translator->trans('Extra fields'), |
||
501 | ]; |
||
502 | |||
503 | if (api_is_global_platform_admin()) { |
||
504 | $items[] = [ |
||
505 | 'class' => 'item-access-url', |
||
506 | 'url' => '/main/admin/access_urls.php', |
||
507 | 'label' => $this->translator->trans('Configure multiple access URL'), |
||
508 | ]; |
||
509 | } |
||
510 | |||
511 | if ('true' === api_get_plugin_setting('dictionary', 'enable_plugin_dictionary')) { |
||
512 | $items[] = [ |
||
513 | 'class' => 'item-dictionary', |
||
514 | 'url' => api_get_path(WEB_PLUGIN_PATH).'Dictionary/terms.php', |
||
515 | 'label' => $this->translator->trans('Dictionary'), |
||
516 | ]; |
||
517 | } |
||
518 | |||
519 | if ('true' === $this->settingsManager->getSetting('registration.allow_terms_conditions', true)) { |
||
520 | $items[] = [ |
||
521 | 'class' => 'item-terms-and-conditions', |
||
522 | 'route' => ['name' => 'TermsConditionsList'], |
||
523 | 'label' => $this->translator->trans('Terms and Conditions'), |
||
524 | ]; |
||
525 | } |
||
526 | |||
527 | $items[] = [ |
||
528 | 'class' => 'item-mail-template', |
||
529 | 'url' => '/main/mail_template/list.php', |
||
530 | 'label' => $this->translator->trans('Mail templates'), |
||
531 | ]; |
||
532 | |||
533 | if ('true' === api_get_setting('platform.notification_event')) { |
||
534 | $items[] = [ |
||
535 | 'class' => 'item-notification-list', |
||
536 | 'url' => '/main/notification_event/list.php', |
||
537 | 'label' => $this->translator->trans('Notifications'), |
||
538 | ]; |
||
539 | } |
||
540 | |||
541 | $allowJustification = 'true' === api_get_plugin_setting('justification', 'tool_enable'); |
||
542 | |||
543 | if ($allowJustification) { |
||
544 | $items[] = [ |
||
545 | 'class' => 'item-justification-list', |
||
546 | 'url' => api_get_path(WEB_PLUGIN_PATH).'Justification/list.php', |
||
547 | 'label' => $this->translator->trans('Justification'), |
||
548 | ]; |
||
549 | } |
||
550 | |||
551 | $items[] = [ |
||
552 | 'class' => 'item-lti-admin', |
||
553 | 'url' => $this->generateUrl('chamilo_lti_admin'), |
||
554 | 'label' => $this->translator->trans('External tools (LTI)'), |
||
555 | ]; |
||
556 | |||
557 | $items[] = [ |
||
558 | 'class' => 'item-contact-category-admin', |
||
559 | 'url' => $this->generateUrl('chamilo_contact_category_index'), |
||
560 | 'label' => $this->translator->trans('Contact form categories'), |
||
561 | ]; |
||
562 | |||
563 | $items[] = [ |
||
564 | 'class' => 'item-system-template-admin', |
||
565 | 'url' => '/main/admin/settings.php?'.http_build_query(['category' => 'Templates']), |
||
566 | 'label' => $this->translator->trans('System templates'), |
||
567 | ]; |
||
568 | |||
569 | return $items; |
||
570 | } |
||
571 | |||
572 | private function getItemsSettings(): array |
||
573 | { |
||
574 | $items = []; |
||
575 | $items[] = [ |
||
576 | 'class' => 'item-cleanup-temp-uploads', |
||
577 | 'url' => '/admin/cleanup-temp-uploads', |
||
578 | 'label' => $this->translator->trans('Clean temporary files'), |
||
579 | ]; |
||
580 | |||
581 | $items[] = [ |
||
582 | 'class' => 'item-special-export', |
||
583 | 'url' => '/main/admin/special_exports.php', |
||
584 | 'label' => $this->translator->trans('Special exports'), |
||
585 | ]; |
||
586 | /*$items[] = [ |
||
587 | 'url' => '/main/admin/periodic_export.php', |
||
588 | 'label' => $this->translator->$this->trans('Periodic export'), |
||
589 | ];*/ |
||
590 | $items[] = [ |
||
591 | 'class' => 'item-system-status', |
||
592 | 'url' => '/main/admin/system_status.php', |
||
593 | 'label' => $this->translator->trans('System status'), |
||
594 | ]; |
||
595 | if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) { |
||
596 | $items[] = [ |
||
597 | 'class' => 'item-data-filler', |
||
598 | 'url' => '/main/admin/filler.php', |
||
599 | 'label' => $this->translator->trans('Data filler'), |
||
600 | ]; |
||
601 | } |
||
602 | |||
603 | if (is_dir(api_get_path(SYS_TEST_PATH))) { |
||
604 | $items[] = [ |
||
605 | 'class' => 'item-email-tester', |
||
606 | 'url' => '/main/admin/email_tester.php', |
||
607 | 'label' => $this->translator->trans('E-mail tester'), |
||
608 | ]; |
||
609 | } |
||
610 | |||
611 | $items[] = [ |
||
612 | 'class' => 'item-ticket-system', |
||
613 | 'url' => '/main/ticket/tickets.php', |
||
614 | 'label' => $this->translator->trans('Tickets'), |
||
615 | ]; |
||
616 | |||
617 | $items[] = [ |
||
618 | 'url' => '/main/session/cron_status.php', |
||
619 | 'label' => $this->translator->trans('Update session status'), |
||
620 | ]; |
||
621 | |||
622 | $items[] = [ |
||
623 | 'class' => 'item-colors', |
||
624 | 'route' => ['name' => 'AdminConfigurationColors'], |
||
625 | 'label' => $this->translator->trans('Colors'), |
||
626 | ]; |
||
627 | |||
628 | $items[] = [ |
||
629 | 'class' => 'item-file-info', |
||
630 | 'url' => '/admin/files_info', |
||
631 | 'label' => $this->translator->trans('File info'), |
||
632 | ]; |
||
633 | |||
634 | $items[] = [ |
||
635 | 'class' => 'item-resources-info', |
||
636 | 'url' => '/admin/resources_info', |
||
637 | 'label' => $this->translator->trans('Resources by type'), |
||
638 | ]; |
||
639 | |||
640 | return $items; |
||
641 | } |
||
642 | |||
643 | private function getItemsSkills(): array |
||
644 | { |
||
645 | $items = []; |
||
646 | $items[] = [ |
||
647 | 'class' => 'item-skill-wheel', |
||
648 | 'route' => ['name' => 'SkillWheel'], |
||
649 | 'label' => $this->translator->trans('Skills wheel'), |
||
650 | ]; |
||
651 | $items[] = [ |
||
652 | 'class' => 'item-skill-import', |
||
653 | 'url' => '/main/skills/skills_import.php', |
||
654 | 'label' => $this->translator->trans('Skills import'), |
||
655 | ]; |
||
656 | $items[] = [ |
||
657 | 'class' => 'item-skill-list', |
||
658 | 'url' => '/main/skills/skill_list.php', |
||
659 | 'label' => $this->translator->trans('Manage skills'), |
||
660 | ]; |
||
661 | $items[] = [ |
||
662 | 'class' => 'item-skill-level', |
||
663 | 'url' => '/main/skills/skill.php', |
||
664 | 'label' => $this->translator->trans('Manage skills levels'), |
||
665 | ]; |
||
666 | |||
667 | $items[] = [ |
||
668 | 'class' => 'item-skill-ranking', |
||
669 | 'url' => '/main/social/skills_ranking.php', |
||
670 | 'label' => $this->translator->trans('Skills ranking'), |
||
671 | ]; |
||
672 | $items[] = [ |
||
673 | 'class' => 'item-skill-gradebook', |
||
674 | 'url' => '/main/skills/skills_gradebook.php', |
||
675 | 'label' => $this->translator->trans('Skills and assessments'), |
||
676 | ]; |
||
677 | |||
678 | /*$items[] = [ |
||
679 | 'url' => '/main/admin/skill_badge.php', |
||
680 | 'label' => $this->translator->trans('Badges'), |
||
681 | ];*/ |
||
682 | |||
683 | return $items; |
||
684 | } |
||
685 | |||
686 | private function getItemsGradebook(): array |
||
687 | { |
||
688 | $items = []; |
||
689 | $items[] = [ |
||
690 | 'class' => 'item-gradebook-list', |
||
691 | 'url' => '/main/admin/gradebook_list.php', |
||
692 | 'label' => $this->translator->trans('List'), |
||
693 | ]; |
||
694 | |||
695 | return $items; |
||
696 | } |
||
697 | |||
698 | private function getItemsPrivacy(): array |
||
699 | { |
||
700 | $items = []; |
||
701 | $items[] = [ |
||
702 | 'class' => 'item-privacy-consent', |
||
703 | 'url' => '/main/admin/user_list_consent.php', |
||
704 | 'label' => $this->translator->trans('User list'), |
||
705 | ]; |
||
706 | $items[] = [ |
||
707 | 'class' => 'item-gdpr-parties', |
||
708 | 'route' => ['name' => 'ThirdPartyManager'], |
||
709 | 'label' => $this->translator->trans('Third parties (GDPR)'), |
||
710 | ]; |
||
711 | |||
712 | return $items; |
||
713 | } |
||
714 | |||
715 | private function getItemsChamilo(): array |
||
787 | } |
||
788 | |||
789 | private function getItemsSessions(): array |
||
790 | { |
||
791 | $items = []; |
||
875 | } |
||
876 | |||
877 | private function getItemsPlugins(): array |
||
904 | } |
||
905 | } |
||
906 |