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

@@ 3531-3543 (lines=13) @@
3528
 * @param array $bbbsession
3529
 * @return string
3530
 */
3531
function bigbluebuttonbn_view_get_activity_status(&$bbbsession) {
3532
    $now = time();
3533
    if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
3534
        // The activity has not been opened.
3535
        return 'not_started';
3536
    }
3537
    if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
3538
        // The activity has been closed.
3539
        return 'ended';
3540
    }
3541
    // The activity is open.
3542
    return 'open';
3543
}
3544
3545
/**
3546
 * Set session URLs.