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