]> err.no Git - scalable-opengroupware.org/commitdiff
bugfix
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 19 Oct 2004 13:24:47 +0000 (13:24 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 19 Oct 2004 13:24:47 +0000 (13:24 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@407 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/Main/ChangeLog
SOGo/Main/SOGoUserHomePage.m
SOGo/Main/SOGoUserHomePage.wox
SOGo/Main/Version

index 91bc56d7afcde9fa37285013e18377cc94dd304a..0f416d6f78e187e9b03fedd7c3d31b2cc1536250 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-19  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * SOGoUserHomePage.[wox|m]: changed hrefs to be computed dynamically
+         instead of being static (v0.9.15)
+
 2004-10-18  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.14
index 1161735a7e5fd9621fa231c39cb40573f3778e32..941e2a29db29a72acf10347bc31eb0ce6e0c53fb 100644 (file)
@@ -6,6 +6,14 @@
 {
 }
 
+- (NSString *)ownPath;
+- (NSString *)userFolderPath;
+- (NSString *)relativePathToUserFolderSubPath:(NSString *)_sub;
+
+- (NSString *)relativeCalendarPath;
+- (NSString *)relativeContactsPath;
+- (NSString *)relativeMailPath;
+  
 @end
 
 #include "common.h"
   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 */
index 4c8508051ef8a4beec0f56192cefd151218c6298..391f20f7063b78e8f2f474be4981072f5eb24e38 100644 (file)
   </h3>
 
   <ul>
-    <li><a href="Calendar/" ><var:string label:value="Calendar"    /></a></li>
-    <li><a href="Contacts/" ><var:string label:value="Addressbook" /></a></li>
-    <li><a href="Mail/"     ><var:string label:value="Mail"        /></a></li>
+    <li><a var:href="relativeCalendarPath"
+        ><var:string label:value="Calendar"/></a></li>
+    <li><a var:href="relativeContactsPath"
+        ><var:string label:value="Addressbook"/></a></li>
+    <li><a var:href="relativeMailPath"
+        ><var:string label:value="Mail"/></a></li>
   </ul>
 </var:component>
index cc039aca8fe720e89b35bf8bb715cdccb043159e..cf9e5c1262bbe256db9dcbe38538f8ad07693b99 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=14
+SUBMINOR_VERSION:=15