From 089b7e8f8ac8bd3648d8769bceaacdb392989579 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Fri, 7 Sep 2012 15:21:03 +0200 Subject: [PATCH] adding space between) and { --- ajax/categories/categoriesfor.php | 2 +- appinfo/migrate.php | 2 +- export.php | 2 +- import.php | 4 ++-- lib/addressbook.php | 6 +++--- lib/app.php | 2 +- lib/hooks.php | 2 +- lib/sabre/backend.php | 2 +- lib/search.php | 6 +++--- lib/vcard.php | 26 +++++++++++++------------- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ajax/categories/categoriesfor.php b/ajax/categories/categoriesfor.php index 86039ff1..c747f3be 100644 --- a/ajax/categories/categoriesfor.php +++ b/ajax/categories/categoriesfor.php @@ -18,7 +18,7 @@ if(is_null($id)) { exit(); } $vcard = OC_Contacts_App::getContactVCard( $id ); -foreach($vcard->children as $property){ +foreach($vcard->children as $property) { if($property->name == 'CATEGORIES') { $checksum = md5($property->serialize()); OCP\JSON::success(array( diff --git a/appinfo/migrate.php b/appinfo/migrate.php index 56bc02e4..3c37c6bc 100644 --- a/appinfo/migrate.php +++ b/appinfo/migrate.php @@ -51,7 +51,7 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{ $query = $this->content->prepare( 'SELECT * FROM `contacts_cards` WHERE `addressbookid` LIKE ?' ); $results = $query->execute( array( $oldid ) ); - while( $row = $results->fetchRow() ){ + while( $row = $results->fetchRow() ) { // Import the contacts $contactquery = OCP\DB::prepare( 'INSERT INTO `*PREFIX*contacts_cards` (`addressbookid`, `fullname`, `carddata`, `uri`, `lastmodified`) VALUES (?, ?, ?, ?, ?)' ); $contactquery->execute( array( $newid, $row['fullname'], $row['carddata'], $row['uri'], $row['lastmodified'] ) ); diff --git a/export.php b/export.php index 70062886..c092d6c5 100644 --- a/export.php +++ b/export.php @@ -23,7 +23,7 @@ if(isset($bookid)) { $batchsize = OCP\Config::getUserValue(OCP\User::getUser(), 'contacts', 'export_batch_size', 20); - while($cardobjects = OC_Contacts_VCard::all($bookid, $start, $batchsize)){ + while($cardobjects = OC_Contacts_VCard::all($bookid, $start, $batchsize)) { foreach($cardobjects as $card) { echo $card['carddata'] . $nl; } diff --git a/import.php b/import.php index df3371a2..fa624be8 100644 --- a/import.php +++ b/import.php @@ -73,7 +73,7 @@ $lines = explode($nl, $file); $inelement = false; $parts = array(); $card = array(); -foreach($lines as $line){ +foreach($lines as $line) { if(strtoupper(trim($line)) == 'BEGIN:VCARD') { $inelement = true; } elseif (strtoupper(trim($line)) == 'END:VCARD') { @@ -109,7 +109,7 @@ if(!count($parts) > 0) { } exit(); } -foreach($parts as $part){ +foreach($parts as $part) { $card = OC_VObject::parse($part); if (!$card) { $failed += 1; diff --git a/lib/addressbook.php b/lib/addressbook.php index d0f38c7d..fa9c5947 100644 --- a/lib/addressbook.php +++ b/lib/addressbook.php @@ -110,7 +110,7 @@ class OC_Contacts_Addressbook { * @param string $principaluri * @return array */ - public static function allWherePrincipalURIIs($principaluri){ + public static function allWherePrincipalURIIs($principaluri) { $uid = self::extractUserID($principaluri); return self::all($uid); } @@ -180,7 +180,7 @@ class OC_Contacts_Addressbook { return false; } $uris = array(); - while($row = $result->fetchRow()){ + while($row = $result->fetchRow()) { $uris[] = $row['uri']; } @@ -320,7 +320,7 @@ class OC_Contacts_Addressbook { // First delete cards belonging to this addressbook. $cards = OC_Contacts_VCard::all($id); - foreach($cards as $card){ + foreach($cards as $card) { try { OC_Contacts_VCard::delete($card['id']); } catch(Exception $e) { diff --git a/lib/app.php b/lib/app.php index 8500ab24..a51e4832 100644 --- a/lib/app.php +++ b/lib/app.php @@ -247,7 +247,7 @@ class OC_Contacts_App { * @brief returns the default categories of ownCloud * @return (array) $categories */ - public static function getDefaultCategories(){ + public static function getDefaultCategories() { return array( (string)self::$l10n->t('Birthday'), (string)self::$l10n->t('Business'), diff --git a/lib/hooks.php b/lib/hooks.php index 9c7966eb..4c209954 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -81,7 +81,7 @@ class OC_Contacts_Hooks{ $info = explode('_', $name); $aid = $info[1]; OC_Contacts_App::getAddressbook($aid); - foreach(OC_Contacts_VCard::all($aid) as $card){ + foreach(OC_Contacts_VCard::all($aid) as $card) { $vcard = OC_VObject::parse($card['carddata']); if (!$vcard) { continue; diff --git a/lib/sabre/backend.php b/lib/sabre/backend.php index d7e222be..8951ae0b 100644 --- a/lib/sabre/backend.php +++ b/lib/sabre/backend.php @@ -147,7 +147,7 @@ class OC_Connector_Sabre_CardDAV extends Sabre_CardDAV_Backend_Abstract { public function getCards($addressbookid) { $data = OC_Contacts_VCard::all($addressbookid); $cards = array(); - foreach($data as $i){ + foreach($data as $i) { //OCP\Util::writeLog('contacts', __METHOD__.', uri: ' . $i['uri'], OCP\Util::DEBUG); $cards[] = array( 'id' => $i['id'], diff --git a/lib/search.php b/lib/search.php index 53aa2b48..b91994f8 100644 --- a/lib/search.php +++ b/lib/search.php @@ -1,15 +1,15 @@ 0) { $link = OCP\Util::linkTo('contacts', 'index.php').'&id='.urlencode($vcard['id']); $results[]=new OC_Search_Result($vcard['fullname'], '', $link, (string)$l->t('Contact'));//$name,$text,$link,$type diff --git a/lib/vcard.php b/lib/vcard.php index 1e130e97..13dcde39 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -90,7 +90,7 @@ class OC_Contacts_VCard { * @param integer $id * @return associative array or false. */ - public static function find($id){ + public static function find($id) { try { $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*contacts_cards` WHERE `id` = ?' ); $result = $stmt->execute(array($id)); @@ -109,7 +109,7 @@ class OC_Contacts_VCard { * @param string $uri the uri ('filename') * @return associative array or false. */ - public static function findWhereDAVDataIs($aid,$uri){ + public static function findWhereDAVDataIs($aid,$uri) { try { $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*contacts_cards` WHERE `addressbookid` = ? AND `uri` = ?' ); $result = $stmt->execute(array($aid,$uri)); @@ -129,7 +129,7 @@ class OC_Contacts_VCard { * This has to be changed to either TEL;TYPE=HOME,CELL:123456789 or TEL;TYPE=HOME;TYPE=CELL:123456789 - both are valid. */ public static function formatPropertyTypes(&$property) { - foreach($property->parameters as $key=>&$parameter){ + foreach($property->parameters as $key=>&$parameter) { $types = OC_Contacts_App::getTypesOfProperty($property->name); if(is_array($types) && in_array(strtoupper($parameter->name), array_keys($types)) || strtoupper($parameter->name) == 'PREF') { $property->parameters[] = new Sabre_VObject_Parameter('TYPE', $parameter->name); @@ -146,7 +146,7 @@ class OC_Contacts_VCard { */ public static function decodeProperty(&$property) { // Check out for encoded string and decode them :-[ - foreach($property->parameters as $key=>&$parameter){ + foreach($property->parameters as $key=>&$parameter) { if(strtoupper($parameter->name) == 'ENCODING') { if(strtoupper($parameter->value) == 'QUOTED-PRINTABLE') { // what kind of other encodings could be used? // Decode quoted-printable and strip any control chars @@ -213,7 +213,7 @@ class OC_Contacts_VCard { $upgrade = true; //OCP\Util::writeLog('contacts', 'OC_Contacts_VCard::updateValuesFromAdd. Updating from version: '.$version, OCP\Util::DEBUG); } - foreach($vcard->children as &$property){ + foreach($vcard->children as &$property) { // Decode string properties and remove obsolete properties. if($upgrade && in_array($property->name, $stringprops)) { self::decodeProperty($property); @@ -287,7 +287,7 @@ class OC_Contacts_VCard { * @param $isChecked boolean If the vCard should be checked for validity and version. * @return insertid on success or false. */ - public static function add($aid, OC_VObject $card, $uri=null, $isChecked=false){ + public static function add($aid, OC_VObject $card, $uri=null, $isChecked=false) { if(is_null($card)) { OCP\Util::writeLog('contacts', 'OC_Contacts_VCard::add. No vCard supplied', OCP\Util::ERROR); return null; @@ -350,7 +350,7 @@ class OC_Contacts_VCard { * @param string $data vCard file * @return insertid */ - public static function addFromDAVData($id,$uri,$data){ + public static function addFromDAVData($id,$uri,$data) { $card = OC_VObject::parse($data); return self::add($id, $card, $uri); } @@ -359,7 +359,7 @@ class OC_Contacts_VCard { * @brief Mass updates an array of cards * @param array $objects An array of [id, carddata]. */ - public static function updateDataByID($objects){ + public static function updateDataByID($objects) { $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*contacts_cards` SET `carddata` = ?, `lastmodified` = ? WHERE `id` = ?' ); $now = new DateTime; foreach($objects as $object) { @@ -395,7 +395,7 @@ class OC_Contacts_VCard { * @param OC_VObject $card vCard file * @return boolean true on success, otherwise an exception will be thrown */ - public static function edit($id, OC_VObject $card){ + public static function edit($id, OC_VObject $card) { $oldcard = self::find($id); if (!$oldcard) { OCP\Util::writeLog('contacts', __METHOD__.', id: ' @@ -465,7 +465,7 @@ class OC_Contacts_VCard { * @param string $data vCard file * @return boolean */ - public static function editFromDAVData($aid, $uri, $data){ + public static function editFromDAVData($aid, $uri, $data) { $oldcard = self::findWhereDAVDataIs($aid, $uri); $card = OC_VObject::parse($data); if(!$card) { @@ -491,7 +491,7 @@ class OC_Contacts_VCard { * @param integer $id id of card * @return boolean true on success, otherwise an exception will be thrown */ - public static function delete($id){ + public static function delete($id) { $card = self::find($id); if (!$card) { OCP\Util::writeLog('contacts', __METHOD__.', id: ' @@ -561,7 +561,7 @@ class OC_Contacts_VCard { * @param string $uri the uri of the card * @return boolean */ - public static function deleteFromDAVData($aid,$uri){ + public static function deleteFromDAVData($aid,$uri) { $addressbook = OC_Contacts_Addressbook::find($aid); if ($addressbook['userid'] != OCP\User::getUser()) { $query = OCP\DB::prepare( 'SELECT `id` FROM `*PREFIX*contacts_cards` WHERE `addressbookid` = ? AND `uri` = ?' ); @@ -692,7 +692,7 @@ class OC_Contacts_VCard { 'value' => $value, 'parameters' => array(), 'checksum' => md5($property->serialize())); - foreach($property->parameters as $parameter){ + foreach($property->parameters as $parameter) { // Faulty entries by kaddressbook // Actually TYPE=PREF is correct according to RFC 2426 // but this way is more handy in the UI. Tanghus.