Code Duplication    Length = 13-13 lines in 2 locations

classes/locallib/mobileview.php 1 location

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

locallib.php 1 location

@@ 3583-3595 (lines=13) @@
3580
 * @param array $bbbsession
3581
 * @return string
3582
 */
3583
function bigbluebuttonbn_view_get_activity_status(&$bbbsession) {
3584
    $now = time();
3585
    if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
3586
        // The activity has not been opened.
3587
        return 'not_started';
3588
    }
3589
    if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
3590
        // The activity has been closed.
3591
        return 'ended';
3592
    }
3593
    // The activity is open.
3594
    return 'open';
3595
}
3596
3597
/**
3598
 * Set session URLs.