ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SectionStyleSelector Class Reference
+ Collaboration diagram for SectionStyleSelector:

Public Member Functions

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

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.SectionStyleSelector.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 34 of file class.SectionStyleSelector.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:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getStyleSelector()

SectionStyleSelector::getStyleSelector ( string  $a_selected,
string  $type = "sec-action",
string  $action = "sec.class",
string  $attr = "class",
bool  $include_none = false 
)

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

References $lng, $ui, $ui_wrapper, ilPCSectionGUI\_getCharacteristics(), ILIAS\COPage\Editor\Server\UIWrapper\getButton(), and ilLanguage\txt().

52  : Dropdown {
53  $a_chars = \ilPCSectionGUI::_getCharacteristics($this->style_id);
55  $ui = $this->ui;
56  $lng = $this->lng;
57 
58  $buttons = [];
59  if ($include_none) {
60  $t = "section";
61  $tag = "div";
62  $html = '<div class="ilCOPgEditStyleSelectionItem"><' . $tag . ' class="" style="' . self::$style_selector_reset . '">' . $lng->txt("cont_none") . "</" . $tag . "></div>";
63  $buttons[] = $ui_wrapper->getButton($html, $type, $action, [$attr => ""]);
64  }
65  foreach ($a_chars as $char => $char_lang) {
66  $t = "section";
67  $tag = "div";
68  $html = '<div class="ilCOPgEditStyleSelectionItem"><' . $tag . ' class="ilc_' . $t . '_' . $char . '" style="' . self::$style_selector_reset . '">' . $char_lang . "</" . $tag . "></div>";
69  $buttons[] = $ui_wrapper->getButton($html, $type, $action, [$attr => $char]);
70  }
71  $dd = $ui->factory()->dropdown()->standard($buttons)->withLabel($a_selected);
72  return $dd;
73  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getButton(string $content, string $type, string $action, ?array $data=null, string $component="", bool $primary=false, string $aria_label="")
static _getCharacteristics(int $a_style_id)
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage SectionStyleSelector::$lng
protected

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

Referenced by getStyleSelector().

◆ $style_id

int SectionStyleSelector::$style_id = 0
protected

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

Referenced by __construct().

◆ $style_selector_reset

string SectionStyleSelector::$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.SectionStyleSelector.php.

◆ $ui

ILIAS DI UIServices SectionStyleSelector::$ui
protected

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

Referenced by getStyleSelector().

◆ $ui_wrapper

UIWrapper SectionStyleSelector::$ui_wrapper
protected

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

Referenced by __construct(), and getStyleSelector().


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