[dev] Ajax on Horde
Sebastian Birnbach
birnbacs at gmail.com
Wed Oct 11 07:33:50 UTC 2017
Not much is known about Horde's way to do Ajax. The doc on
https://wiki.horde.org/Doc/Dev/HordeAjaxApplications seems to be a bit
wobbly and is at least partly outdated.
I seek to understand the very basic exchange of information between a
client side document and a server side class. Looking into Horde is often
like looking into a live organism: too many things going on at the same
time to understand an isolated feature.
On my own I came about this far:
* <app> registers an Ajax handler in <app>/lib/Ajax/Application.php:
class IMP_Ajax_Application extends Horde_Core_Ajax_Application{
$this->addHandler(Some_Path_To_Class);
}
* <app>/lib/Some/Path/To/Class.php defines the processing code:
class IMP_Ajax_Application_Handler_Draft extends
Horde_Core_Ajax_Application_Handler{
public function foo() {return "hello world"}
}
* <app>/js/<app>.js defines a variable that contains a function that
eventually calls doAction(action, params, opts)
[this bit is unclear to me]
* on the client side, based on some event, call that function so that
doAction() gets triggered
* a request will be sent to Horde Core which distributes it back to the
registered class to process and return its response
* now, the response should be passed on to some callback function in the
<app>.js file, I suppose
Could somebody please shed some light on this?
Thanks
Sebastian
More information about the dev
mailing list