Code Duplication    Length = 8-8 lines in 10 locations

include/agenda_fnc.php 10 locations

@@ 344-351 (lines=8) @@
341
    $view = _EXTCAL_NAV_CALMONTH;
342
    //   echo "{$view} - {$currentTab}<br>";
343
    //   echoArray($visibleTabs,true);
344
    if (in_array($view, $visibleTabs)) {
345
        $tNavBar[$view] = array(
346
            'href'    => _EXTCAL_FILE_CALMONTH,
347
            'name'    => _MD_EXTCAL_NAV_CALMONTH,
348
            'current' => ($view == $currentTab) ? 1 : 0,
349
            'weight'  => 110
350
        );
351
    }
352
353
    $view = _EXTCAL_NAV_CALWEEK;
354
    if (in_array($view, $visibleTabs)) {
@@ 354-361 (lines=8) @@
351
    }
352
353
    $view = _EXTCAL_NAV_CALWEEK;
354
    if (in_array($view, $visibleTabs)) {
355
        $tNavBar[$view] = array(
356
            'href'    => _EXTCAL_FILE_CALWEEK,
357
            'name'    => _MD_EXTCAL_NAV_CALWEEK,
358
            'current' => ($view == $currentTab) ? 1 : 0,
359
            'weight'  => 120
360
        );
361
    }
362
363
    $view = _EXTCAL_NAV_YEAR;
364
    if (in_array($view, $visibleTabs)) {
@@ 364-371 (lines=8) @@
361
    }
362
363
    $view = _EXTCAL_NAV_YEAR;
364
    if (in_array($view, $visibleTabs)) {
365
        $tNavBar[$view] = array(
366
            'href'    => _EXTCAL_FILE_YEAR,
367
            'name'    => _MD_EXTCAL_NAV_YEAR,
368
            'current' => ($view == $currentTab) ? 1 : 0,
369
            'weight'  => 130
370
        );
371
    }
372
373
    $view = _EXTCAL_NAV_MONTH;
374
    if (in_array($view, $visibleTabs)) {
@@ 374-381 (lines=8) @@
371
    }
372
373
    $view = _EXTCAL_NAV_MONTH;
374
    if (in_array($view, $visibleTabs)) {
375
        $tNavBar[$view] = array(
376
            'href'    => _EXTCAL_FILE_MONTH,
377
            'name'    => _MD_EXTCAL_NAV_MONTH,
378
            'current' => ($view == $currentTab) ? 1 : 0,
379
            'weight'  => 140
380
        );
381
    }
382
383
    $view = _EXTCAL_NAV_WEEK;
384
    if (in_array($view, $visibleTabs)) {
@@ 384-391 (lines=8) @@
381
    }
382
383
    $view = _EXTCAL_NAV_WEEK;
384
    if (in_array($view, $visibleTabs)) {
385
        $tNavBar[$view] = array(
386
            'href'    => _EXTCAL_FILE_WEEK,
387
            'name'    => _MD_EXTCAL_NAV_WEEK,
388
            'current' => ($view == $currentTab) ? 1 : 0,
389
            'weight'  => 150
390
        );
391
    }
392
393
    $view = _EXTCAL_NAV_DAY;
394
    if (in_array($view, $visibleTabs)) {
@@ 394-401 (lines=8) @@
391
    }
392
393
    $view = _EXTCAL_NAV_DAY;
394
    if (in_array($view, $visibleTabs)) {
395
        $tNavBar[$view] = array(
396
            'href'    => _EXTCAL_FILE_DAY,
397
            'name'    => _MD_EXTCAL_NAV_DAY,
398
            'current' => ($view == $currentTab) ? 1 : 0,
399
            'weight'  => 160
400
        );
401
    }
402
403
    $view = _EXTCAL_NAV_AGENDA_WEEK;
404
    if (in_array($view, $visibleTabs)) {
@@ 404-411 (lines=8) @@
401
    }
402
403
    $view = _EXTCAL_NAV_AGENDA_WEEK;
404
    if (in_array($view, $visibleTabs)) {
405
        $tNavBar[$view] = array(
406
            'href'    => _EXTCAL_FILE_AGENDA_WEEK,
407
            'name'    => _MD_EXTCAL_NAV_AGENDA_WEEK,
408
            'current' => ($view == $currentTab) ? 1 : 0,
409
            'weight'  => 170
410
        );
411
    }
412
413
    $view = _EXTCAL_NAV_AGENDA_DAY;
414
    if (in_array($view, $visibleTabs)) {
@@ 414-421 (lines=8) @@
411
    }
412
413
    $view = _EXTCAL_NAV_AGENDA_DAY;
414
    if (in_array($view, $visibleTabs)) {
415
        $tNavBar[$view] = array(
416
            'href'    => _EXTCAL_FILE_AGENDA_DAY,
417
            'name'    => _MD_EXTCAL_NAV_AGENDA_DAY,
418
            'current' => ($view == $currentTab) ? 1 : 0,
419
            'weight'  => 180
420
        );
421
    }
422
423
    $view = _EXTCAL_NAV_SEARCH;
424
    if (in_array($view, $visibleTabs)) {
@@ 424-431 (lines=8) @@
421
    }
422
423
    $view = _EXTCAL_NAV_SEARCH;
424
    if (in_array($view, $visibleTabs)) {
425
        $tNavBar[$view] = array(
426
            'href'    => _EXTCAL_FILE_SEARCH,
427
            'name'    => _MD_EXTCAL_NAV_SEARCH,
428
            'current' => ($view == $currentTab) ? 1 : 0,
429
            'weight'  => 200
430
        );
431
    }
432
433
    $user = isset($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser'] : null;
434
    /** @var ExtcalCatHandler $catHandler */
@@ 438-445 (lines=8) @@
435
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
436
    if ($catHandler->haveSubmitRight($user)) {
437
        $view = _EXTCAL_NAV_NEW_EVENT;
438
        if (in_array($view, $visibleTabs)) {
439
            $tNavBar[$view] = array(
440
                'href'    => _EXTCAL_FILE_NEW_EVENT,
441
                'name'    => _MD_EXTCAL_NAV_NEW_EVENT,
442
                'current' => ($view == $currentTab) ? 1 : 0,
443
                'weight'  => 100
444
            );
445
        }
446
    }
447
    //----------------------------------------------------------------
448
    //    $ordre = array();