summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-09-20 14:41:17 +0200
committerBart Visscher <bartv@thisnet.nl>2011-12-07 20:40:58 +0100
commitc67ac46b6c3b333c7f16cbdc8df7b9a6b4f3fb1b (patch)
tree14d2a1f3061f5e8236bdd106c9b0dea9bbbe9c4d /apps/contacts/ajax
parentb9e6f5e42d54fc91205f03f4b19bbf313278f476 (diff)
downloadnextcloud-server-c67ac46b6c3b333c7f16cbdc8df7b9a6b4f3fb1b.tar.gz
nextcloud-server-c67ac46b6c3b333c7f16cbdc8df7b9a6b4f3fb1b.zip
Use a proxy class to interface with Sabre_VObject classes
Diffstat (limited to 'apps/contacts/ajax')
-rw-r--r--apps/contacts/ajax/addcard.php8
-rw-r--r--apps/contacts/ajax/addproperty.php4
-rw-r--r--apps/contacts/ajax/deleteproperty.php2
-rw-r--r--apps/contacts/ajax/getdetails.php2
-rw-r--r--apps/contacts/ajax/setproperty.php4
-rw-r--r--apps/contacts/ajax/showsetproperty.php2
6 files changed, 11 insertions, 11 deletions
diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php
index dd5b90651f5..8d192641dbd 100644
--- a/apps/contacts/ajax/addcard.php
+++ b/apps/contacts/ajax/addcard.php
@@ -40,9 +40,9 @@ $fn = $_POST['fn'];
$values = $_POST['value'];
$parameters = $_POST['parameters'];
-$vcard = new Sabre_VObject_Component('VCARD');
-$vcard->add(new Sabre_VObject_Property('FN',$fn));
-$vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID()));
+$vcard = new OC_VObject('VCARD');
+$vcard->setUID();
+$vcard->setString('FN',$fn);
// Data to add ...
$add = array('TEL', 'EMAIL', 'ORG');
@@ -64,7 +64,7 @@ foreach( $add as $propname){
else{
$prop_parameters = array();
}
- OC_Contacts_VCard::addVCardProperty($vcard, $propname, $value, $prop_parameters);
+ $vcard->addProperty($propname, $value, $prop_parameters);
}
$id = OC_Contacts_VCard::add($aid,$vcard->serialize());
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php
index 101cfabbe84..e59a91e4a58 100644
--- a/apps/contacts/ajax/addproperty.php
+++ b/apps/contacts/ajax/addproperty.php
@@ -42,7 +42,7 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
exit();
}
-$vcard = OC_Contacts_VCard::parse($card['carddata']);
+$vcard = OC_VObject::parse($card['carddata']);
// Check if the card is valid
if(is_null($vcard)){
OC_JSON::error(array('data' => array( 'message' => $l10n->t('vCard could not be read.'))));
@@ -53,7 +53,7 @@ $name = $_POST['name'];
$value = $_POST['value'];
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
-$property = OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
+$property = $vcard->addProperty($name, $value, $parameters);
$line = count($vcard->children) - 1;
$checksum = md5($property->serialize());
diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php
index 0a3a3c293a0..be352cea616 100644
--- a/apps/contacts/ajax/deleteproperty.php
+++ b/apps/contacts/ajax/deleteproperty.php
@@ -45,7 +45,7 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
exit();
}
-$vcard = OC_Contacts_VCard::parse($card['carddata']);
+$vcard = OC_VObject::parse($card['carddata']);
// Check if the card is valid
if(is_null($vcard)){
OC_JSON::error(array('data' => array( 'message' => $l10n->t('vCard could not be read.'))));
diff --git a/apps/contacts/ajax/getdetails.php b/apps/contacts/ajax/getdetails.php
index 260fb53a686..eb1f20ee75e 100644
--- a/apps/contacts/ajax/getdetails.php
+++ b/apps/contacts/ajax/getdetails.php
@@ -44,7 +44,7 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
exit();
}
-$vcard = OC_Contacts_VCard::parse($card['carddata']);
+$vcard = OC_VObject::parse($card['carddata']);
// Check if the card is valid
if(is_null($vcard)){
OC_JSON::error(array('data' => array( 'message' => $l10n->t('vCard could not be read.'))));
diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php
index 22f228cbf43..2edfa5b452f 100644
--- a/apps/contacts/ajax/setproperty.php
+++ b/apps/contacts/ajax/setproperty.php
@@ -43,7 +43,7 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
exit();
}
-$vcard = OC_Contacts_VCard::parse($card['carddata']);
+$vcard = OC_VObject::parse($card['carddata']);
// Check if the card is valid
if(is_null($vcard)){
OC_JSON::error(array('data' => array( 'message' => $l10n->t('vCard could not be read.'))));
@@ -64,7 +64,7 @@ if(is_null($line)){
// Set the value
$value = $_POST['value'];
if(is_array($value)){
- $value = OC_Contacts_VCard::escapeSemicolons($value);
+ $value = OC_VObject::escapeSemicolons($value);
}
$vcard->children[$line]->setValue($value);
diff --git a/apps/contacts/ajax/showsetproperty.php b/apps/contacts/ajax/showsetproperty.php
index 2ec4b89b824..1cf65417809 100644
--- a/apps/contacts/ajax/showsetproperty.php
+++ b/apps/contacts/ajax/showsetproperty.php
@@ -43,7 +43,7 @@ if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
exit();
}
-$vcard = OC_Contacts_VCard::parse($card['carddata']);
+$vcard = OC_VObject::parse($card['carddata']);
// Check if the card is valid
if(is_null($vcard)){
OC_JSON::error(array('data' => array( 'message' => $l10n->t('vCard could not be read.'))));