From 1607b1303bd9bbc0cf5a40fb865a55bb503e7e14 Mon Sep 17 00:00:00 2001 From: dwetzel Date: Mon, 31 Oct 2005 14:31:18 +0000 Subject: [PATCH] added support for Direct Actions git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@21930 72102866-910b-0410-8b05-ffd578937521 --- GSWeb.framework/GSWSubmitButton.m | 45 ++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/GSWeb.framework/GSWSubmitButton.m b/GSWeb.framework/GSWSubmitButton.m index d25fefc..b31e35f 100644 --- a/GSWeb.framework/GSWSubmitButton.m +++ b/GSWeb.framework/GSWSubmitButton.m @@ -83,10 +83,16 @@ RCS_ID("$Id$") [super dealloc]; }; -@end -//==================================================================== -@implementation GSWSubmitButton (GSWSubmitButtonA) +// PRIVATE used within dynamic elements +- (NSString*) _actionClassAndNameInContext:(GSWContext*) context +{ + NSString * s = [self computeActionStringWithActionClassAssociation: _actionClass + directActionNameAssociation: _directActionName + inContext: context]; + + return s; +} //-------------------------------------------------------------------- -(void)appendToResponse:(GSWResponse*)response @@ -98,6 +104,20 @@ RCS_ID("$Id$") GSWSaveAppendToResponseElementID(context); [super appendToResponse:response inContext:context]; + + if (_actionClass != nil || _directActionName != nil) + { + + GSWResponse_appendContentAsciiString(response,@"'); + } + GSWStopElement(context); LOGObjectFnStop(); }; @@ -224,13 +244,24 @@ RCS_ID("$Id$") }; //-------------------------------------------------------------------- + +// used within dynamic elements + -(void)appendNameToResponse:(GSWResponse*)response inContext:(GSWContext*)aContext { - //OK - //Here we call parent (GSWInput) method instead of doing it by ourself (as GSW) - [super appendNameToResponse:response - inContext:aContext]; + if (_actionClass != nil || _directActionName != nil) + { + GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, + @"name", + [self _actionClassAndNameInContext: aContext], + NO); + } + else + { + [super appendNameToResponse:response + inContext:aContext]; + } }; //--------------------------------------------------------------------