+2004-12-21 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * WOKeyValueConditional.[api,m]: added "negate" binding (v4.3.21)
+
2004-12-14 Marcus Mueller <znek@mulle-kybernetik.com>
* WOExtensions.xcode: minor fixes and updated
<wo class="WOKeyValueConditional">
<binding name="key" required="YES" />
<binding name="value" required="YES" />
+ <binding name="negate" defaults="YES/NO"/>
</wo>
\ No newline at end of file
WOAssociation *key;
WOAssociation *value;
WOElement *template;
+
+ // non-WO
+ WOAssociation *negate;
}
@end /* WOKeyValueConditional */
template:(WOElement *)_c
{
if ((self = [super initWithName:_name associations:_config template:_c])) {
- self->key = WOExtGetProperty(_config, @"key");
- self->value = WOExtGetProperty(_config, @"value");
-
+ self->key = WOExtGetProperty(_config, @"key");
+ self->value = WOExtGetProperty(_config, @"value");
+ self->negate = WOExtGetProperty(_config, @"negate");
self->template = RETAIN(_c);
}
return self;
// state
static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) {
- WOComponent *c;
- BOOL doShow = NO;
- BOOL doNegate = NO;
- id v, kv;
- NSString *k;
-
- c = [_ctx component];
+ WOComponent *c = [_ctx component];
+ BOOL doShow = NO;
+ BOOL doNegate = [self->negate boolValueInComponent:c];
+ id v, kv;
+ NSString *k;
k = [self->key stringValueInComponent:c];
v = [self->value valueInComponent:c];
if (self->key) [str appendFormat:@" key=%@", self->key];
if (self->value) [str appendFormat:@" value=%@", self->value];
+ if (self->negate) [str appendFormat:@" negate=%@", self->negate];
if (self->template) [str appendFormat:@" template=%@", self->template];
return AUTORELEASE(str);