diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-05-13 23:25:51 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-05-13 23:27:14 +0200 |
commit | 4e1e978b89adf49eaeb152688525d027ac1e4c57 (patch) | |
tree | e33d62bc3acc99879ce93112b1aa451e159b19af /apps/contacts | |
parent | 9295f49553a04f17b58391523317881ad8edba19 (diff) | |
download | nextcloud-server-4e1e978b89adf49eaeb152688525d027ac1e4c57.tar.gz nextcloud-server-4e1e978b89adf49eaeb152688525d027ac1e4c57.zip |
Contacts: Forgot one file for the import fix.
Diffstat (limited to 'apps/contacts')
-rwxr-xr-x | apps/contacts/lib/app.php | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index 330d5b21b79..29428763d60 100755 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -12,8 +12,15 @@ 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 + */ + public static $l10n; - public static $categories; + /* + * @brief categories of the user + */ + public static $categories = null; public static function getAddressbook($id) { $addressbook = OC_Contacts_Addressbook::find( $id ); @@ -130,6 +137,21 @@ 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'); + } + return self::$categories; + } + + /* + * @brief returns the categories for the user + * @return (Array) $categories + */ public static function getCategories() { $categories = self::$categories->categories(); if(count($categories) == 0) { @@ -169,7 +191,7 @@ class OC_Contacts_App { * @see OC_VCategories::loadFromVObject */ public static function loadCategoriesFromVCard(OC_VObject $contact) { - self::$categories->loadFromVObject($contact, true); + self::getVCategories()->loadFromVObject($contact, true); } public static function setLastModifiedHeader($contact) { |