Code Duplication    Length = 7-8 lines in 2 locations

main/inc/lib/api.lib.php 2 locations

@@ 3222-3228 (lines=7) @@
3219
    $msg = null;
3220
    if (isset($message)) {
3221
        $msg = $message;
3222
    } else {
3223
        $msg = Display::return_message(
3224
            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
3225
            'error',
3226
            false
3227
        );
3228
    }
3229
3230
    $msg = Display::div($msg, array('align'=>'center'));
3231
@@ 3369-3376 (lines=8) @@
3366
        if ($casEnabled) {
3367
            $msg .= "</div>";
3368
        }
3369
    } else {
3370
        // we were not in a course, return to home page
3371
        $msg = Display::return_message(
3372
            get_lang('NotAllowed').'<br/><br/><a href="'.$home_url.'">'.get_lang('BackHome').'</a><br />',
3373
            'error',
3374
            false
3375
        );
3376
    }
3377
3378
    $tpl->assign('content', $msg);
3379
    $tpl->display_one_col_template();