Code Duplication    Length = 13-13 lines in 2 locations

classes/locallib/mobileview.php 1 location

@@ 158-170 (lines=13) @@
155
     * @param array $bbbsession
156
     * @return string
157
     */
158
    public static function get_activity_status(&$bbbsession) {
159
        $now = time();
160
        if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
161
            // The activity has not been opened.
162
            return 'not_started';
163
        }
164
        if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
165
            // The activity has been closed.
166
            return 'ended';
167
        }
168
        // The activity is open.
169
        return 'open';
170
    }
171
172
    /**
173
     * Helper for preparing metadata used while creating the meeting.

locallib.php 1 location

@@ 3607-3619 (lines=13) @@
3604
 * @param array $bbbsession
3605
 * @return string
3606
 */
3607
function bigbluebuttonbn_view_get_activity_status(&$bbbsession) {
3608
    $now = time();
3609
    if (!empty($bbbsession['bigbluebuttonbn']->openingtime) && $now < $bbbsession['bigbluebuttonbn']->openingtime) {
3610
        // The activity has not been opened.
3611
        return 'not_started';
3612
    }
3613
    if (!empty($bbbsession['bigbluebuttonbn']->closingtime) && $now > $bbbsession['bigbluebuttonbn']->closingtime) {
3614
        // The activity has been closed.
3615
        return 'ended';
3616
    }
3617
    // The activity is open.
3618
    return 'open';
3619
}
3620
3621
/**
3622
 * Set session URLs.