| Total Complexity | 78 |
| Total Lines | 664 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Complex classes like HomeController 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 HomeController, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 21 | class HomeController extends ToolBaseController |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @Route("/", name="course_home") |
||
| 25 | * @Route("/index.php", methods={"GET"}) |
||
| 26 | * |
||
| 27 | * @param Request $request |
||
| 28 | * |
||
| 29 | * @return Response |
||
| 30 | */ |
||
| 31 | public function indexAction(Request $request) |
||
| 32 | { |
||
| 33 | $sessionId = api_get_session_id(); |
||
| 34 | $course = $this->getCourse(); |
||
| 35 | $courseCode = $course->getId(); |
||
| 36 | $result = $this->autoLaunch(); |
||
| 37 | |||
| 38 | $showAutoLaunchLpWarning = $result['show_autolaunch_lp_warning']; |
||
| 39 | $showAutoLaunchExerciseWarning = $result['show_autolaunch_exercise_warning']; |
||
| 40 | |||
| 41 | if ($showAutoLaunchLpWarning) { |
||
| 42 | $this->addFlash( |
||
| 43 | 'warning', |
||
| 44 | $this->trans('TheLPAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificLP') |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | if ($showAutoLaunchExerciseWarning) { |
||
| 49 | $this->addFlash( |
||
| 50 | 'warning', |
||
| 51 | $this->trans('TheExerciseAutoLaunchSettingIsONStudentsWillBeRedirectToAnSpecificExercise') |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | if (true) { |
||
| 56 | $editIcons = Display::url( |
||
| 57 | Display::return_icon('edit.png'), |
||
| 58 | $this->generateUrl( |
||
| 59 | 'chamilo_course_home_home_iconlist', |
||
| 60 | [ |
||
| 61 | 'course' => api_get_course_id(), |
||
| 62 | ] |
||
| 63 | ) |
||
| 64 | ); |
||
| 65 | } |
||
| 66 | |||
| 67 | $isSpecialCourse = \CourseManager::isSpecialCourse($courseCode); |
||
| 68 | |||
| 69 | if ($isSpecialCourse) { |
||
| 70 | $user = $this->getUser(); |
||
| 71 | if (!empty($user)) { |
||
| 72 | $userId = $this->getUser()->getId(); |
||
| 73 | $autoreg = $request->get('autoreg'); |
||
| 74 | if ($autoreg == 1) { |
||
| 75 | \CourseManager::subscribeUser( |
||
| 76 | $userId, |
||
| 77 | $courseCode, |
||
| 78 | STUDENT |
||
| 79 | ); |
||
| 80 | } |
||
| 81 | } |
||
| 82 | } |
||
| 83 | |||
| 84 | //$homeView = api_get_setting('course.homepage_view'); |
||
| 85 | $blocks = $this->renderActivityView(); |
||
| 86 | |||
| 87 | $toolList = $result['tool_list']; |
||
| 88 | |||
| 89 | $introduction = Display::return_introduction_section( |
||
| 90 | TOOL_COURSE_HOMEPAGE, |
||
| 91 | $toolList |
||
| 92 | ); |
||
| 93 | |||
| 94 | $sessionInfo = null; |
||
| 95 | if (api_get_setting('session.show_session_data') == 'true' && $sessionId) { |
||
| 96 | $sessionInfo = CourseHome::show_session_data($sessionId); |
||
| 97 | } |
||
| 98 | |||
| 99 | return $this->render( |
||
| 100 | 'ChamiloCourseBundle:Home:index.html.twig', |
||
| 101 | [ |
||
| 102 | 'course' => $course, |
||
| 103 | 'session_info' => $sessionInfo, |
||
| 104 | 'icons' => $result['content'], |
||
| 105 | 'blocks' => $blocks, |
||
| 106 | 'edit_icons' => $editIcons, |
||
|
|
|||
| 107 | 'introduction_text' => $introduction, |
||
| 108 | 'exercise_warning' => null, |
||
| 109 | 'lp_warning' => null, |
||
| 110 | ] |
||
| 111 | ); |
||
| 112 | } |
||
| 113 | |||
| 114 | /** |
||
| 115 | * @Route("/show/{iconId}", methods={"GET"}) |
||
| 116 | * |
||
| 117 | * @param $iconId |
||
| 118 | * |
||
| 119 | * @return string|null |
||
| 120 | */ |
||
| 121 | public function showIconAction($iconId) |
||
| 134 | } |
||
| 135 | |||
| 136 | /** |
||
| 137 | * @Route("/hide/{iconId}", methods={"GET"}) |
||
| 138 | * |
||
| 139 | * @param $iconId |
||
| 140 | * |
||
| 141 | * @return string|null |
||
| 142 | */ |
||
| 143 | public function hideIconAction($iconId) |
||
| 144 | { |
||
| 145 | if (!$this->isCourseTeacher()) { |
||
| 146 | return $this->abort(404); |
||
| 147 | } |
||
| 148 | |||
| 149 | $entityManager = $this->getDoctrine()->getManager(); |
||
| 150 | $criteria = ['cId' => api_get_course_int_id(), 'id' => $iconId]; |
||
| 151 | $tool = $this->getRepository( |
||
| 152 | 'Chamilo\CourseBundle\Entity\CTool' |
||
| 153 | )->findOneBy($criteria); |
||
| 154 | if ($tool) { |
||
| 155 | $tool->setVisibility(0); |
||
| 156 | } |
||
| 157 | $entityManager->persist($tool); |
||
| 158 | //$entityManager->flush(); |
||
| 159 | return Display::return_message(get_lang('The tool is now invisible.'), 'confirmation'); |
||
| 160 | } |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @Route("/delete/{iconId}", methods={"GET"}) |
||
| 164 | * |
||
| 165 | * @param $iconId |
||
| 166 | * |
||
| 167 | * @return string|null |
||
| 168 | */ |
||
| 169 | public function deleteIcon($iconId) |
||
| 170 | { |
||
| 171 | if (!$this->isCourseTeacher()) { |
||
| 172 | return $this->abort(404); |
||
| 173 | } |
||
| 174 | |||
| 175 | $entityManager = $this->getDoctrine()->getManager(); |
||
| 176 | $criteria = ['cId' => api_get_course_int_id(), 'id' => $iconId, 'added_tool' => 1]; |
||
| 177 | $tool = $this->getRepository( |
||
| 178 | 'Chamilo\CourseBundle\Entity\CTool' |
||
| 179 | )->findOneBy($criteria); |
||
| 180 | $entityManager->remove($tool); |
||
| 181 | //$entityManager->flush(); |
||
| 182 | return Display::return_message(get_lang('Deleted'), 'confirmation'); |
||
| 183 | } |
||
| 184 | |||
| 185 | /** |
||
| 186 | * @Route("/icon_list", methods={"GET"}) |
||
| 187 | * |
||
| 188 | * @param Request $request |
||
| 189 | */ |
||
| 190 | public function iconListAction(Request $request) |
||
| 191 | { |
||
| 192 | $em = $this->getDoctrine()->getManager(); |
||
| 193 | $repo = $this->getDoctrine()->getRepository('ChamiloCourseBundle:CTool'); |
||
| 194 | |||
| 195 | $sessionId = intval($request->get('id_session')); |
||
| 196 | $itemsFromSession = []; |
||
| 197 | if (!empty($sessionId)) { |
||
| 198 | $query = $repo->createQueryBuilder('a'); |
||
| 199 | $query->select('s'); |
||
| 200 | $query->from('Chamilo\CourseBundle\Entity\CTool', 's'); |
||
| 201 | $query->where('s.cId = :courseId AND s.sessionId = :sessionId') |
||
| 202 | ->setParameters( |
||
| 203 | [ |
||
| 204 | 'course' => $this->getCourse()->getId(), |
||
| 205 | 'sessionId' => $sessionId, |
||
| 206 | ] |
||
| 207 | ); |
||
| 208 | $itemsFromSession = $query->getQuery()->getResult(); |
||
| 209 | |||
| 210 | $itemNameList = []; |
||
| 211 | foreach ($itemsFromSession as $item) { |
||
| 212 | $itemNameList[] = $item->getName(); |
||
| 213 | } |
||
| 214 | |||
| 215 | //$itemsFromSession = $this->getRepository()->findBy($criteria); |
||
| 216 | $query = $repo->createQueryBuilder('a'); |
||
| 217 | $query->select('s'); |
||
| 218 | $query->from('Chamilo\CourseBundle\Entity\CTool', 's'); |
||
| 219 | $query->where('s.cId = :courseId AND s.sessionId = 0') |
||
| 220 | ->setParameters( |
||
| 221 | [ |
||
| 222 | 'courseId' => $this->getCourse()->getId(), |
||
| 223 | ] |
||
| 224 | ); |
||
| 225 | if (!empty($itemNameList)) { |
||
| 226 | $query->andWhere($query->expr()->notIn('s.name', $itemNameList)); |
||
| 227 | } |
||
| 228 | $itemsFromCourse = $query->getQuery()->getResult(); |
||
| 229 | } else { |
||
| 230 | $criteria = ['cId' => $this->getCourse()->getId(), 'sessionId' => 0]; |
||
| 231 | $itemsFromCourse = $repo->findBy($criteria); |
||
| 232 | } |
||
| 233 | |||
| 234 | return $this->render( |
||
| 235 | '@ChamiloCourse/Home/list.html.twig', |
||
| 236 | [ |
||
| 237 | 'items_from_course' => $itemsFromCourse, |
||
| 238 | 'items_from_session' => $itemsFromSession, |
||
| 239 | 'links' => '', |
||
| 240 | ] |
||
| 241 | ); |
||
| 242 | } |
||
| 243 | |||
| 244 | /** |
||
| 245 | * @Route("/{itemName}/add", methods={"GET", "POST"}) |
||
| 246 | * |
||
| 247 | * @param $itemName |
||
| 248 | * |
||
| 249 | * @return mixed |
||
| 250 | */ |
||
| 251 | public function addIconAction($itemName) |
||
| 252 | { |
||
| 253 | if (!$this->isCourseTeacher()) { |
||
| 254 | return $this->abort(404); |
||
| 255 | } |
||
| 256 | |||
| 257 | $sessionId = intval($this->getRequest()->get('id_session')); |
||
| 258 | |||
| 259 | if (empty($sessionId)) { |
||
| 260 | return $this->abort(500); |
||
| 261 | } |
||
| 262 | |||
| 263 | $criteria = ['cId' => $this->getCourse()->getId(), 'sessionId' => 0, 'name' => $itemName]; |
||
| 264 | $itemFromDatabase = $this->getRepository()->findOneBy($criteria); |
||
| 265 | |||
| 266 | if (!$itemFromDatabase) { |
||
| 267 | $this->createNotFoundException(); |
||
| 268 | } |
||
| 269 | /** @var CTool $item */ |
||
| 270 | $item = clone $itemFromDatabase; |
||
| 271 | $item->setId(null); |
||
| 272 | $item->setSessionId($sessionId); |
||
| 273 | $form = $this->createForm($this->getFormType(), $item); |
||
| 274 | |||
| 275 | $form->handleRequest($this->getRequest()); |
||
| 276 | |||
| 277 | if ($form->isValid()) { |
||
| 278 | $query = $this->getDoctrine()->getManager()->createQueryBuilder('a'); |
||
| 279 | $query->select('MAX(s.id) as id'); |
||
| 280 | $query->from('Chamilo\CourseBundle\Entity\CTool', 's'); |
||
| 281 | $query->where('s.cId = :courseId')->setParameter('courseId', $this->getCourse()->getId()); |
||
| 282 | $result = $query->getQuery()->getArrayResult(); |
||
| 283 | $maxId = $result[0]['id'] + 1; |
||
| 284 | $item->setId($maxId); |
||
| 285 | |||
| 286 | $entityManager = $this->getDoctrine()->getManager(); |
||
| 287 | $entityManager->persist($item); |
||
| 288 | $entityManager->flush(); |
||
| 289 | $customIcon = $item->getCustomIcon(); |
||
| 290 | if (!empty($customIcon)) { |
||
| 291 | $item->createGrayIcon($this->get('imagine')); |
||
| 292 | } |
||
| 293 | |||
| 294 | $this->get('session')->getFlashBag()->add('success', "Added"); |
||
| 295 | $url = $this->generateUrl('course_home.controller:iconListAction', ['id_session' => $sessionId]); |
||
| 296 | |||
| 297 | return $this->redirect($url); |
||
| 298 | } |
||
| 299 | |||
| 300 | $this->getTemplate()->assign('item', $item); |
||
| 301 | $this->getTemplate()->assign('form', $form->createView()); |
||
| 302 | $this->getTemplate()->assign('links', $this->generateLinks()); |
||
| 303 | |||
| 304 | return $this->render('@ChamiloCourse/Home/add.html.twig'); |
||
| 305 | } |
||
| 306 | |||
| 307 | /** |
||
| 308 | * @Route("/{itemId}/edit", methods={"GET"}) |
||
| 309 | */ |
||
| 310 | public function editIconAction($itemId) |
||
| 311 | { |
||
| 312 | if (!$this->isCourseTeacher()) { |
||
| 313 | return $this->abort(404); |
||
| 314 | } |
||
| 315 | |||
| 316 | $sessionId = intval($this->getRequest()->get('id_session')); |
||
| 317 | |||
| 318 | $criteria = ['cId' => $this->getCourse()->getId(), 'id' => $itemId]; |
||
| 319 | /** @var CTool $item */ |
||
| 320 | $item = $this->getRepository()->findOneBy($criteria); |
||
| 321 | |||
| 322 | $form = $this->createForm($this->getFormType(), $item); |
||
| 323 | $form->handleRequest($this->getRequest()); |
||
| 324 | |||
| 325 | if ($form->isValid()) { |
||
| 326 | $entityManager = $this->getDoctrine()->getManager(); |
||
| 327 | $entityManager->persist($item); |
||
| 328 | $entityManager->flush(); |
||
| 329 | |||
| 330 | $customIcon = $item->getCustomIcon(); |
||
| 331 | if (!empty($customIcon)) { |
||
| 332 | $item->createGrayIcon($this->get('imagine')); |
||
| 333 | } |
||
| 334 | |||
| 335 | $this->get('session')->getFlashBag()->add('success', "Updated"); |
||
| 336 | $url = $this->generateUrl('course_home.controller:iconListAction', ['id_session' => $sessionId]); |
||
| 337 | |||
| 338 | return $this->redirect($url); |
||
| 339 | } |
||
| 340 | |||
| 341 | $this->getTemplate()->assign('item', $item); |
||
| 342 | $this->getTemplate()->assign('form', $form->createView()); |
||
| 343 | $this->getTemplate()->assign('links', $this->generateLinks()); |
||
| 344 | |||
| 345 | return $this->render('@ChamiloCourse/Home/edit.html.twig'); |
||
| 346 | } |
||
| 347 | |||
| 348 | /** |
||
| 349 | * @Route("/{itemId}/delete", methods={"GET"}) |
||
| 350 | */ |
||
| 351 | public function deleteIconAction($itemId) |
||
| 352 | { |
||
| 353 | if (!$this->isCourseTeacher()) { |
||
| 354 | return $this->abort(404); |
||
| 355 | } |
||
| 356 | |||
| 357 | $criteria = ['cId' => $this->getCourse()->getId(), 'id' => $itemId]; |
||
| 358 | |||
| 359 | /** @var CTool $item */ |
||
| 360 | $item = $this->getRepository()->findOneBy($criteria); |
||
| 361 | $entityManager = $this->getDoctrine()->getManager(); |
||
| 362 | $sessionId = $item->getSessionId(); |
||
| 363 | if (!empty($sessionId)) { |
||
| 364 | $entityManager->remove($item); |
||
| 365 | } else { |
||
| 366 | $item->setCustomIcon(null); |
||
| 367 | $entityManager->persist($item); |
||
| 368 | } |
||
| 369 | $entityManager->flush(); |
||
| 370 | $this->get('session')->getFlashBag()->add('success', "Deleted"); |
||
| 371 | |||
| 372 | $this->getTemplate()->assign('links', $this->generateLinks()); |
||
| 373 | $url = $this->generateUrl('course_home.controller:iconListAction'); |
||
| 374 | |||
| 375 | return $this->redirect($url); |
||
| 376 | } |
||
| 377 | |||
| 378 | /** |
||
| 379 | * @param string $title |
||
| 380 | * @param string $content |
||
| 381 | * @param string $class |
||
| 382 | * |
||
| 383 | * @return string |
||
| 384 | */ |
||
| 385 | private function return_block($title, $content, $class = null) |
||
| 395 | } |
||
| 396 | |||
| 397 | /** |
||
| 398 | * @return array |
||
| 399 | */ |
||
| 400 | private function renderActivityView() |
||
| 401 | { |
||
| 402 | $session_id = api_get_session_id(); |
||
| 403 | $urlGenerator = $this->get('router'); |
||
| 404 | $content = ''; |
||
| 405 | |||
| 406 | $enabled = api_get_plugin_setting('courselegal', 'tool_enable'); |
||
| 407 | $pluginExtra = null; |
||
| 408 | if ($enabled === 'true') { |
||
| 409 | /*require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php'; |
||
| 410 | $plugin = CourseLegalPlugin::create(); |
||
| 411 | $pluginExtra = $plugin->getTeacherLink();*/ |
||
| 412 | } |
||
| 413 | |||
| 414 | // Start of tools for CourseAdmins (teachers/tutors) |
||
| 415 | $totalList = []; |
||
| 416 | |||
| 417 | // Start of tools for CourseAdmins (teachers/tutors) |
||
| 418 | if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { |
||
| 419 | $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
||
| 420 | <div class="normal-message" id="id_normal_message" style="display:none">'; |
||
| 421 | $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
||
| 422 | $content .= get_lang('Please stand by...'); |
||
| 423 | $content .= '</div> |
||
| 424 | <div class="alert alert-success" id="id_confirmation_message" style="display:none"></div> |
||
| 425 | </div>'; |
||
| 426 | |||
| 427 | $content .= $pluginExtra; |
||
| 428 | |||
| 429 | if (api_get_setting('show_session_data') == 'true' && $session_id > 0) { |
||
| 430 | $content .= ' |
||
| 431 | <div class="row"> |
||
| 432 | <div class="col-xs-12 col-md-12"> |
||
| 433 | <span class="viewcaption">'.get_lang('Session\'s data').'</span> |
||
| 434 | <table class="course_activity_home">'. |
||
| 435 | CourseHome::show_session_data($session_id).' |
||
| 436 | </table> |
||
| 437 | </div> |
||
| 438 | </div>'; |
||
| 439 | } |
||
| 440 | |||
| 441 | $my_list = CourseHome::get_tools_category(TOOL_AUTHORING); |
||
| 442 | |||
| 443 | $blocks[] = [ |
||
| 444 | 'title' => get_lang('Authoring'), |
||
| 445 | 'class' => 'course-tools-author', |
||
| 446 | 'content' => CourseHome::show_tools_category($my_list), |
||
| 447 | ]; |
||
| 448 | |||
| 449 | $list1 = CourseHome::get_tools_category(TOOL_INTERACTION); |
||
| 450 | $list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN); |
||
| 451 | $my_list = array_merge($list1, $list2); |
||
| 452 | |||
| 453 | $blocks[] = [ |
||
| 454 | 'title' => get_lang('Interaction'), |
||
| 455 | 'class' => 'course-tools-interaction', |
||
| 456 | 'content' => CourseHome::show_tools_category($my_list), |
||
| 457 | ]; |
||
| 458 | |||
| 459 | $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); |
||
| 460 | |||
| 461 | $blocks[] = [ |
||
| 462 | 'title' => get_lang('Administration'), |
||
| 463 | 'class' => 'course-tools-administration', |
||
| 464 | 'content' => CourseHome::show_tools_category($my_list), |
||
| 465 | ]; |
||
| 466 | } elseif (api_is_coach()) { |
||
| 467 | $content .= $pluginExtra; |
||
| 468 | if (api_get_setting('show_session_data') === 'true' && $session_id > 0) { |
||
| 469 | $content .= '<div class="row"> |
||
| 470 | <div class="col-xs-12 col-md-12"> |
||
| 471 | <span class="viewcaption">'.get_lang('Session\'s data').'</span> |
||
| 472 | <table class="course_activity_home">'; |
||
| 473 | $content .= CourseHome::show_session_data($session_id); |
||
| 474 | $content .= '</table></div></div>'; |
||
| 475 | } |
||
| 476 | |||
| 477 | $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
||
| 478 | |||
| 479 | $blocks[] = [ |
||
| 480 | 'content' => CourseHome::show_tools_category($my_list), |
||
| 481 | ]; |
||
| 482 | |||
| 483 | $sessionsCopy = api_get_setting('allow_session_course_copy_for_teachers'); |
||
| 484 | if ($sessionsCopy === 'true') { |
||
| 485 | // Adding only maintenance for coaches. |
||
| 486 | $myList = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); |
||
| 487 | $onlyMaintenanceList = []; |
||
| 488 | |||
| 489 | foreach ($myList as $item) { |
||
| 490 | if ($item['name'] === 'course_maintenance') { |
||
| 491 | $item['link'] = 'course_info/maintenance_coach.php'; |
||
| 492 | |||
| 493 | $onlyMaintenanceList[] = $item; |
||
| 494 | } |
||
| 495 | } |
||
| 496 | |||
| 497 | $blocks[] = [ |
||
| 498 | 'title' => get_lang('Administration'), |
||
| 499 | 'content' => CourseHome::show_tools_category($onlyMaintenanceList), |
||
| 500 | ]; |
||
| 501 | } |
||
| 502 | } else { |
||
| 503 | $tools = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
||
| 504 | |||
| 505 | $isDrhOfCourse = \CourseManager::isUserSubscribedInCourseAsDrh( |
||
| 506 | api_get_user_id(), |
||
| 507 | api_get_course_info() |
||
| 508 | ); |
||
| 509 | |||
| 510 | // Force user icon for DRH |
||
| 511 | if ($isDrhOfCourse) { |
||
| 512 | $addUserTool = true; |
||
| 513 | foreach ($tools as $tool) { |
||
| 514 | if ($tool['name'] === 'user') { |
||
| 515 | $addUserTool = false; |
||
| 516 | break; |
||
| 517 | } |
||
| 518 | } |
||
| 519 | |||
| 520 | if ($addUserTool) { |
||
| 521 | $tools[] = [ |
||
| 522 | 'c_id' => api_get_course_int_id(), |
||
| 523 | 'name' => 'user', |
||
| 524 | 'link' => 'user/user.php', |
||
| 525 | 'image' => 'members.gif', |
||
| 526 | 'visibility' => '1', |
||
| 527 | 'admin' => '0', |
||
| 528 | 'address' => 'squaregrey.gif', |
||
| 529 | 'added_tool' => '0', |
||
| 530 | 'target' => '_self', |
||
| 531 | 'category' => 'interaction', |
||
| 532 | 'session_id' => api_get_session_id(), |
||
| 533 | ]; |
||
| 534 | } |
||
| 535 | } |
||
| 536 | |||
| 537 | if (count($tools) > 0) { |
||
| 538 | $blocks[] = ['content' => CourseHome::show_tools_category($tools)]; |
||
| 539 | } |
||
| 540 | |||
| 541 | if ($isDrhOfCourse) { |
||
| 542 | $drhTool = CourseHome::get_tools_category(TOOL_DRH); |
||
| 543 | $blocks[] = ['content' => CourseHome::show_tools_category($drhTool)]; |
||
| 544 | } |
||
| 545 | } |
||
| 546 | |||
| 547 | return $blocks; |
||
| 548 | } |
||
| 549 | |||
| 550 | /** |
||
| 551 | * @return array |
||
| 552 | */ |
||
| 553 | private function autoLaunch() |
||
| 685 | ]; |
||
| 686 | } |
||
| 687 | } |
||
| 688 |