Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
+20
-10
@@ -938,6 +938,11 @@ class Area
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
protected ?int $_visibleWidgets = null;
|
||||
|
||||
/**
|
||||
* Total number of widgets that will be rendered in this area
|
||||
*
|
||||
@@ -945,21 +950,26 @@ class Area
|
||||
*/
|
||||
public function totalVisibleWidgets() : int
|
||||
{
|
||||
$total = 0;
|
||||
if( $this->_visibleWidgets === null )
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
if( $this->isWidget() and !empty( $this->getWidgetContent() ) )
|
||||
{
|
||||
$total++;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $this->children as $child )
|
||||
if( $this->isWidget() and !empty( $this->getWidgetContent() ) )
|
||||
{
|
||||
$total += $child->totalVisibleWidgets();
|
||||
$total++;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( $this->children as $child )
|
||||
{
|
||||
$total += $child->totalVisibleWidgets();
|
||||
}
|
||||
}
|
||||
|
||||
$this->_visibleWidgets = $total;
|
||||
}
|
||||
|
||||
return $total;
|
||||
return $this->_visibleWidgets;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user