Backport changes from dev/version_compare branch
This commit is contained in:
parent
2850592d9c
commit
22c50adab0
2 changed files with 5 additions and 5 deletions
|
@ -41,7 +41,7 @@ abstract class kolab_format
|
||||||
protected $xmldata;
|
protected $xmldata;
|
||||||
protected $xmlobject;
|
protected $xmlobject;
|
||||||
protected $loaded = false;
|
protected $loaded = false;
|
||||||
protected $version = 3.0;
|
protected $version = '3.0';
|
||||||
|
|
||||||
const KTYPE_PREFIX = 'application/x-vnd.kolab.';
|
const KTYPE_PREFIX = 'application/x-vnd.kolab.';
|
||||||
const PRODUCT_ID = 'Roundcube-libkolab-0.9';
|
const PRODUCT_ID = 'Roundcube-libkolab-0.9';
|
||||||
|
@ -54,7 +54,7 @@ abstract class kolab_format
|
||||||
* @param string Cached xml data to initialize with
|
* @param string Cached xml data to initialize with
|
||||||
* @return object kolab_format
|
* @return object kolab_format
|
||||||
*/
|
*/
|
||||||
public static function factory($type, $version = 3.0, $xmldata = null)
|
public static function factory($type, $version = '3.0', $xmldata = null)
|
||||||
{
|
{
|
||||||
if (!isset(self::$timezone))
|
if (!isset(self::$timezone))
|
||||||
self::$timezone = new DateTimeZone('UTC');
|
self::$timezone = new DateTimeZone('UTC');
|
||||||
|
@ -79,7 +79,7 @@ abstract class kolab_format
|
||||||
*/
|
*/
|
||||||
public static function supports($version)
|
public static function supports($version)
|
||||||
{
|
{
|
||||||
if ($version == 2.0)
|
if ($version == '2.0')
|
||||||
return class_exists('kolabobject');
|
return class_exists('kolabobject');
|
||||||
// default is version 3
|
// default is version 3
|
||||||
return class_exists('kolabformat');
|
return class_exists('kolabformat');
|
||||||
|
@ -299,7 +299,7 @@ abstract class kolab_format
|
||||||
{
|
{
|
||||||
if (class_exists('kolabobject')) {
|
if (class_exists('kolabobject')) {
|
||||||
$version = $v ?: $this->version;
|
$version = $v ?: $this->version;
|
||||||
if ($version <= 2.0)
|
if ($version <= '2.0')
|
||||||
return kolabobject::KolabV2;
|
return kolabobject::KolabV2;
|
||||||
else
|
else
|
||||||
return kolabobject::KolabV3;
|
return kolabobject::KolabV3;
|
||||||
|
|
|
@ -51,7 +51,7 @@ class kolab_storage
|
||||||
|
|
||||||
$rcmail = rcube::get_instance();
|
$rcmail = rcube::get_instance();
|
||||||
self::$config = $rcmail->config;
|
self::$config = $rcmail->config;
|
||||||
self::$version = $rcmail->config->get('kolab_format_version', self::$version);
|
self::$version = strval($rcmail->config->get('kolab_format_version', self::$version));
|
||||||
self::$imap = $rcmail->get_storage();
|
self::$imap = $rcmail->get_storage();
|
||||||
self::$ready = class_exists('kolabformat') &&
|
self::$ready = class_exists('kolabformat') &&
|
||||||
(self::$imap->get_capability('METADATA') || self::$imap->get_capability('ANNOTATEMORE') || self::$imap->get_capability('ANNOTATEMORE2'));
|
(self::$imap->get_capability('METADATA') || self::$imap->get_capability('ANNOTATEMORE') || self::$imap->get_capability('ANNOTATEMORE2'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue