ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
MediaObjectStyleSelector Class Reference
+ Collaboration diagram for MediaObjectStyleSelector:

Public Member Functions

 __construct (UIWrapper $ui_wrapper, int $style_id)
 
 getStyleSelector (string $a_selected, string $type="media-action", string $action="media.class", string $attr="class")
 

Static Public Attributes

static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 

Protected Attributes

int $style_id = 0
 
UIWrapper $ui_wrapper
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.MediaObjectStyleSelector.php.

Constructor & Destructor Documentation

◆ __construct()

MediaObjectStyleSelector::__construct ( UIWrapper  $ui_wrapper,
int  $style_id 
)

Definition at line 34 of file class.MediaObjectStyleSelector.php.

References $DIC, $style_id, $ui_wrapper, ILIAS\Repository\lng(), and ILIAS\Repository\ui().

37  {
38  global $DIC;
39 
40  $this->ui = $DIC->ui();
41  $this->ui_wrapper = $ui_wrapper;
42  $this->style_id = $style_id;
43  $this->lng = $DIC->language();
44  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getStyleSelector()

MediaObjectStyleSelector::getStyleSelector ( string  $a_selected,
string  $type = "media-action",
string  $action = "media.class",
string  $attr = "class" 
)

Definition at line 46 of file class.MediaObjectStyleSelector.php.

References $ui, $ui_wrapper, ilPCMediaObjectGUI\_getCharacteristics(), and ILIAS\COPage\Editor\Server\UIWrapper\getButton().

51  : Dropdown {
52  $a_chars = \ilPCMediaObjectGUI::_getCharacteristics($this->style_id);
54  $ui = $this->ui;
55 
56  $buttons = [];
57  foreach ($a_chars as $char => $char_lang) {
58  $buttons[] = $ui_wrapper->getButton($char_lang, $type, $action, [$attr => $char]);
59  }
60  return $ui->factory()->dropdown()->standard($buttons)->withLabel($a_selected);
61  }
static _getCharacteristics(int $a_style_id)
Get characteristics.
getButton(string $content, string $type, string $action, ?array $data=null, string $component="", bool $primary=false, string $aria_label="")
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage MediaObjectStyleSelector::$lng
protected

Definition at line 32 of file class.MediaObjectStyleSelector.php.

◆ $style_id

int MediaObjectStyleSelector::$style_id = 0
protected

Definition at line 28 of file class.MediaObjectStyleSelector.php.

Referenced by __construct().

◆ $style_selector_reset

string MediaObjectStyleSelector::$style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
static

Definition at line 27 of file class.MediaObjectStyleSelector.php.

◆ $ui

ILIAS DI UIServices MediaObjectStyleSelector::$ui
protected

Definition at line 31 of file class.MediaObjectStyleSelector.php.

Referenced by getStyleSelector().

◆ $ui_wrapper

UIWrapper MediaObjectStyleSelector::$ui_wrapper
protected

Definition at line 30 of file class.MediaObjectStyleSelector.php.

Referenced by __construct(), and getStyleSelector().


The documentation for this class was generated from the following file: