diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index e6b929bf5..356deb538 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -71,6 +71,11 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK; return self; } +- (NSString *) modulePath +{ + return @"Contacts"; +} + - (void) _setupContext { SOGoUser *activeUser; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index 4c39ea782..a0d7e68f9 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -87,6 +87,11 @@ [super dealloc]; } +- (NSString *) modulePath +{ + return @"Mail"; +} + - (void) _setupContext { SOGoUser *activeUser; diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index f98b43b6c..0443c7154 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -360,38 +360,19 @@ static SoProduct *commonProduct = nil; - (NSString *) modulePath { - SOGoObject *currentClient, *parent; - BOOL found; - NSString *hostLessURL; - Class objectClass, userFolderClass; - if ([[self parent] respondsToSelector: @selector(modulePath)]) - return [NSString stringWithFormat: @"%@/%@", [[self clientObject] baseURLInContext: context], [[self parent] modulePath]]; - - currentClient = [self clientObject]; - if (currentClient - && [currentClient isKindOfClass: [SOGoObject class]]) { - userFolderClass = [SOGoUserFolder class]; + NSString *baseURL; - objectClass = [currentClient class]; - found = (objectClass == userFolderClass); - while (!found && currentClient) - { - parent = [currentClient container]; - objectClass = [parent class]; - if (objectClass == userFolderClass) - found = YES; - else - currentClient = parent; - } + baseURL = [[self clientObject] baseURLInContext: context]; + + if ([baseURL hasSuffix: [NSString stringWithFormat: @"%@/", [[self parent] modulePath]]]) + return baseURL; + + return [NSString stringWithFormat: @"%@%@", baseURL, [[self parent] modulePath]]; } - else - currentClient = [WOApplication application]; - - hostLessURL = [[currentClient baseURLInContext: context] hostlessURL]; - return [hostLessURL substringToIndex: [hostLessURL length] - 1]; + return nil; } - (NSString *) ownPath