Code Duplication    Length = 7-8 lines in 2 locations

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

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