Etemplate: Make sure all attributes get expanded

This commit is contained in:
nathangray 2021-02-04 14:48:22 -07:00
parent b85a1f0627
commit be9fcea5c5

View File

@ -577,12 +577,20 @@ class Widget
*/ */
protected function expand_widget(Widget &$child, array &$expand) protected function expand_widget(Widget &$child, array &$expand)
{ {
$attrs = $child->attrs;
unset($attrs['type']);
foreach($attrs as $name => &$value)
{
$value = self::expand_name($value,$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']);
}
if($attrs['attributes'])
{
$attrs = array_merge($attrs, $attrs['attributes']);
}
if(strpos($child->attrs['type'], '@') !== false || strpos($child->attrs['type'], '$') !== false) if(strpos($child->attrs['type'], '@') !== false || strpos($child->attrs['type'], '$') !== false)
{ {
$type = self::expand_name($child->attrs['type'],$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']); $type = self::expand_name($child->attrs['type'],$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']);
$id = self::expand_name($child->id,$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']); $id = self::expand_name($child->id,$expand['c'], $expand['row'], $expand['c_'], $expand['row_'], $expand['cont']);
$attrs = $child->attrs;
unset($attrs['type']);
$expanded_child = self::factory($type, false,$id); $expanded_child = self::factory($type, false,$id);
$expanded_child->id = $id; $expanded_child->id = $id;
$expanded_child->type = $type; $expanded_child->type = $type;