mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-05 20:10:33 +00:00
Monotone-Parent: 8566d6fbfa896a774b9907c3125e7b3de87296cd
Monotone-Revision: 2ad8b0c019808014c990f51cc69c4457fdb537c6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-07-28T22:59:11 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -31,9 +31,23 @@
|
||||
@interface UIxPageFrame : UIxComponent
|
||||
{
|
||||
NSString *title;
|
||||
id item;
|
||||
id item;
|
||||
BOOL isPopup;
|
||||
}
|
||||
|
||||
- (NSString *) pageJavaScriptURL;
|
||||
- (NSString *) productJavaScriptURL;
|
||||
- (BOOL) hasPageSpecificJavaScript;
|
||||
- (BOOL) hasProductSpecificJavaScript;
|
||||
|
||||
- (NSString *) pageCSSURL;
|
||||
- (NSString *) productCSSURL;
|
||||
- (BOOL) hasPageSpecificCSS;
|
||||
- (BOOL) hasProductSpecificCSS;
|
||||
|
||||
- (void) setPopup: (BOOL) popup;
|
||||
- (BOOL) isPopup;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* UIXPAGEFRAME_H */
|
||||
|
||||
+68
-72
@@ -39,6 +39,7 @@
|
||||
- (void)setTitle:(NSString *)_value {
|
||||
ASSIGNCOPY(self->title, _value);
|
||||
}
|
||||
|
||||
- (NSString *)title {
|
||||
if ([self isUIxDebugEnabled])
|
||||
return self->title;
|
||||
@@ -49,6 +50,7 @@
|
||||
- (void)setItem:(id)_item {
|
||||
ASSIGN(self->item, _item);
|
||||
}
|
||||
|
||||
- (id)item {
|
||||
return self->item;
|
||||
}
|
||||
@@ -59,14 +61,16 @@
|
||||
|
||||
/* Help URL/target */
|
||||
|
||||
- (NSString *)helpURL {
|
||||
- (NSString *)helpURL
|
||||
{
|
||||
return [NSString stringWithFormat: @"help/%@.html", self->title];
|
||||
}
|
||||
- (NSString *)helpWindowTarget {
|
||||
|
||||
- (NSString *)helpWindowTarget
|
||||
{
|
||||
return [NSString stringWithFormat: @"Help_%@", self->title];
|
||||
}
|
||||
|
||||
|
||||
/* notifications */
|
||||
|
||||
- (void)sleep {
|
||||
@@ -77,108 +81,66 @@
|
||||
/* URL generation */
|
||||
// TODO: I think all this should be done by the clientObject?!
|
||||
|
||||
- (NSString *)relativeHomePath {
|
||||
- (NSString *) relativeHomePath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @""];
|
||||
}
|
||||
|
||||
- (NSString *)relativeCalendarPath {
|
||||
- (NSString *)relativeCalendarPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Calendar/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeContactsPath {
|
||||
- (NSString *)relativeContactsPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Contacts/"];
|
||||
}
|
||||
|
||||
- (NSString *)relativeMailPath {
|
||||
- (NSString *)relativeMailPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"Mail/"];
|
||||
}
|
||||
|
||||
- (NSString *)logoffPath {
|
||||
- (NSString *)logoffPath
|
||||
{
|
||||
return [self relativePathToUserFolderSubPath: @"logoff"];
|
||||
}
|
||||
|
||||
/* page based JavaScript */
|
||||
|
||||
- (WOResourceManager *)pageResourceManager {
|
||||
WOResourceManager *rm;
|
||||
|
||||
if ((rm = [[[self context] page] resourceManager]) == nil)
|
||||
rm = [[WOApplication application] resourceManager];
|
||||
return rm;
|
||||
/* popup handling */
|
||||
- (void) setPopup: (BOOL) popup
|
||||
{
|
||||
isPopup = popup;
|
||||
}
|
||||
|
||||
- (BOOL) isPopup
|
||||
{
|
||||
WOComponent *page;
|
||||
|
||||
page = [[self context] page];
|
||||
|
||||
return ([page respondsToSelector: @selector(isPopup)]
|
||||
&& [page isPopup]);
|
||||
return isPopup;
|
||||
}
|
||||
|
||||
/* page based JavaScript */
|
||||
|
||||
- (NSString *) pageJavaScriptURL
|
||||
{
|
||||
static NSMutableDictionary *pageToURL = nil;
|
||||
WOResourceManager *rm;
|
||||
WOComponent *page;
|
||||
NSString *jsname, *pageName;
|
||||
NSString *url;
|
||||
NSString *pageJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
pageName = NSStringFromClass([page class]);
|
||||
// TODO: does not seem to work! (gets reset): pageName = [page name];
|
||||
|
||||
if ((url = [pageToURL objectForKey:pageName]) != nil)
|
||||
return [url isNotNull] ? url : nil;
|
||||
pageJSFilename = [NSString stringWithFormat: @"%@.js",
|
||||
NSStringFromClass([page class])];
|
||||
|
||||
if (pageToURL == nil)
|
||||
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
jsname = [pageName stringByAppendingString: @".js"];
|
||||
|
||||
url = [rm urlForResourceNamed: jsname
|
||||
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
|
||||
languages:nil
|
||||
request:[[self context] request]];
|
||||
|
||||
/* cache */
|
||||
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
|
||||
|
||||
return url;
|
||||
return [self urlForResourceFilename: pageJSFilename];
|
||||
}
|
||||
|
||||
- (NSString *) productJavaScriptURL
|
||||
{
|
||||
static NSMutableDictionary *pageToURL = nil;
|
||||
WOResourceManager *rm;
|
||||
WOComponent *page;
|
||||
NSString *jsname, *pageName;
|
||||
NSString *url;
|
||||
NSString *fwJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
fwJSFilename = [NSString stringWithFormat: @"%@.js",
|
||||
[page frameworkName]];
|
||||
|
||||
page = [[self context] page];
|
||||
pageName = NSStringFromClass([page class]);
|
||||
// TODO: does not seem to work! (gets reset): pageName = [page name];
|
||||
|
||||
if ((url = [pageToURL objectForKey:pageName]) != nil)
|
||||
return [url isNotNull] ? url : nil;
|
||||
|
||||
if (pageToURL == nil)
|
||||
pageToURL = [[NSMutableDictionary alloc] initWithCapacity:32];
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
jsname = [[page frameworkName] stringByAppendingString: @".js"];
|
||||
|
||||
url = [rm urlForResourceNamed: jsname
|
||||
inFramework: [[NSBundle bundleForClass: [page class]] bundlePath]
|
||||
languages:nil
|
||||
request:[[self context] request]];
|
||||
|
||||
/* cache */
|
||||
[pageToURL setObject:(url ? url : (id)[NSNull null]) forKey:pageName];
|
||||
|
||||
return url;
|
||||
return [self urlForResourceFilename: fwJSFilename];
|
||||
}
|
||||
|
||||
- (BOOL) hasPageSpecificJavaScript
|
||||
@@ -191,4 +153,38 @@
|
||||
return ([[self productJavaScriptURL] length] > 0);
|
||||
}
|
||||
|
||||
- (NSString *) pageCSSURL
|
||||
{
|
||||
WOComponent *page;
|
||||
NSString *pageJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
pageJSFilename = [NSString stringWithFormat: @"%@.css",
|
||||
NSStringFromClass([page class])];
|
||||
|
||||
return [self urlForResourceFilename: pageJSFilename];
|
||||
}
|
||||
|
||||
- (NSString *) productCSSURL
|
||||
{
|
||||
WOComponent *page;
|
||||
NSString *fwJSFilename;
|
||||
|
||||
page = [[self context] page];
|
||||
fwJSFilename = [NSString stringWithFormat: @"%@.css",
|
||||
[page frameworkName]];
|
||||
|
||||
return [self urlForResourceFilename: fwJSFilename];
|
||||
}
|
||||
|
||||
- (BOOL) hasPageSpecificCSS
|
||||
{
|
||||
return ([[self pageCSSURL] length] > 0);
|
||||
}
|
||||
|
||||
- (BOOL) hasProductSpecificCSS
|
||||
{
|
||||
return ([[self productCSSURL] length] > 0);
|
||||
}
|
||||
|
||||
@end /* UIxPageFrame */
|
||||
|
||||
+9
-17
@@ -19,18 +19,13 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if LIB_FOUNDATION_LIBRARY
|
||||
# include <Foundation/exceptions/GeneralExceptions.h>
|
||||
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
|
||||
# include <NGExtensions/NGObjectMacros.h>
|
||||
# include <NGExtensions/NSString+Ext.h>
|
||||
#endif
|
||||
#import <NGExtensions/NGExtensions.h>
|
||||
#import <NGObjWeb/NGObjWeb.h>
|
||||
#import <NGObjWeb/SoObjects.h>
|
||||
|
||||
#include <NGExtensions/NGExtensions.h>
|
||||
#include <NGObjWeb/NGObjWeb.h>
|
||||
#include <NGObjWeb/SoObjects.h>
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
#import <NGObjWeb/SoComponent.h>
|
||||
|
||||
@class NSArray, NSDictionary;
|
||||
|
||||
@@ -42,8 +37,6 @@
|
||||
}
|
||||
@end
|
||||
|
||||
#include <NGObjWeb/SoComponent.h>
|
||||
|
||||
@implementation UIxToolbar
|
||||
|
||||
- (void)dealloc {
|
||||
@@ -192,14 +185,13 @@
|
||||
return label;
|
||||
}
|
||||
|
||||
- (id) buttonImage {
|
||||
WOResourceManager *rm;
|
||||
- (id) buttonImage
|
||||
{
|
||||
NSString *image;
|
||||
|
||||
rm = [self pageResourceManager];
|
||||
image = [buttonInfo objectForKey: @"image"];
|
||||
if (image && [image length] > 0)
|
||||
image = [rm urlForResourceNamed: image];
|
||||
image = [self urlForResourceFilename: image];
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -213,7 +205,7 @@
|
||||
|
||||
if ((onOffKey = [[self buttonInfo] valueForKey:@"enabled"]) == nil)
|
||||
return YES;
|
||||
|
||||
|
||||
return [[[[self context] page] valueForKeyPath:onOffKey] boolValue];
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,6 @@
|
||||
};
|
||||
|
||||
categories = {
|
||||
SOGoUserLogin = {
|
||||
methods = {
|
||||
logoff = {
|
||||
protectedBy = "View";
|
||||
pageName = "UIxUserLogoff";
|
||||
actionName = "logoffUser";
|
||||
}
|
||||
};
|
||||
};
|
||||
SOGoObject = {
|
||||
methods = {
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user