cotonti.com : Ajax part in plugins https://www.cotonti.com Последние сообщения в теме Cotonti en Tue, 21 Oct 2025 11:44:15 -0000 ez

Because ajax responses needs to be FAST
It is usually an action that the user is waiting for (so an UserInterface thing)

If you need rights:
just do: $plug_admin = sed_auth('plug', 'Yourplug', 'A');

Language file:
require_once(sed_langfile('Yourplug'));

I think $cfg is available, not sure about $usr..
maybe try: global $usr]]>
чт, 29 июл 2010 21:40:04 -0000
Macik 0.6.9) when you exec some ajax part of you plugin you can not use usual enviroment.
I talk aboun automatic loading you plugin LANG files and full initing $usr variable.
(I mean $usr['auth_read'], $usr['auth_write'], $usr['isadmin']);

So, now I must include some part of code that duplicate 'plug.inc.php' in each of my plugin that uses AJAX (plug.php?r=plug) and need to be ajax-result localized.

I think it done for some speed optimizing for AJAX part in simple plugins. But some times developer needs full power of CMS to use in AJAX responce part.

My suggestion to make it configurable: when user use additional parameter (for example 'plug.php?e=plug&h=fullajax') it loads all variables and had done all init as in usual plugin part (plug.php?e=plug).]]>
чт, 29 июл 2010 20:36:37 -0000