2 Copyright (C) 2004-2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include <SOGoUI/UIxComponent.h>
24 @interface UIxPageFrame : UIxComponent
33 #include <NGObjWeb/SoComponent.h>
35 @implementation UIxPageFrame
39 [self->title release];
45 - (void)setTitle:(NSString *)_value {
46 ASSIGNCOPY(self->title, _value);
49 if ([self isUIxDebugEnabled])
52 return [self labelForKey:@"OpenGroupware.org"];
55 - (void)setItem:(id)_item {
56 ASSIGN(self->item, _item);
62 - (NSString *)ownerInContext {
63 return [[self clientObject] ownerInContext:[self context]];
68 - (NSString *)helpURL {
69 return [NSString stringWithFormat:@"help/%@.html", self->title];
71 - (NSString *)helpWindowTarget {
72 return [NSString stringWithFormat:@"Help_%@", self->title];
79 [self->item release]; self->item = nil;
84 // TODO: I think all this should be done by the clientObject?!
86 - (NSString *)relativeHomePath {
87 return [self relativePathToUserFolderSubPath:@""];
90 - (NSString *)relativeCalendarPath {
91 return [self relativePathToUserFolderSubPath:@"Calendar/"];
94 - (NSString *)relativeContactsPath {
95 return [self relativePathToUserFolderSubPath:@"Contacts/"];
98 - (NSString *)relativeMailPath {
99 return [self relativePathToUserFolderSubPath:@"Mail/"];
102 /* page based JavaScript */
104 - (WOResourceManager *)pageResourceManager {
105 WOResourceManager *rm;
107 if ((rm = [[[self context] page] resourceManager]) == nil)
108 rm = [[WOApplication application] resourceManager];
112 - (NSString *)pageJavaScriptURL {
113 static NSMutableDictionary *pageToURL = nil;
114 WOResourceManager *rm;
116 NSString *jsname, *pageName;
119 page = [[self context] page];
120 pageName = NSStringFromClass([page class]);
121 // TODO: does not seem to work! (gets reset): pageName = [page name];
123 if ((url = [pageToURL objectForKey:pageName]) != nil)
124 return [url isNotNull] ? url : nil;
126 if (pageToURL == nil)
127 pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
129 rm = [self pageResourceManager];
130 jsname = [pageName stringByAppendingString:@".js"];
132 url = [rm urlForResourceNamed:jsname
134 [[NSBundle bundleForClass:[page class]] bundlePath]
136 request:[[self context] request]];
139 [pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
143 - (BOOL)hasPageSpecificJavaScript {
144 return [[self pageJavaScriptURL] length] > 0 ? YES : NO;
147 @end /* UIxPageFrame */