Code Duplication    Length = 13-15 lines in 4 locations

main/auth/courses_controller.php 4 locations

@@ 402-416 (lines=15) @@
399
                    $html .= '<strong>';
400
                    $html .= "$categoryName ($categoryCourses)";
401
                    $html .= '</strong>';
402
                } else {
403
                    if (!empty($categoryCourses)) {
404
                        $html .= '<a href="' . CourseCategory::getCourseCategoryUrl(
405
                                1,
406
                                $limit['length'],
407
                                $categoryCode,
408
                                $hiddenLinks,
409
                                $action
410
                            ) . '">';
411
                        $html .= "$categoryName ($categoryCourses)";
412
                        $html .= '</a>';
413
                    } else {
414
                        $html .= "$categoryName ($categoryCourses)";
415
                    }
416
                }
417
418
                if (!empty($categories[$categoryCode])) {
419
                    $html .= '<ul class="nav nav-list">';
@@ 428-440 (lines=13) @@
425
426
                        $html .= '<li>';
427
428
                        if ($code == $subCategory1Code) {
429
                            $html .= "<strong>$subCategory1Name ($subCategory1Courses)</strong>";
430
                        } else {
431
                            $html .= '<a href="' . CourseCategory::getCourseCategoryUrl(
432
                                    1,
433
                                    $limit['length'],
434
                                    $categoryCode,
435
                                    $hiddenLinks,
436
                                    $action
437
                                ) . '">';
438
                            $html .= "$subCategory1Name ($subCategory1Courses)";
439
                            $html .= '</a>';
440
                        }
441
442
                        if (!empty($categories[$subCategory1Code])) {
443
                            $html .= '<ul class="nav nav-list">';
@@ 452-464 (lines=13) @@
449
450
                                $html .= '<li>';
451
452
                                if ($code == $subCategory2Code) {
453
                                    $html .= "<strong>$subCategory2Name ($subCategory2Courses)</strong>";
454
                                } else {
455
                                    $html .= '<a href="' . CourseCategory::getCourseCategoryUrl(
456
                                            1,
457
                                            $limit['length'],
458
                                            $categoryCode,
459
                                            $hiddenLinks,
460
                                            $action
461
                                        ) . '">';
462
                                    $html .= "$subCategory2Name ($subCategory2Courses)";
463
                                    $html .= '</a>';
464
                                }
465
466
                                if (!empty($categories[$subCategory2Code])) {
467
                                    $html .= '<ul class="nav nav-list">';
@@ 476-488 (lines=13) @@
473
474
                                        $html .= '<li>';
475
476
                                        if ($code == $subCategory3Code) {
477
                                            $html .= "<strong>$subCategory3Name ($subCategory3Courses)</strong>";
478
                                        } else {
479
                                            $html .= '<a href="' . CourseCategory::getCourseCategoryUrl(
480
                                                    1,
481
                                                    $limit['length'],
482
                                                    $categoryCode,
483
                                                    $hiddenLinks,
484
                                                    $action
485
                                                ) . '">';
486
                                            $html .= "$subCategory3Name ($subCategory3Courses)";
487
                                            $html .= '</a>';
488
                                        }
489
                                        $html .= '</li>';
490
                                    }
491
                                    $html .= '</ul>';