protected static function get_duration_text($seconds) {
        if (empty($seconds)) {
            return get_string('none');
        }
        $data = self::parse_seconds($seconds);
        switch ($data['u']) {
            case (60*60*24*7):
                return get_string('numweeks', '', $data['v']);
            case (60*60*24):
                return get_string('numdays', '', $data['v']);
            case (60*60):
                return get_string('numhours', '', $data['v']);
            case (60):
                return get_string('numminutes', '', $data['v']);
            default:
                return get_string('numseconds', '', $data['v']*$data['u']);
        }
    }
protected static function get_duration_text($seconds) {
        if (empty($seconds)) {
            return get_string('none');
        }
        $data = self::parse_seconds($seconds);
        switch ($data['u']) {
            case (60*60*24*7):
                return get_string('numweeks', '', $data['v']);
            case (60*60*24):
                return get_string('numdays', '', $data['v']);
            case (60*60):
                return get_string('numhours', '', $data['v']);
            case (60):
                return get_string('numminutes', '', $data['v']);
            default:
                return get_string('numseconds', '', $data['v']*$data['u']);
        }
    }
protected static function get_duration_text ( $ seconds ) { if ( empty ( $ seconds ) ) { return get_string ( 'none' ) ; } $ data = self :: parse_seconds ( $ seconds ) ; switch ( $ data [ 'u' ] ) { case ( 60 * 60 * 24 * 7 ) : return get_string ( 'numweeks' , '' , $ data [ 'v' ] ) ; case ( 60 * 60 * 24 ) : return get_string ( 'numdays' , '' , $ data [ 'v' ] ) ; case ( 60 * 60 ) : return get_string ( 'numhours' , '' , $ data [ 'v' ] ) ; case ( 60 ) : return get_string ( 'numminutes' , '' , $ data [ 'v' ] ) ; default : return get_string ( 'numseconds' , '' , $ data [ 'v' ] * $ data [ 'u' ] ) ; } }
Converts seconds to some more user friendly string.
@static
@param int $seconds
@return string
Converts seconds to some more user friendly string .