]> source.dussan.org Git - nextcloud-server.git/commitdiff
Small coding style update
authorBart Visscher <bartv@thisnet.nl>
Sat, 11 Feb 2012 20:57:38 +0000 (21:57 +0100)
committerBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 14:14:23 +0000 (15:14 +0100)
Fixup OC_Contacts_App

apps/contacts/lib/app.php

index 944bd6e83af0db25939cb59c8e8d7ec90fa5080f..5e58f9e928fd3b3aadd44aa7d46a69a35aa9029a 100644 (file)
@@ -10,7 +10,7 @@
  * This class manages our app actions
  */
 OC_Contacts_App::$l10n = new OC_L10N('contacts');
-class OC_Contacts_App{
+class OC_Contacts_App {
        public static $l10n;
 
        /**
@@ -18,7 +18,7 @@ class OC_Contacts_App{
        * @param int $id of contact
        * @param Sabre_VObject_Component $vcard to render
        */
-       public static function renderDetails($id, $vcard, $new=false){
+       public static function renderDetails($id, $vcard, $new=false) {
                $property_types = self::getAddPropertyOptions();
                $adr_types = self::getTypesOfProperty('ADR');
                $phone_types = self::getTypesOfProperty('TEL');
@@ -46,9 +46,9 @@ class OC_Contacts_App{
                OC_JSON::success(array('data' => array( 'id' => $id, 'name' => $name, 'page' => $page )));
        }
 
-       public static function getAddressbook($id){
+       public static function getAddressbook($id) {
                $addressbook = OC_Contacts_Addressbook::find( $id );
-               if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()){
+               if( $addressbook === false || $addressbook['userid'] != OC_User::getUser()) {
                        if ($addressbook === false) {
                                OC_Log::write('contacts', 'Addressbook not found: '. $id, OC_Log::ERROR);
                        }
@@ -61,9 +61,9 @@ class OC_Contacts_App{
                return $addressbook;
        }
 
-       public static function getContactObject($id){
+       public static function getContactObject($id) {
                $card = OC_Contacts_VCard::find( $id );
-               if( $card === false ){
+               if( $card === false ) {
                        OC_Log::write('contacts', 'Contact could not be found: '.$id, OC_Log::ERROR);
                        OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('Contact could not be found.').' '.$id)));
                        exit();
@@ -77,12 +77,12 @@ class OC_Contacts_App{
         * @brief Gets the VCard as an OC_VObject
         * @returns The card or null if the card could not be parsed.
         */
-       public static function getContactVCard($id){
+       public static function getContactVCard($id) {
                $card = self::getContactObject( $id );
 
                $vcard = OC_VObject::parse($card['carddata']);
                // Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly...
-               if(!is_null($vcard) && !$vcard->__isset('N')){
+               if(!is_null($vcard) && !$vcard->__isset('N')) {
                        $appinfo = $info=OC_App::getAppInfo('contacts');
                        if($appinfo['version'] >= 5) {
                                OC_Log::write('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OC_Log::DEBUG);
@@ -100,10 +100,10 @@ class OC_Contacts_App{
                return $vcard;
        }
 
-       public static function getPropertyLineByChecksum($vcard, $checksum){
+       public static function getPropertyLineByChecksum($vcard, $checksum) {
                $line = null;
-               for($i=0;$i<count($vcard->children);$i++){
-                       if(md5($vcard->children[$i]->serialize()) == $checksum ){
+               for($i=0;$i<count($vcard->children);$i++) {
+                       if(md5($vcard->children[$i]->serialize()) == $checksum ) {
                                $line = $i;
                                break;
                        }
@@ -114,7 +114,7 @@ class OC_Contacts_App{
        /**
         * @return array of vcard prop => label
         */
-       public static function getAddPropertyOptions(){
+       public static function getAddPropertyOptions() {
                $l10n = self::$l10n;
                return array(
                                'ADR'   => $l10n->t('Address'),
@@ -127,9 +127,9 @@ class OC_Contacts_App{
        /**
         * @return types for property $prop
         */
-       public static function getTypesOfProperty($prop){
+       public static function getTypesOfProperty($prop) {
                $l = self::$l10n;
-               switch($prop){
+               switch($prop) {
                case 'ADR':
                        return array(
                                'WORK' => $l->t('Work'),