Code Duplication    Length = 13-13 lines in 2 locations

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.

locallib.php 1 location

@@ 3543-3555 (lines=13) @@
3540
 * @param array $bbbsession
3541
 * @return string
3542
 */
3543
function bigbluebuttonbn_view_get_activity_status(&$bbbsession) {
3544
    $now = time();
3545
    if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
3546
        // The activity has not been opened.
3547
        return 'not_started';
3548
    }
3549
    if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
3550
        // The activity has been closed.
3551
        return 'ended';
3552
    }
3553
    // The activity is open.
3554
    return 'open';
3555
}
3556
3557
/**
3558
 * Set session URLs.