From 4294ef0c8afe532df3f33ac4670a1c882d24bec6 Mon Sep 17 00:00:00 2001 From: znek Date: Tue, 19 Oct 2004 13:24:47 +0000 Subject: [PATCH] bugfix git-svn-id: http://svn.opengroupware.org/SOGo/trunk@407 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/Main/ChangeLog | 5 +++ SOGo/Main/SOGoUserHomePage.m | 56 ++++++++++++++++++++++++++++++++++ SOGo/Main/SOGoUserHomePage.wox | 9 ++++-- SOGo/Main/Version | 2 +- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/SOGo/Main/ChangeLog b/SOGo/Main/ChangeLog index 91bc56d7..0f416d6f 100644 --- a/SOGo/Main/ChangeLog +++ b/SOGo/Main/ChangeLog @@ -1,3 +1,8 @@ +2004-10-19 Marcus Mueller + + * SOGoUserHomePage.[wox|m]: changed hrefs to be computed dynamically + instead of being static (v0.9.15) + 2004-10-18 Marcus Mueller * v0.9.14 diff --git a/SOGo/Main/SOGoUserHomePage.m b/SOGo/Main/SOGoUserHomePage.m index 1161735a..941e2a29 100644 --- a/SOGo/Main/SOGoUserHomePage.m +++ b/SOGo/Main/SOGoUserHomePage.m @@ -6,6 +6,14 @@ { } +- (NSString *)ownPath; +- (NSString *)userFolderPath; +- (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub; + +- (NSString *)relativeCalendarPath; +- (NSString *)relativeContactsPath; +- (NSString *)relativeMailPath; + @end #include "common.h" @@ -35,4 +43,52 @@ return nil; } +/* paths */ + +- (NSString *)ownPath { + NSString *uri; + NSRange r; + + uri = [[[self context] request] uri]; + + /* first: cut off query parameters */ + + r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; + if (r.length > 0) + uri = [uri substringToIndex:r.location]; + return uri; +} + +- (NSString *)userFolderPath { + WOContext *ctx; + NSArray *traversalObjects; + NSString *url; + + ctx = [self context]; + traversalObjects = [ctx objectTraversalStack]; + url = [[traversalObjects objectAtIndex:1] + baseURLInContext:ctx]; + return [[NSURL URLWithString:url] path]; +} + +- (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub { + NSString *dst, *rel; + + dst = [[self userFolderPath] stringByAppendingPathComponent:_sub]; + rel = [dst urlPathRelativeToPath:[self ownPath]]; + return rel; +} + +- (NSString *)relativeCalendarPath { + return [self relativePathToUserFolderSubPath:@"Calendar/"]; +} + +- (NSString *)relativeContactsPath { + return [self relativePathToUserFolderSubPath:@"Contacts/"]; +} + +- (NSString *)relativeMailPath { + return [self relativePathToUserFolderSubPath:@"Mail/"]; +} + @end /* SOGoUserHomePage */ diff --git a/SOGo/Main/SOGoUserHomePage.wox b/SOGo/Main/SOGoUserHomePage.wox index 4c850805..391f20f7 100644 --- a/SOGo/Main/SOGoUserHomePage.wox +++ b/SOGo/Main/SOGoUserHomePage.wox @@ -14,8 +14,11 @@
    -
  • -
  • -
  • +
  • +
  • +
diff --git a/SOGo/Main/Version b/SOGo/Main/Version index cc039aca..cf9e5c12 100644 --- a/SOGo/Main/Version +++ b/SOGo/Main/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=14 +SUBMINOR_VERSION:=15 -- 2.39.5