- (NSDictionary *)monthOverviewContext {
return [self objectForKey:@"WEMonthOverview"];
}
-- (NSArray *)monthOverviewQueryObjects {
+- (NSMutableArray *)monthOverviewQueryObjects {
return [[self monthOverviewContext] valueForKey:@"query"];
}
case 10: return @"10";
// TODO: find useful count!
default: {
- unsigned char buf[32];
+ char buf[32];
sprintf(buf, "%i", i);
return [[StrClass alloc] initWithCString:buf];
}
}
-- (void)takeContentValues:(WORequest *)_req
- inContext:(WOContext *)_ctx
- index:(int)_idx
+- (void)takeContentValues:(WORequest *)_req inContext:(WOContext *)_ctx
+ index:(int)_idx
{
WOComponent *comp;
NSString *s;
NSArray *array;
- int i, idx, cnt, count;
+ int i, cnt, count;
comp = [_ctx component];
array = [self->list valueInComponent:comp];
count = [array count];
[_ctx appendElementIDComponent:@"c"]; // append content mode
-
- cnt = [self->matrix[_idx] count];
- for (i=0; i<cnt; i++) {
+
+ for (i = 0, cnt = [self->matrix[_idx] count]; i < cnt; i++) {
+ int idx;
+
idx = [[self->matrix[_idx] objectAtIndex:i] intValue];
- if (self->index)
+ if (self->index != nil)
[self->index setUnsignedIntValue:idx inComponent:comp];
- if (self->item)
+ if (self->item != nil)
[self->item setValue:[array objectAtIndex:idx] inComponent:comp];
- s = (self->identifier)
+ s = (self->identifier != nil)
? [[self->identifier stringValueInComponent:comp] retain]
: retStrForInt(idx);
NSString *week;
int i, j;
unsigned int weekOfYear;
- unsigned char buf[32];
+ char buf[32];
[self _calcMatrixInContext:_ctx];
@end /* WEMonthOverview */
+
@implementation WEMonthLabel
- (id)initWithName:(NSString *)_name
[super dealloc];
}
+/* handle requests */
+
- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
NSDictionary *monthViewContextDict;
NSString *orient;
isEdge = ([orient rangeOfString:@"/"].length > 0);
monthViewContextDict = [_ctx monthOverviewContext];
- if ((tmp = [monthViewContextDict objectForKey:orient]) != nil) {
- if (!isEdge) {
- [_ctx appendElementIDComponent:orient];
- [self->template takeValuesFromRequest:_req inContext:_ctx];
- [_ctx deleteLastElementIDComponent];
- }
- else {
- [self->template takeValuesFromRequest:_req inContext:_ctx];
- }
+ if ((tmp = [monthViewContextDict objectForKey:orient]) == nil)
+ return;
+
+ if (!isEdge) {
+ [_ctx appendElementIDComponent:orient];
+ [self->template takeValuesFromRequest:_req inContext:_ctx];
+ [_ctx deleteLastElementIDComponent];
}
+ else
+ [self->template takeValuesFromRequest:_req inContext:_ctx];
}
- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
return result;
}
+/* generate response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSDictionary *monthViewContextDict;
NSMutableArray *queryContext;
@end /* WEMonthLabel */
+
@implementation WEMonthTitle
- (id)initWithName:(NSString *)_name
@end /* WEMonthTitle */
+
@interface WEMonthOverviewInfoMode : WEContextConditional
@end
@end /* WEMonthOverviewInfoMode */
+
@interface WEMonthOverviewContentMode : WEContextConditional
@end