From e47ecfbe8236cd335443c07646fb4b7de3ac3eaa Mon Sep 17 00:00:00 2001 From: Neo Morina Date: Thu, 9 Nov 2017 14:43:49 +0100 Subject: [PATCH] Made some changes at egw_actions This is a usefull for opening "second level results" as a popup. "Second level results" couldn't get opened as a popup at Project Manager app when i try to add a new Project as Template at the selected Project. --- api/src/Etemplate/Widget/Nextmatch.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Nextmatch.php b/api/src/Etemplate/Widget/Nextmatch.php index 79a1c71bd1..ae25e21121 100644 --- a/api/src/Etemplate/Widget/Nextmatch.php +++ b/api/src/Etemplate/Widget/Nextmatch.php @@ -848,7 +848,17 @@ class Nextmatch extends Etemplate\Widget //echo "*** Inserting id=$prefix$id"; _debug_array($action); // we break at end of foreach loop, as rest of actions is already dealt with // by putting them as children - } + + // sets the default attributes to every children dataset + if (is_array($action['children'])) { + foreach ($action['children'] as $key => $children) { + // checks if children is a valid array and if the "$default_attrs" variable exists + if (is_array($action['children'][$key]) && $default_attrs) { + $action['children'][$key] += $default_attrs; + } + } + } + } // add all first level popup actions plus ones with enabled = 'javaScript:...' to action_links if ((!isset($action['type']) || in_array($action['type'],array('popup','drag','drop'))) && // popup is the default @@ -1172,4 +1182,4 @@ class Nextmatch extends Etemplate\Widget } // Registration needs to go here, otherwise customfields won't be loaded until some other cf shows up -Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Customfields', array('nextmatch-customfields')); \ No newline at end of file +Etemplate\Widget::registerWidget(__NAMESPACE__.'\\Customfields', array('nextmatch-customfields'));