ILIAS  release_8 Revision v8.24
class.MediaObjectStyleSelector.php
Go to the documentation of this file.
1<?php
2
20
23
28{
29 public static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;";
30 protected int $style_id = 0;
31
33 protected \ILIAS\DI\UIServices $ui;
34 protected \ilLanguage $lng;
35
36 public function __construct(
38 int $style_id
39 ) {
40 global $DIC;
41
42 $this->ui = $DIC->ui();
43 $this->ui_wrapper = $ui_wrapper;
44 $this->style_id = $style_id;
45 $this->lng = $DIC->language();
46 }
47
48 public function getStyleSelector(
49 string $a_selected,
50 string $type = "media-action",
51 string $action = "media.class",
52 string $attr = "class"
53 ): Dropdown {
54 $a_chars = \ilPCMediaObjectGUI::_getCharacteristics($this->style_id);
56 $ui = $this->ui;
57
58 $buttons = [];
59 foreach ($a_chars as $char => $char_lang) {
60 $buttons[] = $ui_wrapper->getButton($char_lang, $type, $action, [$attr => $char]);
61 }
62 return $ui->factory()->dropdown()->standard($buttons)->withLabel($a_selected);
63 }
64}
getStyleSelector(string $a_selected, string $type="media-action", string $action="media.class", string $attr="class")
getButton(string $content, string $type, string $action, array $data=null, string $component="", string $aria_label="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$type