mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-21 02:41:04 +00:00
added support for Direct Actions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@21930 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1f23cdf495
commit
8de6ae31a3
1 changed files with 38 additions and 7 deletions
|
@ -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,@"<input type=\"hidden\" name=\"");
|
||||
GSWResponse_appendContentAsciiString(response,GSWKey_SubmitAction[GSWebNamingConv]);
|
||||
GSWResponse_appendContentCharacter(response,'"');
|
||||
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response,
|
||||
@"value",
|
||||
[self _actionClassAndNameInContext:context],
|
||||
NO);
|
||||
GSWResponse_appendContentCharacter(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];
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue