mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
use $method parameter of Api\Etemplate::exec() plus new et2_process handler as menuaction GET parameter
allows determining the called function on the URL to eg. send it to different FPM pool (before the menuaction of et2 was always "EGroupware\Api\Etemplate::ajax_process_content")
This commit is contained in:
parent
f50b405555
commit
1f4cb50e74
@ -1441,7 +1441,7 @@ export class etemplate2
|
||||
{
|
||||
uniqueId = data.DOMNodeID.replace('.', '-') + '-' + data['open_target'];
|
||||
}
|
||||
const et2 = new etemplate2(node, data.menuaction, uniqueId);
|
||||
const et2 = new etemplate2(node, data.data.menuaction, uniqueId);
|
||||
return et2.load(data.name, data.url, data.data, null, null, null, data['fw-target']);
|
||||
}
|
||||
else
|
||||
|
@ -371,7 +371,7 @@ window.app = {classes: {}};
|
||||
// Resize popup when et2 load is done
|
||||
jQuery(node).on('load', () => window.setTimeout(resize_popup, 50));
|
||||
}
|
||||
const et2 = new etemplate2(node, "EGroupware\\Api\\Etemplate::ajax_process_content");
|
||||
const et2 = new etemplate2(node, data.data.menuaction);
|
||||
et2.load(data.name, data.url, data.data);
|
||||
if (typeof data.response !== 'undefined') {
|
||||
const json_request = egw(window).json("");
|
||||
|
@ -207,6 +207,7 @@ class Etemplate extends Etemplate\Widget\Template
|
||||
'validation_errors' => self::$validation_errors,
|
||||
'langRequire' => array_values($langRequire),
|
||||
'currentapp' => $currentapp,
|
||||
'menuaction' => $method.(strpos($method, '::') !== false ? '::' : '.').'et2_process',
|
||||
);
|
||||
|
||||
if (!empty($data['content']['nm']['rows']) && is_array($data['content']['nm']['rows']))
|
||||
|
@ -159,6 +159,9 @@ class Request
|
||||
case 'etemplate': // eg. ajax code in an eTemplate widget
|
||||
$menuaction = ($appName = 'etemplate').'.'.$className.'.'.$functionName;
|
||||
break;
|
||||
case 'et2_process':
|
||||
$menuaction = ($className=Api\Etemplate::class).'::'.($functionName='ajax_process_content');
|
||||
break;
|
||||
case 'template': // calling current template / framework object
|
||||
$menuaction = $appName.'.'.$className.'.'.$functionName;
|
||||
$className = get_class($GLOBALS['egw']->framework);
|
||||
|
Loading…
Reference in New Issue
Block a user