o handle isDisplayStringBefore binding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18117 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Manuel Guesdon 2003-11-23 18:33:29 +00:00
parent 6697c92c98
commit 2970cf04f3
4 changed files with 43 additions and 2 deletions

View file

@ -48,6 +48,9 @@
GSWAssociation* _escapeHTML; GSWAssociation* _escapeHTML;
GSWAssociation* _itemDisabled; GSWAssociation* _itemDisabled;
BOOL _defaultEscapeHTML; BOOL _defaultEscapeHTML;
//GSWeb Additions {
GSWAssociation* _isDisplayStringBefore;
// }
}; };
-(id)initWithName:(NSString*)name -(id)initWithName:(NSString*)name

View file

@ -61,6 +61,8 @@ Bindings
disabled If evaluated to yes, the check box appear inactivated. disabled If evaluated to yes, the check box appear inactivated.
escapeHTML If evaluated to yes, escape displayString escapeHTML If evaluated to yes, escape displayString
isDisplayStringBefore If evaluated to no, displayString is displayed after radio button.
**/ **/
//==================================================================== //====================================================================
@ -144,6 +146,12 @@ Bindings
_escapeHTML = [[associations objectForKey:escapeHTML__Key _escapeHTML = [[associations objectForKey:escapeHTML__Key
withDefaultObject:[_escapeHTML autorelease]] retain]; withDefaultObject:[_escapeHTML autorelease]] retain];
NSDebugMLLog(@"gswdync",@"escapeHTML=%@",_escapeHTML); NSDebugMLLog(@"gswdync",@"escapeHTML=%@",_escapeHTML);
if (!WOStrictFlag)
{
_isDisplayStringBefore=[[associations objectForKey:isDisplayStringBefore__Key
withDefaultObject:[_isDisplayStringBefore autorelease]] retain];
};
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
@ -162,6 +170,7 @@ Bindings
DESTROY(_displayString); DESTROY(_displayString);
DESTROY(_itemDisabled); DESTROY(_itemDisabled);
DESTROY(_escapeHTML); DESTROY(_escapeHTML);
DESTROY(_isDisplayStringBefore);//GSWeb Only
[super dealloc]; [super dealloc];
} }
@ -390,6 +399,7 @@ Bindings
id valueValue=nil; id valueValue=nil;
id itemValue=nil; id itemValue=nil;
BOOL disabledInContext=NO; BOOL disabledInContext=NO;
BOOL isDisplayStringBefore=NO;
NSArray* listValue=[_list valueInComponent:component]; NSArray* listValue=[_list valueInComponent:component];
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)], NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
@ -414,7 +424,14 @@ Bindings
[_index setValue:[NSNumber numberWithShort:i] [_index setValue:[NSNumber numberWithShort:i]
inComponent:component]; inComponent:component];
if (_isDisplayStringBefore)
isDisplayStringBefore=[self evaluateCondition:_isDisplayStringBefore
inContext:context];
displayStringValue=[_displayString valueInComponent:component]; displayStringValue=[_displayString valueInComponent:component];
if (isDisplayStringBefore)
[response appendContentHTMLString:displayStringValue];
[response appendContentString:@"<INPUT NAME=\""]; [response appendContentString:@"<INPUT NAME=\""];
[response appendContentString:name]; [response appendContentString:name];
@ -462,7 +479,8 @@ Bindings
[response appendContentCharacter:'>']; [response appendContentCharacter:'>'];
[response appendContentString:prefixValue]; [response appendContentString:prefixValue];
[response appendContentHTMLString:displayStringValue]; if (!isDisplayStringBefore)
[response appendContentHTMLString:displayStringValue];
[response appendContentString:suffixValue]; [response appendContentString:suffixValue];
}; };
}; };

View file

@ -45,6 +45,9 @@
GSWAssociation* _prefix; GSWAssociation* _prefix;
GSWAssociation* _suffix; GSWAssociation* _suffix;
GSWAssociation* _displayString; GSWAssociation* _displayString;
//GSWeb Additions {
GSWAssociation* _isDisplayStringBefore;
// }
GSWAssociation* _escapeHTML; GSWAssociation* _escapeHTML;
BOOL _defaultEscapeHTML; BOOL _defaultEscapeHTML;
BOOL _autoValue; BOOL _autoValue;

View file

@ -62,6 +62,7 @@ Bindings
escapeHTML If evaluated to yes, escape displayString escapeHTML If evaluated to yes, escape displayString
isDisplayStringBefore If evaluated to yes, displayString is displayed before radio button
**/ **/
//==================================================================== //====================================================================
@implementation GSWRadioButtonList @implementation GSWRadioButtonList
@ -127,6 +128,12 @@ Bindings
withDefaultObject:[_suffix autorelease]] retain]; withDefaultObject:[_suffix autorelease]] retain];
_displayString=[[associations objectForKey:displayString__Key _displayString=[[associations objectForKey:displayString__Key
withDefaultObject:[_displayString autorelease]] retain]; withDefaultObject:[_displayString autorelease]] retain];
if (!WOStrictFlag)
{
_isDisplayStringBefore=[[associations objectForKey:isDisplayStringBefore__Key
withDefaultObject:[_isDisplayStringBefore autorelease]] retain];
};
_escapeHTML=[[associations objectForKey:escapeHTML__Key _escapeHTML=[[associations objectForKey:escapeHTML__Key
withDefaultObject:[_escapeHTML autorelease]] retain]; withDefaultObject:[_escapeHTML autorelease]] retain];
}; };
@ -144,6 +151,7 @@ Bindings
DESTROY(_prefix); DESTROY(_prefix);
DESTROY(_suffix); DESTROY(_suffix);
DESTROY(_displayString); DESTROY(_displayString);
DESTROY(_isDisplayStringBefore);//GSWeb Only
DESTROY(_escapeHTML); DESTROY(_escapeHTML);
[super dealloc]; [super dealloc];
} }
@ -330,6 +338,7 @@ Bindings
id selectionValueValue=nil; id selectionValueValue=nil;
int i=0; int i=0;
id displayStringValue=nil; id displayStringValue=nil;
BOOL isDisplayStringBefore=NO;
id prefixValue=nil; id prefixValue=nil;
id suffixValue=nil; id suffixValue=nil;
id valueValue=nil; // _value value (or auto value) id valueValue=nil; // _value value (or auto value)
@ -366,8 +375,15 @@ Bindings
[_index setValue:[NSNumber numberWithShort:i] [_index setValue:[NSNumber numberWithShort:i]
inComponent:component]; inComponent:component];
if (_isDisplayStringBefore)
isDisplayStringBefore=[self evaluateCondition:_isDisplayStringBefore
inContext:context];
displayStringValue=[_displayString valueInComponent:component]; displayStringValue=[_displayString valueInComponent:component];
if (isDisplayStringBefore)
[response appendContentHTMLString:displayStringValue];
[response appendContentString:@"<INPUT NAME=\""]; [response appendContentString:@"<INPUT NAME=\""];
[response appendContentString:name]; [response appendContentString:name];
@ -412,7 +428,8 @@ Bindings
[response appendContentCharacter:'>']; [response appendContentCharacter:'>'];
[response appendContentString:prefixValue]; [response appendContentString:prefixValue];
[response appendContentHTMLString:displayStringValue]; if (!isDisplayStringBefore)
[response appendContentHTMLString:displayStringValue];
[response appendContentString:suffixValue]; [response appendContentString:suffixValue];
}; };
LOGObjectFnStopC("GSWRadioButtonList"); LOGObjectFnStopC("GSWRadioButtonList");