Skip to content

Commit

Permalink
fixes opencast-ilias#30 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
okaufman committed Dec 2, 2024
1 parent 9b57d25 commit e3b6081
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions classes/class.ilOpencastPageComponentPluginGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,24 +525,22 @@ protected function setStyleFromProps(ilTemplate $tpl, array $properties)
$tpl->setVariable('RATIO', $ratio);
$tpl->setVariable('MAX-WIDTH', $properties[self::PROP_WIDTH]);
$tpl->setVariable('MAX-HEIGHT', $properties[self::PROP_HEIGHT]);
if (array_key_exists(self::PROP_RESPONSIVE, $properties)) {
if ($properties[self::PROP_RESPONSIVE] != false) {
$tpl->setVariable('WIDTH', 'width:100%;');
}
if ((bool)($properties[self::PROP_RESPONSIVE] ?? false) === true) {
$tpl->setVariable('WIDTH', 'width:100%;');
}
if (array_key_exists(self::PROP_POSITION, $properties)) {
switch ($properties[self::PROP_POSITION]) {
case self::POSITION_CENTER:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:center;');
break;
case self::POSITION_RIGHT:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:right;');
break;
case self::POSITION_LEFT:
default:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:left;');
break;
}


switch ($properties[self::PROP_POSITION] ?? null) {
case self::POSITION_CENTER:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:center;');
break;
case self::POSITION_RIGHT:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:right;');
break;
case self::POSITION_LEFT:
default:
$tpl->setVariable('CONTAINER_STYLE', 'text-align:left;');
break;
}
}

Expand Down

0 comments on commit e3b6081

Please sign in to comment.