diff --git a/ChangeLog b/ChangeLog index a94f11615..11a667571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-12 Wolfgang Sourdeau + + * UI/Common/UIxJSClose.[hm]: new UIxComponent designed to display + a very light page with javascript code to close a window, by + calling a method on the opener if specified. This component is + designed to work as a response to form postings. + 2006-10-11 Wolfgang Sourdeau * SoObjects/Appointments/SOGoTaskObject.[hm]: clone of diff --git a/UI/Common/UIxJSClose.h b/UI/Common/UIxJSClose.h new file mode 100644 index 000000000..dd51b869a --- /dev/null +++ b/UI/Common/UIxJSClose.h @@ -0,0 +1,41 @@ +/* UIxJSClose.h - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXJSCLOSE_H +#define UIXJSCLOSE_H + +#import + +@class NSString; + +@interface UIxJSClose : UIxComponent +{ + NSString *refreshMethod; +} + +- (void) setRefreshMethod: (NSString *) method; +- (NSString *) refreshMethod; +- (BOOL) hasRefreshMethod; + +@end + +#endif /* UIXJSCLOSE_H */ diff --git a/UI/Common/UIxJSClose.m b/UI/Common/UIxJSClose.m new file mode 100644 index 000000000..96dc6704f --- /dev/null +++ b/UI/Common/UIxJSClose.m @@ -0,0 +1,71 @@ +/* UIxJSClose.m - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "UIxJSClose.h" + +@implementation UIxJSClose + +- (id) init +{ + if ((self = [super init])) + refreshMethod = nil; + + return self; +} + +- (void) dealloc +{ + if (refreshMethod) + [refreshMethod release]; + [super dealloc]; +} + +- (NSString *) doctype +{ + return (@"\n" + @""); +} + +- (void) setRefreshMethod: (NSString *) method +{ + if (refreshMethod) + [refreshMethod release]; + refreshMethod = method; + if (refreshMethod) + [refreshMethod retain]; +} + +- (NSString *) refreshMethod +{ + return refreshMethod; +} + +- (BOOL) hasRefreshMethod +{ + return (refreshMethod != nil); +} + +@end