From 470706c4737889d31aeb0ab218144fef3740404c Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 6 Sep 2006 22:25:46 +0000 Subject: [PATCH] Monotone-Parent: 30ddfff1991c7e39d67fc5f3c46b308d273ee14a Monotone-Revision: ea3e5a63ba8435e702b8af87dceec9a5c5e21e6a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-06T22:25:46 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ UI/SOGoUI/UIxComponent.m | 29 ++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ea03e541b..532a7cc83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ sure the numbers in dateString are formatted so as to take 4 chars for the year and 2 for the day and the month, otherwise NSCalendarDate will return a nil date. + ([UIxComponent -applicationPath]): return a path based on the + object's context instead of the second level in SOGo's object + hierarchy... 2006-09-05 Wolfgang Sourdeau diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 87d8b4b58..2c19171a5 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -27,6 +27,8 @@ #import #import +#import +#import @interface UIxComponent (PrivateAPI) - (void)_parseQueryString:(NSString *)_s; @@ -306,7 +308,32 @@ static BOOL uixDebugEnabled = NO; - (NSString *) applicationPath { - return [self _urlForTraversalObject: 2]; + SOGoObject *currentClient, *parent; + NSString *url; + BOOL found; + Class parentClass, groupFolderClass, userFolderClass; + WOContext *ctx; + + found = NO; + groupFolderClass = [SOGoCustomGroupFolder class]; + userFolderClass = [SOGoUserFolder class]; + + currentClient = [self clientObject]; + while (!found && currentClient) + { + parent = [currentClient container]; + parentClass = [parent class]; + if (parentClass == groupFolderClass + || parentClass == userFolderClass) + found = YES; + else + currentClient = parent; + } + + ctx = [self context]; + url = [currentClient baseURLInContext: ctx]; + + return [[NSURL URLWithString: url] path]; } - (NSString *) resourcesPath