mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 03:01:27 +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];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
//====================================================================
|
// PRIVATE used within dynamic elements
|
||||||
@implementation GSWSubmitButton (GSWSubmitButtonA)
|
- (NSString*) _actionClassAndNameInContext:(GSWContext*) context
|
||||||
|
{
|
||||||
|
NSString * s = [self computeActionStringWithActionClassAssociation: _actionClass
|
||||||
|
directActionNameAssociation: _directActionName
|
||||||
|
inContext: context];
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)appendToResponse:(GSWResponse*)response
|
-(void)appendToResponse:(GSWResponse*)response
|
||||||
|
@ -98,6 +104,20 @@ RCS_ID("$Id$")
|
||||||
GSWSaveAppendToResponseElementID(context);
|
GSWSaveAppendToResponseElementID(context);
|
||||||
[super appendToResponse:response
|
[super appendToResponse:response
|
||||||
inContext:context];
|
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);
|
GSWStopElement(context);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
@ -224,13 +244,24 @@ RCS_ID("$Id$")
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
// used within dynamic elements
|
||||||
|
|
||||||
-(void)appendNameToResponse:(GSWResponse*)response
|
-(void)appendNameToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)aContext
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
if (_actionClass != nil || _directActionName != nil)
|
||||||
//Here we call parent (GSWInput) method instead of doing it by ourself (as GSW)
|
{
|
||||||
[super appendNameToResponse:response
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response,
|
||||||
inContext:aContext];
|
@"name",
|
||||||
|
[self _actionClassAndNameInContext: aContext],
|
||||||
|
NO);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[super appendNameToResponse:response
|
||||||
|
inContext:aContext];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue