mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
- allow to specify on sub-type level, if post_process method should be
used for extensions - if extension is called with empty name, it can set a name in cell[name], which then get's used for the content (extensions can use eg. an option to select the name)
This commit is contained in:
parent
02587c2153
commit
3dadb5abe3
@ -426,8 +426,14 @@ class boetemplate extends soetemplate
|
||||
*/
|
||||
protected function haveExtension($type,$function='')
|
||||
{
|
||||
return (self::$extensions[$type] || $this->loadExtension($type,$ui)) &&
|
||||
($function == '' || self::$extensions[$type]->public_functions[$function]);
|
||||
if (self::$extensions[$type] || $this->loadExtension($type,$ui))
|
||||
{
|
||||
if (empty($function)) return true;
|
||||
|
||||
return isset(self::$extensions[$type]->public_functions[$function]) ?
|
||||
self::$extensions[$type]->public_functions[$function] : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -989,6 +989,7 @@ class etemplate extends boetemplate
|
||||
|
||||
$readonly = $cell['readonly'] !== false && ($readonly || $cell['readonly']); // might be set or unset (===false) by extension
|
||||
|
||||
if (is_null($name)) $name = $cell['name'];
|
||||
self::set_array($content,$name,$value);
|
||||
|
||||
if ($cell['type'] == $type.'-'.$sub_type) break; // stop if no further type-change
|
||||
@ -1661,7 +1662,8 @@ class etemplate extends boetemplate
|
||||
break;
|
||||
}
|
||||
// extension-processing need to be after all other and only with diff. name
|
||||
if ($ext_type && !$readonly && $this->haveExtension($ext_type,'post_process'))
|
||||
if ($ext_type && !$readonly && ($have = $this->haveExtension($ext_type,'post_process')) &&
|
||||
($have === true || isset($have[$cell['type']]))) // check if post-process should be used for all sub-types
|
||||
{ // unset it first, if it is already set, to be after the other widgets of the ext.
|
||||
$to_process = self::$request->get_to_process($form_name);
|
||||
self::$request->unset_to_process($form_name);
|
||||
|
Loading…
Reference in New Issue
Block a user