Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 3164-3170 (lines=7) @@
3161
    $msg = null;
3162
    if (isset($message)) {
3163
        $msg = $message;
3164
    } else {
3165
        $msg = Display::return_message(
3166
            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
3167
            'error',
3168
            false
3169
        );
3170
    }
3171
3172
    $msg = Display::div($msg, array('align'=>'center'));
3173
@@ 3311-3318 (lines=8) @@
3308
        if ($casEnabled) {
3309
            $msg .= "</div>";
3310
        }
3311
    } else {
3312
        // we were not in a course, return to home page
3313
        $msg = Display::return_message(
3314
            get_lang('NotAllowed').'<br/><br/><a href="'.$home_url.'">'.get_lang('BackHome').'</a><br />',
3315
            'error',
3316
            false
3317
        );
3318
    }
3319
3320
    $tpl->assign('content', $msg);
3321
    $tpl->display_one_col_template();