diff --git a/ChangeLog b/ChangeLog index ddbdbbef6..c532738db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-12-22 Wolfgang Sourdeau + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame + -composeAction]): method imported from removed container modules. + ([UIxMailMainFrame -mailFolderName]): method imported from removed + container modules. + * UI/MailerUI/UIxMailPopupView.m: a new special popup component for wrapping UIxMailView with the "popupview" action. diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index d15e4cbfa..c9063d6e8 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -19,6 +19,7 @@ 02111-1307, USA. */ +#import #import #import "UIxMailMainFrame.h" @@ -183,4 +184,55 @@ static NSString *treeRootClassName = nil; @"", errorText]; } +/* FIXME: migrated methods which might not work yet... */ +#warning check this +- (NSString *) mailFolderName +{ + NSMutableArray *mailboxes; + SOGoMailObject *currentObject; + + mailboxes = [NSMutableArray new]; + [mailboxes autorelease]; + + currentObject = [self clientObject]; + while (![currentObject isKindOfClass: [SOGoMailAccounts class]]) + { + [mailboxes insertObject: [currentObject nameInContainer] atIndex: 0]; + currentObject = [currentObject container]; + } + + return [NSString stringWithFormat: @"/%@", + [mailboxes componentsJoinedByString: @"/"]]; +} + +- (id) composeAction +{ + NSArray *c; + NSString *inbox, *url, *parameter; + NSMutableDictionary *urlParams; + id actionResult; + + c = [[self clientObject] toManyRelationshipKeys]; + if ([c count] > 0) + { + urlParams = [NSMutableDictionary new]; + [urlParams autorelease]; + + parameter = [self queryParameterForKey: @"mailto"]; + if (parameter) + [urlParams setObject: parameter + forKey: @"mailto"]; + inbox = [NSString stringWithFormat: @"%@/INBOX", + [c objectAtIndex: 0]]; + url = [inbox composeURLWithAction: @"compose" + parameters: urlParams + andHash: NO]; + actionResult = [self redirectToLocation: url]; + } + else + actionResult = self; + + return actionResult; +} + @end /* UIxMailMainFrame */