19declare(strict_types=1);
46 $this->
language->loadLanguageModule(
'irss');
47 $this->ui_factory =
$DIC->ui()->factory();
48 $this->acting_user =
$DIC->user();
54 $unit = match (
true) {
55 $size > self::SIZE_FACTOR * self::SIZE_FACTOR * self::SIZE_FACTOR =>
DataSize::GB,
56 $size > self::SIZE_FACTOR * self::SIZE_FACTOR =>
DataSize::MB,
61 $size = (
int) (round((
float) $size / (
float) $unit, 2) * (float) $unit);
63 return (
string) (
new DataSize($size, $unit));
66 protected function formatDate(\DateTimeImmutable $date): string
69 ->setTimezone(
new \DateTimeZone($this->acting_user->getTimeZone()))
70 ->format(self::DATE_FORMAT);
Builds a Color from either hex- or rgb values.
This class provides the data size with additional information to remove the work to calculate the siz...
ActionGenerator $action_generator
__construct(?ActionGenerator $action_generator=null)
formatDate(\DateTimeImmutable $date)
This is how the factory for UI elements looks.