mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 06:33:18 +00:00
Monotone-Parent: f75e6976fca1f78ba386ba4306bd6b4439f1de17
Monotone-Revision: 33c9bbe67c54b7e2a222ee34969604fb76e91600 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-07-16T19:35:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,30 +20,40 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSURL.h>
|
||||
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
#import <NGCards/NGVCard.h>
|
||||
#import <NGCards/NGVCardPhoto.h>
|
||||
#import <NGCards/CardElement.h>
|
||||
#import <NGCards/NSArray+NGCards.h>
|
||||
#import <NGExtensions/NSString+Ext.h>
|
||||
|
||||
#import <SoObjects/Contacts/SOGoContactObject.h>
|
||||
#import <Contacts/SOGoContactObject.h>
|
||||
|
||||
#import "UIxContactView.h"
|
||||
|
||||
@implementation UIxContactView
|
||||
|
||||
/* accessors */
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
photosURL = nil;
|
||||
}
|
||||
|
||||
- (NSString *)tabSelection {
|
||||
NSString *selection;
|
||||
|
||||
selection = [self queryParameterForKey:@"tab"];
|
||||
if (selection == nil)
|
||||
selection = @"attributes";
|
||||
return selection;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[photosURL release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/* accessors */
|
||||
|
||||
- (NSString *) _cardStringWithLabel: (NSString *) label
|
||||
value: (NSString *) value
|
||||
{
|
||||
@@ -630,4 +640,34 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSArray *) photosURL
|
||||
{
|
||||
NSArray *photoElements;
|
||||
NSURL *soURL;
|
||||
NSString *baseInlineURL, *photoURL;
|
||||
NGVCardPhoto *photo;
|
||||
int count, max;
|
||||
|
||||
if (!photosURL)
|
||||
{
|
||||
soURL = [[self clientObject] soURL];
|
||||
baseInlineURL = [soURL absoluteString];
|
||||
photoElements = [card childrenWithTag: @"photo"];
|
||||
max = [photoElements count];
|
||||
photosURL = [[NSMutableArray alloc] initWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
photo = [photoElements objectAtIndex: count];
|
||||
if ([photo isInline])
|
||||
photoURL = [NSString stringWithFormat: @"%@/photo%d",
|
||||
baseInlineURL, count];
|
||||
else
|
||||
photoURL = [photo value: 0];
|
||||
[photosURL addObject: photoURL];
|
||||
}
|
||||
}
|
||||
|
||||
return photosURL;
|
||||
}
|
||||
|
||||
@end /* UIxContactView */
|
||||
|
||||
Reference in New Issue
Block a user