From 73302ee34042a0bfc31fe34951a381a1e0526ba2 Mon Sep 17 00:00:00 2001 From: znek Date: Tue, 21 Dec 2004 17:50:08 +0000 Subject: [PATCH] extended WOKeyValueConditional git-svn-id: http://svn.opengroupware.org/SOPE/trunk@456 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/WOExtensions/ChangeLog | 4 ++++ sope-appserver/WOExtensions/Version | 2 +- .../WOExtensions/WOKeyValueConditional.api | 1 + .../WOExtensions/WOKeyValueConditional.m | 22 ++++++++++--------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sope-appserver/WOExtensions/ChangeLog b/sope-appserver/WOExtensions/ChangeLog index 0f5fa1db..14b7a2d8 100644 --- a/sope-appserver/WOExtensions/ChangeLog +++ b/sope-appserver/WOExtensions/ChangeLog @@ -1,3 +1,7 @@ +2004-12-21 Marcus Mueller + + * WOKeyValueConditional.[api,m]: added "negate" binding (v4.3.21) + 2004-12-14 Marcus Mueller * WOExtensions.xcode: minor fixes and updated diff --git a/sope-appserver/WOExtensions/Version b/sope-appserver/WOExtensions/Version index 7cb001ac..49f242e5 100644 --- a/sope-appserver/WOExtensions/Version +++ b/sope-appserver/WOExtensions/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=20 +SUBMINOR_VERSION:=21 diff --git a/sope-appserver/WOExtensions/WOKeyValueConditional.api b/sope-appserver/WOExtensions/WOKeyValueConditional.api index 836ca49a..a84ae058 100644 --- a/sope-appserver/WOExtensions/WOKeyValueConditional.api +++ b/sope-appserver/WOExtensions/WOKeyValueConditional.api @@ -3,4 +3,5 @@ + \ No newline at end of file diff --git a/sope-appserver/WOExtensions/WOKeyValueConditional.m b/sope-appserver/WOExtensions/WOKeyValueConditional.m index 86e7dcb4..90cc8b3b 100644 --- a/sope-appserver/WOExtensions/WOKeyValueConditional.m +++ b/sope-appserver/WOExtensions/WOKeyValueConditional.m @@ -31,6 +31,9 @@ WOAssociation *key; WOAssociation *value; WOElement *template; + + // non-WO + WOAssociation *negate; } @end /* WOKeyValueConditional */ @@ -44,9 +47,9 @@ 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; @@ -70,13 +73,11 @@ // 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]; @@ -142,6 +143,7 @@ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { 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); -- 2.39.5