Code Duplication    Length = 13-13 lines in 2 locations

locallib.php 1 location

@@ 3410-3422 (lines=13) @@
3407
 * @param array $bbbsession
3408
 * @return string
3409
 */
3410
function bigbluebuttonbn_view_get_activity_status(&$bbbsession) {
3411
    $now = time();
3412
    if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
3413
        // The activity has not been opened.
3414
        return 'not_started';
3415
    }
3416
    if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
3417
        // The activity has been closed.
3418
        return 'ended';
3419
    }
3420
    // The activity is open.
3421
    return 'open';
3422
}
3423
3424
/**
3425
 * Set session URLs.

classes/locallib/mobileview.php 1 location

@@ 62-74 (lines=13) @@
59
     * @param array $bbbsession
60
     * @return string
61
     */
62
    public static function get_activity_status(&$bbbsession) {
63
        $now = time();
64
        if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
65
            // The activity has not been opened.
66
            return 'not_started';
67
        }
68
        if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
69
            // The activity has been closed.
70
            return 'ended';
71
        }
72
        // The activity is open.
73
        return 'open';
74
    }
75
76
    /**
77
     * Helper for preparing metadata used while creating the meeting.