mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-21 02:41:04 +00:00
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:
parent
6697c92c98
commit
2970cf04f3
4 changed files with 43 additions and 2 deletions
|
@ -48,6 +48,9 @@
|
|||
GSWAssociation* _escapeHTML;
|
||||
GSWAssociation* _itemDisabled;
|
||||
BOOL _defaultEscapeHTML;
|
||||
//GSWeb Additions {
|
||||
GSWAssociation* _isDisplayStringBefore;
|
||||
// }
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name
|
||||
|
|
|
@ -61,6 +61,8 @@ Bindings
|
|||
disabled If evaluated to yes, the check box appear inactivated.
|
||||
|
||||
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
|
||||
withDefaultObject:[_escapeHTML autorelease]] retain];
|
||||
NSDebugMLLog(@"gswdync",@"escapeHTML=%@",_escapeHTML);
|
||||
|
||||
if (!WOStrictFlag)
|
||||
{
|
||||
_isDisplayStringBefore=[[associations objectForKey:isDisplayStringBefore__Key
|
||||
withDefaultObject:[_isDisplayStringBefore autorelease]] retain];
|
||||
};
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
|
@ -162,6 +170,7 @@ Bindings
|
|||
DESTROY(_displayString);
|
||||
DESTROY(_itemDisabled);
|
||||
DESTROY(_escapeHTML);
|
||||
DESTROY(_isDisplayStringBefore);//GSWeb Only
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -390,6 +399,7 @@ Bindings
|
|||
id valueValue=nil;
|
||||
id itemValue=nil;
|
||||
BOOL disabledInContext=NO;
|
||||
BOOL isDisplayStringBefore=NO;
|
||||
NSArray* listValue=[_list valueInComponent:component];
|
||||
|
||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||
|
@ -414,7 +424,14 @@ Bindings
|
|||
[_index setValue:[NSNumber numberWithShort:i]
|
||||
inComponent:component];
|
||||
|
||||
if (_isDisplayStringBefore)
|
||||
isDisplayStringBefore=[self evaluateCondition:_isDisplayStringBefore
|
||||
inContext:context];
|
||||
|
||||
displayStringValue=[_displayString valueInComponent:component];
|
||||
|
||||
if (isDisplayStringBefore)
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
|
||||
[response appendContentString:@"<INPUT NAME=\""];
|
||||
[response appendContentString:name];
|
||||
|
@ -462,7 +479,8 @@ Bindings
|
|||
|
||||
[response appendContentCharacter:'>'];
|
||||
[response appendContentString:prefixValue];
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
if (!isDisplayStringBefore)
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
[response appendContentString:suffixValue];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
GSWAssociation* _prefix;
|
||||
GSWAssociation* _suffix;
|
||||
GSWAssociation* _displayString;
|
||||
//GSWeb Additions {
|
||||
GSWAssociation* _isDisplayStringBefore;
|
||||
// }
|
||||
GSWAssociation* _escapeHTML;
|
||||
BOOL _defaultEscapeHTML;
|
||||
BOOL _autoValue;
|
||||
|
|
|
@ -62,6 +62,7 @@ Bindings
|
|||
|
||||
escapeHTML If evaluated to yes, escape displayString
|
||||
|
||||
isDisplayStringBefore If evaluated to yes, displayString is displayed before radio button
|
||||
**/
|
||||
//====================================================================
|
||||
@implementation GSWRadioButtonList
|
||||
|
@ -127,6 +128,12 @@ Bindings
|
|||
withDefaultObject:[_suffix autorelease]] retain];
|
||||
_displayString=[[associations objectForKey:displayString__Key
|
||||
withDefaultObject:[_displayString autorelease]] retain];
|
||||
|
||||
if (!WOStrictFlag)
|
||||
{
|
||||
_isDisplayStringBefore=[[associations objectForKey:isDisplayStringBefore__Key
|
||||
withDefaultObject:[_isDisplayStringBefore autorelease]] retain];
|
||||
};
|
||||
_escapeHTML=[[associations objectForKey:escapeHTML__Key
|
||||
withDefaultObject:[_escapeHTML autorelease]] retain];
|
||||
};
|
||||
|
@ -144,6 +151,7 @@ Bindings
|
|||
DESTROY(_prefix);
|
||||
DESTROY(_suffix);
|
||||
DESTROY(_displayString);
|
||||
DESTROY(_isDisplayStringBefore);//GSWeb Only
|
||||
DESTROY(_escapeHTML);
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -330,6 +338,7 @@ Bindings
|
|||
id selectionValueValue=nil;
|
||||
int i=0;
|
||||
id displayStringValue=nil;
|
||||
BOOL isDisplayStringBefore=NO;
|
||||
id prefixValue=nil;
|
||||
id suffixValue=nil;
|
||||
id valueValue=nil; // _value value (or auto value)
|
||||
|
@ -366,8 +375,15 @@ Bindings
|
|||
[_index setValue:[NSNumber numberWithShort:i]
|
||||
inComponent:component];
|
||||
|
||||
if (_isDisplayStringBefore)
|
||||
isDisplayStringBefore=[self evaluateCondition:_isDisplayStringBefore
|
||||
inContext:context];
|
||||
|
||||
displayStringValue=[_displayString valueInComponent:component];
|
||||
|
||||
if (isDisplayStringBefore)
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
|
||||
[response appendContentString:@"<INPUT NAME=\""];
|
||||
[response appendContentString:name];
|
||||
|
||||
|
@ -412,7 +428,8 @@ Bindings
|
|||
|
||||
[response appendContentCharacter:'>'];
|
||||
[response appendContentString:prefixValue];
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
if (!isDisplayStringBefore)
|
||||
[response appendContentHTMLString:displayStringValue];
|
||||
[response appendContentString:suffixValue];
|
||||
};
|
||||
LOGObjectFnStopC("GSWRadioButtonList");
|
||||
|
|
Loading…
Reference in a new issue