+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
{
}
+- (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 */
</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>