/*
Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
*/
// $Id$
+#include <NGObjWeb/WOComponent.h>
-#include <NGObjWeb/NGObjWeb.h>
+@class NSString;
@interface UIxMailMoveToPopUp : WOComponent
{
NSString *identifier;
NSString *callback;
- id rootNodes;
- id item;
+ id rootNodes;
+ id item;
}
- (NSString *)itemDisplayString;
- (NSString *)itemURL;
- (void)_appendEntriesFromNodeDict:(NSDictionary *)_dict
- toList:(NSMutableArray *)_list
- withPrefix:(NSString *)_pathPrefix;
+ toList:(NSMutableArray *)_list
+ withPrefix:(NSString *)_pathPrefix;
+
@end
#include "common.h"
NSDictionary *dict;
r = [NSMutableArray arrayWithCapacity:10];
+
/* INBOX node */
dict = [[self->rootNodes objectForKey:@"children"] objectAtIndex:0];
[self _appendEntriesFromNodeDict:dict toList:r withPrefix:nil];
}
- (void)_appendEntriesFromNodeDict:(NSDictionary *)_dict
- toList:(NSMutableArray *)_list
- withPrefix:(NSString *)_pathPrefix
+ toList:(NSMutableArray *)_list
+ withPrefix:(NSString *)_pathPrefix
{
NSMutableDictionary *e;
NSString *title, *link;
- NSArray *children;
+ NSArray *children;
unsigned count, i;
title = [_dict objectForKey:@"title"];
- link = [_dict objectForKey:@"link"];
+ link = [_dict objectForKey:@"link"];
+
e = [[NSMutableDictionary alloc] initWithCapacity:2];
- if(!_pathPrefix)
- _pathPrefix = title;
- else
- _pathPrefix = [NSString stringWithFormat:@"%@.%@", _pathPrefix, title];
+ _pathPrefix = (_pathPrefix == nil)
+ ? title
+ : [NSString stringWithFormat:@"%@.%@", _pathPrefix, title];
[e setObject:_pathPrefix forKey:@"title"];
- [e setObject:link forKey:@"link"];
+ [e setObject:link forKey:@"link"];
[_list addObject:e];
- [e release];
+ [e release]; e = nil;
children = [_dict objectForKey:@"children"];
count = [children count];
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
NSDictionary *dict;
dict = [children objectAtIndex:i];
- (NSString *)selectItemJS {
static NSString *selectJS = \
@"javascript:if(!this.hasAttribute('disabled')) %@('%@');";
- return [NSString stringWithFormat:selectJS,
- self->callback,
- [self itemURL]];
+ return [NSString stringWithFormat:selectJS, self->callback, [self itemURL]];
}
-@end
+@end /* UIxMailMoveToPopUp */