N°8673 - Avoid server overload when user access news page with a lot of unread news (#816)

This commit is contained in:
jf-cbd
2026-02-23 15:35:31 +01:00
committed by GitHub
parent 48e584503e
commit d5f2303ed2
5 changed files with 60 additions and 31 deletions

View File

@@ -33,6 +33,10 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
protected $aDeferredBlocks;
/** @var bool If set to true, the content block will have a surrounding <div> no matter its options / CSS classes / ... */
protected $bHasForcedDiv;
/** @var bool if set to true, the icon will be lazy loaded
* @since 3.2.3
*/
protected bool $bHasLazyLoadIcon;
/**
* UIContentBlock constructor.
@@ -48,6 +52,7 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
$this->aSubBlocks = [];
$this->aDeferredBlocks = [];
$this->bHasForcedDiv = false;
$this->bHasLazyLoadIcon = false;
$this->SetCSSClasses($aContainerClasses);
}
@@ -220,4 +225,24 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
$this->bHasForcedDiv = $bHasForcedDiv;
return $this;
}
/**
* @see static::$bHasLazyLoadIcon
* @return bool
*/
public function HasLazyLoadIcon(): bool
{
return $this->bHasLazyLoadIcon;
}
/**
* @see static::$bHasLazyLoadIcon
* @param bool $bLazyLoadIcon
* @return $this
*/
public function SetHasLazyLoadIcon(bool $bLazyLoadIcon)
{
$this->bHasLazyLoadIcon = $bLazyLoadIcon;
return $this;
}
}