Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
8f3da6ee
Commit
8f3da6ee
authored
13 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
Small coding style update
Fixup OC_Contacts_App
parent
1a74f0a1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/contacts/lib/app.php
+14
-14
14 additions, 14 deletions
apps/contacts/lib/app.php
with
14 additions
and
14 deletions
apps/contacts/lib/app.php
+
14
−
14
View file @
8f3da6ee
...
...
@@ -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'
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment