Code Duplication    Length = 17-20 lines in 2 locations

main/document/document.php 1 location

@@ 1325-1344 (lines=20) @@
1322
        }
1323
1324
        // Update item_property to change visibility
1325
        if (api_item_property_update(
1326
            $courseInfo,
1327
            TOOL_DOCUMENT,
1328
            $update_id,
1329
            $visibility_command,
1330
            api_get_user_id(),
1331
            null,
1332
            null,
1333
            null,
1334
            null,
1335
            $sessionId)
1336
        ) {
1337
            Display::addFlash(
1338
                Display::return_message(get_lang('VisibilityChanged'), 'confirmation')
1339
            );
1340
        } else {
1341
            Display::addFlash(
1342
                Display::return_message(get_lang('ViModProb'), 'error')
1343
            );
1344
        }
1345
1346
        header('Location: '.$currentUrl);
1347
        exit;

main/inc/lib/social.lib.php 1 location

@@ 392-408 (lines=17) @@
389
                $message_title = get_lang('Invitation');
390
                $count_is_true = self::send_invitation_friend(api_get_user_id(), $userfriend_id, $message_title, $content_message);
391
392
                if ($count_is_true) {
393
                    Display::addFlash(
394
                        Display::display_confirmation_message(
395
                            api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES, $charset),
396
                            false,
397
                            true
398
                        )
399
                    );
400
                } else {
401
                    Display::addFlash(
402
                        Display::display_warning_message(
403
                            api_htmlentities(get_lang('YouAlreadySentAnInvitation'), ENT_QUOTES, $charset),
404
                            false,
405
                            true
406
                        )
407
                    );
408
                }
409
            }
410
        }
411
    }