Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 3196-3202 (lines=7) @@
3193
    $msg = null;
3194
    if (isset($message)) {
3195
        $msg = $message;
3196
    } else {
3197
        $msg = Display::return_message(
3198
            get_lang('NotAllowedClickBack').'<br/><br/><a href="'.$home_url.'">'.get_lang('ReturnToCourseHomepage').'</a>',
3199
            'error',
3200
            false
3201
        );
3202
    }
3203
3204
    $msg = Display::div($msg, array('align'=>'center'));
3205
@@ 3343-3350 (lines=8) @@
3340
        if ($casEnabled) {
3341
            $msg .= "</div>";
3342
        }
3343
    } else {
3344
        // we were not in a course, return to home page
3345
        $msg = Display::return_message(
3346
            get_lang('NotAllowed').'<br/><br/><a href="'.$home_url.'">'.get_lang('BackHome').'</a><br />',
3347
            'error',
3348
            false
3349
        );
3350
    }
3351
3352
    $tpl->assign('content', $msg);
3353
    $tpl->display_one_col_template();