Hi
Dne Sun, 21 Mar 2010 02:31:03 +0530 Ninad Pundalik ninadsp16289@gmail.com napsal(a):
After reading through the GSoC Ideas wiki page[0] and the discussion on the feature request[1] of adding AJAX functionality to phpMyAdmin, I could think up of a possible implementation as follows, other than the one already outlined very briefly on the discussion page (of starting out with the Query page, implementing the common jQuery and PHP functions and then replicating the process for the other action pages) :
- Implement this as an add-on in the initial phase. Replicate all
the PHP files which operate on the database in a folder, '/ajax/' making them AJAX endpoints.
No duplication please. Reuse code as much as possible and if not possible factor out functionality you need to separate module.
- Modify the PHP code in each of the endpoints, so that we can output
the content in XML, JSON or plain HTML (whichever is decided to be used).
Most likely HTML because of theming which should be done in PHP and not in JavaScript.
- On each action page, add some PHP code, which checks for a
cookie/database setting and confirms that the client supports JavaScript. In the if block, add jQuery/MooTools code which will manipulate the necessary links and forms on the page, carry out the actual AJAX calls, and also implement callback functions, which will handle the responses from the AJAX endpoints.
There is no need for extra detection - JS enabled => jQuery works => it can hook onto links.