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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
3edc40a6
Commit
3edc40a6
authored
13 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Load default categories if there are none,
parent
823bef3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/contacts/lib/app.php
+29
-6
29 additions, 6 deletions
apps/contacts/lib/app.php
with
29 additions
and
6 deletions
apps/contacts/lib/app.php
+
29
−
6
View file @
3edc40a6
...
...
@@ -10,7 +10,6 @@
* This class manages our app actions
*/
OC_Contacts_App
::
$l10n
=
OC_L10N
::
get
(
'contacts'
);
OC_Contacts_App
::
$categories
=
new
OC_VCategories
(
'contacts'
);
class
OC_Contacts_App
{
/*
* @brief language object for calendar app
...
...
@@ -137,28 +136,52 @@ class OC_Contacts_App {
}
}
/*
/*
*
* @brief returns the vcategories object of the user
* @return (object) $vcategories
*/
protected
static
function
getVCategories
()
{
if
(
is_null
(
self
::
$categories
))
{
self
::
$categories
=
new
OC_VCategories
(
'contacts'
);
self
::
$categories
=
new
OC_VCategories
(
'contacts'
,
null
,
self
::
getDefaultCategories
()
);
}
return
self
::
$categories
;
}
/*
/*
*
* @brief returns the categories for the user
* @return (Array) $categories
*/
public
static
function
getCategories
()
{
$categories
=
self
::
$c
ategories
->
categories
();
$categories
=
self
::
getVC
ategories
()
->
categories
();
if
(
count
(
$categories
)
==
0
)
{
self
::
scanCategories
();
$categories
=
self
::
$categories
->
categories
();
}
return
$categories
;
return
(
$categories
?
$categories
:
self
::
getDefaultCategories
());
}
/**
* @brief returns the default categories of ownCloud
* @return (array) $categories
*/
protected
static
function
getDefaultCategories
(){
return
array
(
(
string
)
self
::
$l10n
->
t
(
'Birthday'
),
(
string
)
self
::
$l10n
->
t
(
'Business'
),
(
string
)
self
::
$l10n
->
t
(
'Call'
),
(
string
)
self
::
$l10n
->
t
(
'Clients'
),
(
string
)
self
::
$l10n
->
t
(
'Deliverer'
),
(
string
)
self
::
$l10n
->
t
(
'Holidays'
),
(
string
)
self
::
$l10n
->
t
(
'Ideas'
),
(
string
)
self
::
$l10n
->
t
(
'Journey'
),
(
string
)
self
::
$l10n
->
t
(
'Jubilee'
),
(
string
)
self
::
$l10n
->
t
(
'Meeting'
),
(
string
)
self
::
$l10n
->
t
(
'Other'
),
(
string
)
self
::
$l10n
->
t
(
'Personal'
),
(
string
)
self
::
$l10n
->
t
(
'Projects'
),
(
string
)
self
::
$l10n
->
t
(
'Questions'
),
(
string
)
self
::
$l10n
->
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