silverstripe/sapphire — pull request #264 by sminnee (2012-03-24 02:25:37+00:00)
Title: Get fragment fixes

One for Ingo...

X-Get-Fragment is intended as a generic system for managing the requesting of fragments via ajax. There were some specific bugs where non-ajax form submissions weren't handled at all, which made the system very brittle in the case of a JS error.

Specifically, X-Get-Fragment frees the back-end from having to know too much about how the JS is specifically encoded: the JS will tell the PHP code what fragment is expected, and the PHP code can be configured to support a nub

- CurrentForm: The full HTML of the form in question
- Content: The RHS panel

The JS for loadPanel() now interrogates the element that the content is going into to determine the correct X-Get-Fragment header.

Note: handleFragmentResponse() is part of RequestHandler so that we can use it on GridField as well.